forked from Mirrors/wine-wine
Compare commits
420 Commits
Author | SHA1 | Date |
---|---|---|
Michael Stefaniuc | 0aceab5884 | |
Isira Seneviratne | 3c16e4a7d0 | |
Ken Thomases | ed092ee074 | |
Piotr Caban | 67672080ba | |
Zebediah Figura | 1c47ee7afa | |
Chip Davis | a6dde4d38b | |
Alexandre Julliard | 39d3c93162 | |
Alexandre Julliard | 6d2df2328f | |
Alexandre Julliard | 0cc00dfb4e | |
Alexandre Julliard | 3b50c56fd3 | |
Rémi Bernon | 55d1a591ef | |
Paul Gofman | 9d42b179a9 | |
Ethan Lee | fc274645cf | |
Andrew Sheldon | 0355ca9e2b | |
Patrick Hibbs | 4d18a7f237 | |
Rémi Bernon | e11718fba0 | |
Alistair Leslie-Hughes | b37845dbcc | |
Jeff Smith | 4818f65c04 | |
Michael Müller | 501eb50def | |
Louis Lenders | 6520a17987 | |
Jacek Caban | 01256bcaa9 | |
Louis Lenders | ec1cd2e6c7 | |
Jacek Caban | 55adc43492 | |
Alistair Leslie-Hughes | c74ab1766f | |
Louis Lenders | 84f800e96b | |
Alex Henrie | 883e8e8580 | |
Damjan Jovanovic | b3f5764fb8 | |
Dmitry Timoshkov | 499b8465c8 | |
Alexandre Julliard | 08bededc30 | |
Alexandre Julliard | a21082bf04 | |
Piotr Caban | 03ba98305e | |
Damjan Jovanovic | b4e12ea07f | |
Dmitry Timoshkov | aad05a928f | |
Damjan Jovanovic | 2a3f639372 | |
Gijs Vermeulen | 2d6f581595 | |
Paul Gofman | bc846f4b8d | |
Nikolay Sivov | 8fa08b8490 | |
Louis Lenders | 861d7d51de | |
Michael Müller | 63cd49cb2a | |
Byeongsik Jeon | 54cdf4c92d | |
Byeongsik Jeon | ef857c3d80 | |
Rémi Bernon | a46bdec8eb | |
Nikolay Sivov | ccb9b6bbe8 | |
Damjan Jovanovic | 08f0db251e | |
Vijay Kiran Kamuju | be712881ee | |
Nikolay Sivov | 3c249a2c63 | |
Joseph Kogut | 8f1a46c73c | |
Myah Caron | 825d60d32f | |
Jeff Smith | 29e934979e | |
Alistair Leslie-Hughes | c3a9c35499 | |
Kevin Puetz | 6cc918ac62 | |
Damjan Jovanovic | 4fcde9a3c9 | |
Alistair Leslie-Hughes | 4e52083781 | |
Fabian Maurer | ce50dc4a3e | |
Fabian Maurer | 641f9344ef | |
Fabian Maurer | bfda873b38 | |
Fabian Maurer | 73e1415b8a | |
Liam Middlebrook | 8743e7a303 | |
Louis Lenders | 42594c785d | |
Damjan Jovanovic | 2cf27cba96 | |
Damjan Jovanovic | 0a1ba97b04 | |
Damjan Jovanovic | c3399383e4 | |
Damjan Jovanovic | 016bcb6f57 | |
Damjan Jovanovic | 7abfa62850 | |
Damjan Jovanovic | a9b3fe4f87 | |
Damjan Jovanovic | 13f43c319d | |
Alex Henrie | 01269a0b00 | |
Alexandre Julliard | 3c91375533 | |
Fabian Maurer | c6dcd26025 | |
Vincent Povirk | b9ded7e871 | |
Paul Gofman | 9f35b60840 | |
Paul Gofman | 6c6b34839d | |
Nikolay Sivov | ca86f49f51 | |
Paul Gofman | 596945d4a3 | |
Paul Gofman | 63cf5771a8 | |
Felix Hädicke | d20c3d3f1a | |
Alistair Leslie-Hughes | 7af7189c28 | |
Piotr Caban | bf8638c41b | |
Paul Gofman | fbe718f24c | |
Gijs Vermeulen | e6b07d2159 | |
Zebediah Figura | cd13f18f11 | |
Matteo Bruni | a709cfe061 | |
Alistair Leslie-Hughes | 017a0173ac | |
Michael Müller | 7b03029f7d | |
Zhiyi Zhang | 2f2ee0cde0 | |
Jeff Smith | 5278fb29ac | |
Andrew Eikum | 01ea6a5b63 | |
Fabian Maurer | 22d4fbae9d | |
Piotr Caban | 8aab6644c0 | |
Akihiro Sagawa | 8ce3f98888 | |
Akihiro Sagawa | ce8d7855f2 | |
Akihiro Sagawa | ed576ab2f9 | |
Bernhard belacker | f94d88e8a9 | |
Fabian Maurer | 583feb4b7c | |
Akihiro Sagawa | 17c72ce2ca | |
Akihiro Sagawa | 46a10a18a3 | |
Richard Pospesel | c1f2e4ae76 | |
Chip Davis | e42d4b5634 | |
Michael Stefaniuc | ab71182fbe | |
Andrey Gusev | f990ce8652 | |
Owen Rudge | 00fd2319ff | |
Zebediah Figura | 6df7d78f51 | |
Zebediah Figura | 21734aa3c0 | |
Hans Leidekker | e9ee9a9149 | |
Hans Leidekker | 249ee6f278 | |
Hans Leidekker | f6a0f02970 | |
Nikolay Sivov | b8ce8e48ab | |
Nikolay Sivov | 0abdeffeb0 | |
Nikolay Sivov | 2ffe8fd64d | |
Nikolay Sivov | d9314b5d21 | |
Enol Puente | 01d16cc01a | |
Enol Puente | 62edbf6624 | |
Enol Puente | 113f49c38e | |
Vijay Kiran Kamuju | ec1d0af95c | |
Vijay Kiran Kamuju | 5ff99b30a6 | |
Vijay Kiran Kamuju | b9903ce0ce | |
Vijay Kiran Kamuju | 3acd748808 | |
Vijay Kiran Kamuju | d35194d7df | |
Vijay Kiran Kamuju | 9c37afae2a | |
Vijay Kiran Kamuju | fd9303dd40 | |
Vijay Kiran Kamuju | 0e72518a04 | |
Vijay Kiran Kamuju | c130bbfd06 | |
Vijay Kiran Kamuju | 84868a0adb | |
Vijay Kiran Kamuju | 83b75de9c5 | |
Ken Thomases | add7aa1a3c | |
Alistair Leslie-Hughes | be4553a807 | |
Alistair Leslie-Hughes | 39f5c0ff2b | |
Sven Baars | 9b2afce2b7 | |
Sven Baars | 026af56dba | |
Sven Baars | 40f8298659 | |
Sven Baars | 8a6f5f958f | |
Jeff Smith | 1d787b707b | |
Sven Baars | 191f5e03ae | |
Sven Baars | f41154ce7f | |
Sven Baars | 86b5e684a4 | |
Sven Baars | 7d8a34d6a1 | |
Zhiyi Zhang | cc0b0b9fcf | |
Jacek Caban | 04dce9bc0b | |
Zebediah Figura | 2a6171fce9 | |
Zebediah Figura | 090c7ad438 | |
Aric Stewart | d0a450a32c | |
Piotr Caban | beeadfb055 | |
Alexandre Julliard | c277654c3b | |
Alexandre Julliard | 09f48cc249 | |
Alexandre Julliard | 87e7425820 | |
Alex Henrie | 85dfdc2eb5 | |
Alexandre Julliard | ef2cf798b3 | |
Stefan Dösinger | 1ea857f188 | |
Rémi Bernon | 9475480548 | |
Henri Verbeet | 08e6c3ef21 | |
Kai Krakow | 1883742248 | |
Kristján Gerhardsson | 4e87fbc1e0 | |
Kristján Gerhardsson | 11a806edac | |
Kristján Gerhardsson | 3a3deb4d98 | |
Michael Müller | 7e18c69962 | |
Michael Müller | f4cdd56192 | |
Michael Müller | 0c2e7e2d5b | |
Paul Gofman | 14a0ed92fb | |
Paul Gofman | dfa69cd6e3 | |
Paul Gofman | 6b1406e11f | |
Paul Gofman | b0beb1c992 | |
Paul Gofman | 3490957b74 | |
Akihiro Sagawa | 7bad7c1387 | |
Akihiro Sagawa | 721e319aed | |
Alex Henrie | 08a38b915a | |
Gijs Vermeulen | 7cc0e254a3 | |
Vincent Povirk | 0d620861ce | |
Qian Hong | dce4b41cfd | |
Ethan Lee | 0508ac9c79 | |
Hans Leidekker | 9899acf0d8 | |
Damjan Jovanovic | f2a4c06ce5 | |
Zebediah Figura | 3c8c47b1fb | |
Zebediah Figura | a2ea837849 | |
Dmitry Timoshkov | aa2bc95362 | |
Henri Verbeet | 508b45c463 | |
Alistair Leslie-Hughes | b9a24ae16e | |
Alistair Leslie-Hughes | ba957cd2e4 | |
Michael Müller | feae008b95 | |
Zebediah Figura | 03aca2e96b | |
Zebediah Figura | 020990b77d | |
Zebediah Figura | 8c60e37443 | |
Akihiro Sagawa | 12fb7e9a75 | |
Akihiro Sagawa | 5b810ec3bd | |
Andrew Eikum | 318a41030e | |
Gabriel Ivăncescu | e049888541 | |
Gabriel Ivăncescu | 786a246aa6 | |
Paul Gofman | dc3cb001af | |
Zebediah Figura | f46d69c9bb | |
Zebediah Figura | dff0bc91cd | |
Zebediah Figura | 22b6b13efb | |
Piotr Caban | 1b925afd24 | |
Nikolay Sivov | d049e4965d | |
Louis Lenders | a456415d73 | |
Jacek Caban | 5687d66c68 | |
Vincent Povirk | 0efc5086a2 | |
Bryon Roche | 5afbcf16ab | |
Dmitry Timoshkov | df2aaade92 | |
Dmitry Timoshkov | c37a2384d2 | |
Gabriel Ivăncescu | e45081fd2e | |
Gabriel Ivăncescu | 5b45b6232f | |
Fabian Maurer | 29407887be | |
Zebediah Figura | 7ddb1120ec | |
Dmitry Timoshkov | 146f2f6087 | |
Dmitry Timoshkov | 7978df132a | |
Tim Schumacher | e948441070 | |
Fabian Maurer | f91928eb69 | |
Jactry Zeng | 2845efb524 | |
Vincent Povirk | 980ce34096 | |
Alexandre Julliard | b2e3d387af | |
Paul Gofman | 03222a8dad | |
Alistair Leslie-Hughes | 340d95a1af | |
John Thomson | acd57c7d44 | |
Austin English | 80b0fb95e8 | |
Vijay Kiran Kamuju | f94821e59e | |
Dmitry Timoshkov | 70f00e6246 | |
Nikolay Sivov | d10f213840 | |
Nikolay Sivov | 0a77cef2ee | |
Erich E. Hoover | 97cf4f154d | |
Erich E. Hoover | dfcef81b5b | |
Martin Liska | a4aedec7f5 | |
Hans Leidekker | 329ef8cebd | |
Louis Lenders | 00902009d0 | |
Zhiyi Zhang | 3bdadd4ab4 | |
Zhiyi Zhang | ee5d3beda5 | |
Paul Gofman | 93caaebd39 | |
Michael Müller | 0135e88483 | |
Zebediah Figura | 91fdecbd95 | |
Paul Gofman | 7feef68ff1 | |
Paul Gofman | 31487700d4 | |
Paul Gofman | cbff05e6c9 | |
Paul Gofman | 056e171352 | |
Paul Gofman | f0d4f1b5c7 | |
Paul Gofman | f61d1b1d7b | |
Michael Stefaniuc | acfa1c8c9f | |
Alistair Leslie-Hughes | 6d7c890e83 | |
Alistair Leslie-Hughes | 88316ea811 | |
Alistair Leslie-Hughes | 20f2d0726b | |
Alistair Leslie-Hughes | b09a3bd621 | |
Tim Schumacher | 313dc20036 | |
Tim Schumacher | 4fcf59e0f2 | |
Zhiyi Zhang | cf4883de13 | |
Paul Gofman | f7e395df32 | |
Matteo Bruni | c203334c05 | |
Alexandre Julliard | 963ec4699f | |
Vijay Kiran Kamuju | 551cba7c31 | |
Hans Leidekker | b1f4c5ea0c | |
Louis Lenders | 6c8534b5e9 | |
Zebediah Figura | 20a434478a | |
Vijay Kiran Kamuju | 95f9456815 | |
Nikola Pavlica | 43f2cc6372 | |
Nikola Pavlica | 6c105094e4 | |
Andrey Gusev | 8e62ef4ca0 | |
Andrey Gusev | e3539df7a9 | |
Józef Kucia | f8795125cd | |
Gijs Vermeulen | 0cfe81859c | |
Vlad Bespalov | 788ef367cc | |
Louis Lenders | ef4bf0885d | |
Louis Lenders | b27c6672ac | |
Nikolay Sivov | f757ea635c | |
Bruno Jesus | b9333b02f6 | |
Austin English | caade2f611 | |
Piotr Caban | 4972b18632 | |
Gijs Vermeulen | e5cc66718d | |
Gijs Vermeulen | 0834006ce9 | |
Gijs Vermeulen | 148d3545f3 | |
Thomas J. Moore | 2fae324cc4 | |
Piotr Caban | bbb4f68684 | |
Matteo Bruni | 2305f7966f | |
Zebediah Figura | 0f4e5ca849 | |
Matteo Bruni | 865563e065 | |
Zebediah Figura | 2497c5e781 | |
Zebediah Figura | d63079f2c7 | |
Alexandre Julliard | 9c41c5aa46 | |
Alistair Leslie-Hughes | 599e8995c6 | |
Zebediah Figura | 307ce18efe | |
Zebediah Figura | 239c6e4449 | |
Paul Gofman | d1423d4f7c | |
Sebastian Lackner | d756bb7f6b | |
Paul Gofman | 7bbec8bf22 | |
Zebediah Figura | 5c50407f7f | |
Vincent Povirk | 18151cbd1a | |
Vijay Kiran Kamuju | e06b8d3e8d | |
Michael Müller | ec32204921 | |
Zhiyi Zhang | b87334d6a9 | |
Sebastian Lackner | 6eb596c5e8 | |
Claudio Fontana | 346b743bc1 | |
Henri Verbeet | 4a6314363e | |
Piotr Caban | 9e5541cbfb | |
Gijs Vermeulen | d614927a10 | |
Hans Leidekker | fee0e11d36 | |
Hans Leidekker | 7748bc4e34 | |
Louis Lenders | 8dbcf21fcf | |
Gijs Vermeulen | d8116f5a6e | |
Piotr Caban | ff1ce89f62 | |
Piotr Caban | d3eecb9bf2 | |
Zebediah Figura | b77e677474 | |
Zebediah Figura | f462faf675 | |
Paul Gofman | c64f450e6e | |
Louis Lenders | 788137f838 | |
Louis Lenders | b49784271f | |
Louis Lenders | 7bb2f00bc5 | |
Sebastian Lackner | 9e5e27a7d2 | |
Alistair Leslie-Hughes | 6a5ecfedbc | |
Michael Müller | 0dd77b7c07 | |
Mark Jansen | 52bcfdefdd | |
Alistair Leslie-Hughes | a5079be68f | |
Zebediah Figura | c26d4c91cd | |
Zebediah Figura | 2e94bb648f | |
Gijs Vermeulen | ddec4bd912 | |
Nikolay Sivov | 901742c35a | |
Brendan McGrath | bf1098a30a | |
Nikolay Sivov | 0c76e18c36 | |
Nikolay Sivov | 853731b3a8 | |
Louis Lenders | 7609f0a253 | |
Matteo Bruni | d08c25cfc2 | |
Matteo Bruni | 97239e6de5 | |
Matteo Bruni | 2812878727 | |
Matteo Bruni | bab36ab3b6 | |
Matteo Bruni | a7bbfcbe40 | |
Zebediah Figura | 1b9ff0e8ec | |
Sebastian Lackner | f516b26916 | |
Dmitry Timoshkov | a8aafa4c27 | |
Gijs Vermeulen | 47d9d43974 | |
André Hentschel | 89046193dc | |
André Hentschel | ce799d6b15 | |
André Hentschel | b692b9def1 | |
André Hentschel | 7b61745e38 | |
André Hentschel | 553368ff50 | |
Michael Stefaniuc | d444288268 | |
Michael Stefaniuc | 635d2417a9 | |
Ken Thomases | 9ebf93be20 | |
Isira Seneviratne | b65f69b3cf | |
Isira Seneviratne | a90112d178 | |
Isira Seneviratne | 60203f4aad | |
Isira Seneviratne | 0be34e5a0d | |
Isira Seneviratne | 6cec111568 | |
Isira Seneviratne | 3edfc2d452 | |
Isira Seneviratne | bb93efc3f5 | |
Isira Seneviratne | a1f5a2903a | |
Isira Seneviratne | f3e1448614 | |
Isira Seneviratne | 2b895a8860 | |
Paul Gofman | b364e0b0e3 | |
Sven Baars | ffc5659373 | |
Sven Baars | 1ff87a653f | |
Sven Baars | fc0f5548e7 | |
Sven Baars | 93a396f4de | |
Sven Baars | 2eac88925a | |
Sven Baars | ab61ff13b1 | |
Mark Jansen | 2e87908e00 | |
Sven Baars | 1d47e2bc99 | |
Sven Baars | c9dad2c6ce | |
Sven Baars | cf05d6679d | |
Sven Baars | ddc0167d6a | |
Sven Baars | 427b8c6791 | |
Sven Baars | a754861ef7 | |
Sven Baars | 66529e3f22 | |
Sven Baars | 2b0d945252 | |
Zhiyi Zhang | f0b022bdf5 | |
Zebediah Figura | e4b249f2e1 | |
Hans Leidekker | 8ebf718134 | |
Zebediah Figura | 3b051c8e4e | |
Andrew Eikum | 4614f5acb6 | |
Alexandre Julliard | 7973e1374a | |
Zhiyi Zhang | d76718e438 | |
Dmitry Timoshkov | 2a532f4809 | |
Paul Gofman | ea33e9e51b | |
Gijs Vermeulen | 97b0486be7 | |
Zhiyi Zhang | 1d6a633a26 | |
Sveinar Søpler | 1ad3a179f6 | |
Gijs Vermeulen | dcd7bf05c1 | |
Vijay Kiran Kamuju | 7372c59d78 | |
Nikolay Sivov | 3838bc9698 | |
Alistair Leslie-Hughes | a532a9f7f7 | |
Vijay Kiran Kamuju | 380d97406f | |
Alexandre Julliard | 144db807a5 | |
Piotr Caban | b26f35d9ef | |
Paul Gofman | 9d66116b9c | |
Paul Gofman | a2b99898e9 | |
Paul Gofman | 984f2a75b2 | |
Paul Gofman | 8b7fad0648 | |
Nikolay Sivov | d185fc2f1e | |
Nikolay Sivov | 502db40962 | |
Brendan McGrath | 717cfe7f63 | |
Brendan McGrath | 2c3ab31c55 | |
Nikolay Sivov | ec10ad3dbc | |
Józef Kucia | a6c2eadfc8 | |
Alistair Leslie-Hughes | 31b05fdc72 | |
Zebediah Figura | 449e0c5c0a | |
Piotr Caban | df2ae75f87 | |
Hans Leidekker | fc1c668745 | |
Alistair Leslie-Hughes | afaf8fa10d | |
Paul Gofman | d141c9428e | |
Hans Leidekker | 3b03145299 | |
Zebediah Figura | e822720a1d | |
Zebediah Figura | 0c60e7a27c | |
Nikolay Sivov | 59202a9a6a | |
Alistair Leslie-Hughes | c75d8e66a5 | |
Paul Gofman | ac96d882bf | |
Nikolay Sivov | 4e8dc0577c | |
Józef Kucia | ea092de37c | |
Gabriel Ivăncescu | 284049f770 | |
Dmitry Timoshkov | bf3ca297c5 | |
Matteo Bruni | 4c37270f0e | |
Matteo Bruni | 212b24164e | |
Matteo Bruni | e36c8d616e | |
Nikolay Sivov | ed80f1c4e7 | |
Zhiyi Zhang | b357d44e9e | |
Fabian Maurer | fe771ad8ac | |
Fabian Maurer | 697e9d04b2 | |
Sebastian Lackner | e98f711639 | |
Jacek Caban | 1ddfedd051 | |
Piotr Caban | f788805244 | |
Piotr Caban | a6debb6796 | |
Józef Kucia | 8cb1de4d06 | |
Nikolay Sivov | e8a705b4c8 | |
Gijs Vermeulen | c9a2aa88e9 | |
Nikolay Sivov | 4843534b28 | |
David Adam | 6b5088b371 | |
David Adam | 2b941ca0c3 | |
Zhiyi Zhang | 7483a38d4c |
716
ANNOUNCE
716
ANNOUNCE
|
@ -1,19 +1,12 @@
|
|||
The Wine team is proud to announce that the stable release Wine 4.0
|
||||
is now available.
|
||||
The Wine maintenance release 4.0.4 is now available.
|
||||
|
||||
This release represents a year of development effort and over 6,000
|
||||
individual changes. It contains a large number of improvements that
|
||||
are listed in the release notes below. The main highlights are:
|
||||
|
||||
- Vulkan support.
|
||||
- Direct3D 12 support.
|
||||
- Game controllers support.
|
||||
- High-DPI support on Android.
|
||||
What's new in this release (see below for details):
|
||||
- Various bug fixes
|
||||
|
||||
The source is available from the following locations:
|
||||
|
||||
https://dl.winehq.org/wine/source/4.0/wine-4.0.tar.xz
|
||||
http://mirrors.ibiblio.org/wine/source/4.0/wine-4.0.tar.xz
|
||||
https://dl.winehq.org/wine/source/4.0/wine-4.0.4.tar.xz
|
||||
http://mirrors.ibiblio.org/wine/source/4.0/wine-4.0.4.tar.xz
|
||||
|
||||
Binary packages for various distributions will be available from:
|
||||
|
||||
|
@ -29,462 +22,247 @@ AUTHORS in the distribution for the complete list.
|
|||
|
||||
----------------------------------------------------------------
|
||||
|
||||
What's new in Wine 4.0
|
||||
======================
|
||||
|
||||
|
||||
*** Direct3D
|
||||
|
||||
- Initial support for Direct3D 12 is implemented. Direct3D 12 support
|
||||
requires the vkd3d library, and a Vulkan-capable graphics card.
|
||||
|
||||
- The Multi-Threaded Command Stream feature is enabled by default.
|
||||
|
||||
- OpenGL core contexts are always used by default when available. In
|
||||
the previous release, these were already used by default for
|
||||
Direct3D 10 and 11 applications on AMD and Intel graphics
|
||||
cards. That has been extended to all graphics cards, and all
|
||||
versions of Direct3D before 12.
|
||||
|
||||
- Among others, the following notable Direct3D 10 and 11 features are
|
||||
implemented:
|
||||
- Multi-sample textures and views, as well as multi-sample resolves.
|
||||
- Per-sample fragment shading.
|
||||
- Support for 1D textures.
|
||||
- Draws without render target views or depth/stencil views.
|
||||
- Multiple viewports and scissor rectangles per draw.
|
||||
- Depth clipping control.
|
||||
- Depth bias clamping.
|
||||
- Stream output without geometry shaders.
|
||||
- Several more capability queries.
|
||||
- Several more resource formats.
|
||||
|
||||
- The "depth bias clamping" feature mentioned above requires the
|
||||
ARB_polygon_offset_clamp/EXT_polygon_offset_clamp OpenGL
|
||||
extension. All Direct3D 10+ capable hardware should be able to
|
||||
support that extension, but it has come to our attention that some
|
||||
NVIDIA "Legacy Drivers" do not. We encourage affected users to
|
||||
explore whether the Free Software Nouveau drivers meet their needs.
|
||||
|
||||
- Several Direct3D 11 interfaces have been updated to version 11.2,
|
||||
and several DXGI interfaces have been update to version 1.6. This
|
||||
allows applications requiring those newer interfaces to start
|
||||
working.
|
||||
|
||||
- The first steps towards more fine-grained locking in the Direct3D
|
||||
implementation have been taken. This will be an ongoing effort to
|
||||
take better advantage of modern high core count CPUs.
|
||||
|
||||
- Support for using the correct swap interval is implemented, for both
|
||||
DXGI and DirectDraw applications.
|
||||
|
||||
- Application-configurable frame latency is implemented for Direct3D
|
||||
9Ex and DXGI applications.
|
||||
|
||||
- S3TC-compressed 3D textures are supported. S3TC-compressed 2D
|
||||
textures were already supported, provided the OpenGL drivers
|
||||
supported them.
|
||||
|
||||
- When the ARB_query_buffer_object OpenGL extension is available,
|
||||
query results can be polled with lower latency, resulting in a
|
||||
modest performance improvement in specific cases.
|
||||
|
||||
- Validation of Direct3D 8 and 9 resource pool and usage restrictions,
|
||||
as well as blit restrictions, has been improved.
|
||||
|
||||
- The Direct3D graphics card database recognizes more graphics cards.
|
||||
|
||||
- New HKEY_CURRENT_USER\Software\Wine\Direct3D registry keys:
|
||||
- "MultisampleTextures" (REG_DWORD)
|
||||
Enable (0x1, default) or disable (0x0) support for multi-sample
|
||||
textures.
|
||||
- "Renderer" (REG_SZ)
|
||||
The backend API to target. Possible values are "gl" (default) for
|
||||
OpenGL and "gdi" for GDI.
|
||||
|
||||
- Deprecated HKEY_CURRENT_USER\Software\Wine\Direct3D registry key:
|
||||
- "DirectDrawRenderer"
|
||||
This has been superseded by the "Renderer" setting above.
|
||||
|
||||
- Removed HKEY_CURRENT_USER\Software\Wine\Direct3D registry key:
|
||||
- "StrictDrawOrdering"
|
||||
This feature was previously deprecated in favor of the
|
||||
multi-threaded command stream feature, and has been completely
|
||||
removed.
|
||||
|
||||
|
||||
*** Graphics
|
||||
|
||||
- A complete Vulkan driver is implemented, using the host Vulkan
|
||||
libraries under X11, or MoltenVK on macOS.
|
||||
|
||||
- A builtin vulkan-1 loader is provided as an alternative to the SDK
|
||||
loader.
|
||||
|
||||
- Icons in PNG format are supported, enabling loading high-resolution
|
||||
256x256 icons.
|
||||
|
||||
- The standard icons include a 256x256 version to take advantage of
|
||||
the PNG support.
|
||||
|
||||
- Many Direct2D interfaces have been updated to version 1.2.
|
||||
|
||||
- New HKEY_CURRENT_USER\Software\Wine\Direct2D registry key:
|
||||
- "max_version_factory" (REG_DWORD)
|
||||
Limit the interface version of the ID2D1Factory interface to the
|
||||
specified version. 0x0 for ID2D1Factory, 0x1 for ID2D1Factory1,
|
||||
etc. By default there is no limit.
|
||||
|
||||
- Using an ARGB visual as default X11 visual is supported.
|
||||
|
||||
- The old 16-bit DIB.DRV driver is implemented using the DIB engine.
|
||||
|
||||
- Polygon drawing in the DIB engine is much faster for large polygons.
|
||||
|
||||
- A0, A1 and A2 paper sizes are supported for generic printers.
|
||||
|
||||
- Arrows are supported in GdiPlus.
|
||||
|
||||
|
||||
*** Kernel
|
||||
|
||||
- Support for running DOS binaries under Wine is removed. When
|
||||
execution of a DOS binary is requested, an external DOSBox instance
|
||||
is launched. This doesn't apply to Win16 binaries, which are still
|
||||
supported internally.
|
||||
|
||||
- All the CPU control and debug registers can be accessed by kernel
|
||||
drivers, including on 64-bit.
|
||||
|
||||
- Events, semaphores, mutexes and timers are implemented in kernel
|
||||
mode for device drivers.
|
||||
|
||||
- The WaitOnAddress synchronization primitives are supported.
|
||||
|
||||
- Reported processor information correctly distinguishes logical and
|
||||
physical CPU cores to support hyper-threading.
|
||||
|
||||
- Detailed BIOS information can be queried on Linux platforms.
|
||||
|
||||
- The various debugger APIs support manipulating a 32-bit Wow64
|
||||
process from a 64-bit process context.
|
||||
|
||||
- Application settings, compatibility information and execution levels
|
||||
are recognized in application manifests.
|
||||
|
||||
- The various file I/O completion modes are implemented.
|
||||
|
||||
- Debug registers are supported on NetBSD.
|
||||
|
||||
|
||||
*** User interface
|
||||
|
||||
- The infrastructure for setting DPI awareness and scaling of non
|
||||
DPI-aware applications is implemented. However, actual scaling of
|
||||
window contents is only supported on Android at this point.
|
||||
Scaling is disabled by default and can be enabled by setting the
|
||||
"DpiScalingVer" value under HKEY_CURRENT_USER\Control Panel\Desktop.
|
||||
|
||||
- Window class redirection is supported, enabling support of Common
|
||||
Controls version 6 features for standard USER controls like buttons.
|
||||
|
||||
- The standard USER controls Button, Listbox, Combobox, Edit and
|
||||
Static support version 6 features, including theming.
|
||||
|
||||
- The standard Task Dialog is implemented, including support for
|
||||
icons, hyperlinks, progress bars, and various other UI elements.
|
||||
|
||||
- Cue banners are supported in version 6 of the Edit control.
|
||||
|
||||
|
||||
*** Desktop integration
|
||||
|
||||
- Exporting MIME-type file associations to the native desktop can be
|
||||
disabled with a checkbox under the Desktop Integration tab in
|
||||
winecfg. It can be configured programmatically by setting the
|
||||
"Enable" value under
|
||||
HKEY_CURRENT_USER\Software\Wine\FileOpenAssociations.
|
||||
|
||||
- The File Dialog can display file properties like size, times and
|
||||
attributes.
|
||||
|
||||
- The File Dialog optionally shows the Places toolbar on the left-hand
|
||||
side.
|
||||
|
||||
- The shell folder Public is used instead of AllUsersProfile to follow
|
||||
the behavior of recent Windows versions.
|
||||
|
||||
- The shell File Browser supports keyboard shortcuts to rename (F2
|
||||
key) and delete (Delete key) shell folders.
|
||||
|
||||
- Many standard icons are added to the Shell library.
|
||||
|
||||
- Shell Autocompletion is supported.
|
||||
|
||||
- In desktop mode the taskbar won't be displayed on top of fullscreen
|
||||
windows.
|
||||
|
||||
- Additional names are provided for standard cursors to better match
|
||||
existing X11 cursor themes.
|
||||
|
||||
|
||||
*** Input devices
|
||||
|
||||
- HID game controllers are supported in the XInput and Raw Input APIs.
|
||||
|
||||
- An SDL driver is implemented to make SDL game controllers
|
||||
available through the HID interface.
|
||||
|
||||
|
||||
*** Internet and networking
|
||||
|
||||
- JScript has an EcmaScript compliant mode, which supports a number of
|
||||
features not available in legacy mode.
|
||||
|
||||
- JavaScript property accessors are supported.
|
||||
|
||||
- HTML style object is rewritten to support standard-compliant mode.
|
||||
|
||||
- HTML documents respect X-UA-Compatible HTTP header, allowing web
|
||||
pages to request specific compatibility mode. The
|
||||
HKEY_CURRENT_USER\Software\Wine\MSHTML\CompatMode key may be used to
|
||||
override the requested mode.
|
||||
|
||||
- MSHTML supports non-HTML elements, allowing limited SVG support.
|
||||
|
||||
- A number of new HTML APIs are supported.
|
||||
|
||||
- The proxy server can be configured through the Internet Control
|
||||
Panel applet.
|
||||
|
||||
- Stream I/O is implemented in WebServices.
|
||||
|
||||
- The Web Services on Devices API (WSDAPI) is implemented, including
|
||||
sending and receiving the various message types.
|
||||
|
||||
- More system information is reported through WBEM, including CPU,
|
||||
BIOS, video controller, and network adapter properties.
|
||||
|
||||
|
||||
*** Cryptography
|
||||
|
||||
- Asymmetric encryption keys, as well as RSA and ECDSA signature
|
||||
verification are supported.
|
||||
|
||||
- The GCM and ECB encryption chaining modes are supported.
|
||||
|
||||
- Optimal Asymmetric Encryption Padding (OAEP) is supported in RSA
|
||||
encryption.
|
||||
|
||||
- A Kerberos security provider is implemented, supporting Kerberos
|
||||
authentication.
|
||||
|
||||
- A selection dialog for public key certificates is implemented.
|
||||
|
||||
- If available, GnuTLS is used on macOS in preference to the
|
||||
CommonCrypto framework.
|
||||
|
||||
|
||||
*** Text and fonts
|
||||
|
||||
- Character tables are based on version 11.0.0 of the Unicode Standard.
|
||||
|
||||
- The new subpixel font rendering of FreeType >= 2.8.1 is supported.
|
||||
|
||||
- When a font face is missing, FontConfig is queried to provide
|
||||
possible substitutions.
|
||||
|
||||
- The font selected in the console emulator properly scales with the
|
||||
display DPI.
|
||||
|
||||
- Memory font resources are supported in DirectWrite.
|
||||
|
||||
- The builtin Wingdings font contains clock images.
|
||||
|
||||
|
||||
*** Audio
|
||||
|
||||
- The Windows Media Player interfaces are implemented and support
|
||||
media playback.
|
||||
|
||||
- An MP3 decoder is provided as DirectX Media Object.
|
||||
|
||||
|
||||
*** macOS
|
||||
|
||||
- The preloader is implemented on macOS, for better address space
|
||||
layout compatibility.
|
||||
|
||||
- The Command key can be mapped to Ctrl, by setting the
|
||||
"LeftCommandIsCtrl" or "RightCommandIsCtrl" values under
|
||||
HKEY_CURRENT_USER\Software\Wine\Mac Driver.
|
||||
|
||||
- The App Nap energy-saving feature is disabled by default in GUI
|
||||
processes. It can be re-enabled by setting the "EnableAppNap" value
|
||||
under HKEY_CURRENT_USER\Software\Wine\Mac Driver.
|
||||
|
||||
|
||||
*** Android
|
||||
|
||||
- Setting the mouse cursor is supported using the APIs available in
|
||||
Android >= 7.
|
||||
|
||||
- The new version of the Android graphics buffer allocator API is
|
||||
supported, to enable graphics support on Android >= 8.
|
||||
|
||||
- Android x86-64 platforms are supported also in 64-bit mode, however
|
||||
WoW64 mode is not supported yet in the WineHQ packages.
|
||||
|
||||
|
||||
*** ARM platforms
|
||||
|
||||
- Stubless COM proxies are implemented on ARM.
|
||||
|
||||
- The Windows calling convention for variadic functions is supported
|
||||
on ARM64.
|
||||
|
||||
- Exception handling and debugging is better supported on ARM64
|
||||
platforms.
|
||||
|
||||
- The MinGW toolchain is supported for cross-compilation to ARM64.
|
||||
|
||||
|
||||
*** Built-in applications
|
||||
|
||||
- The Ping program provides actual pinging functionality using
|
||||
IcmpSendEcho.
|
||||
|
||||
- The SchTasks task scheduler program can create and delete tasks.
|
||||
|
||||
- The RegEdit registry editor has an improved hex editor for binary
|
||||
values.
|
||||
|
||||
- FOR loops are properly handled in the Command Interpreter.
|
||||
|
||||
- The XCopy program supports the /k (keep attributes) option.
|
||||
|
||||
|
||||
*** Internationalization
|
||||
|
||||
- The Japanese 106 keyboard is properly supported.
|
||||
|
||||
- Translation of timezone names is supported.
|
||||
|
||||
- There is a partial translation to the Sinhala language.
|
||||
|
||||
- More locales are supported in the Resource Compiler (wrc) and
|
||||
Message Compiler (wmc).
|
||||
|
||||
|
||||
*** Development tools
|
||||
|
||||
- winedbg supports debugging WoW64 processes.
|
||||
|
||||
- In gdb proxy mode, winedbg supports a --port option to specify the
|
||||
port used to connect to gdb.
|
||||
|
||||
- winegcc uses better heuristics for finding the appropriate lib
|
||||
directory for 32/64-bit cross-compiles.
|
||||
|
||||
- winegcc supports building native subsystem libraries.
|
||||
|
||||
- winegcc also looks for includes in the top-level include directory
|
||||
of the installation prefix.
|
||||
|
||||
- winebuild supports a -mfpu option for specifying the FPU
|
||||
architecture on ARM platforms.
|
||||
|
||||
- winedump supports dumping SLTG-format typelibs.
|
||||
|
||||
|
||||
*** IDL compiler
|
||||
|
||||
- Application Configuration Files (ACF) are supported.
|
||||
|
||||
- Asynchronous interfaces are supported.
|
||||
|
||||
- Type and method serialization using encode/decode attributes is
|
||||
supported.
|
||||
|
||||
- The defaultvalue() attribute is supported for pointer types.
|
||||
|
||||
- Generated files are always specific to the target platform. The
|
||||
target can be specified the same way as with the other tools,
|
||||
using the cpu-manufacturer-os platform specification.
|
||||
|
||||
- Nesting of pointers and arrays works correctly.
|
||||
|
||||
- Correct size and alignment are generated for encapsulated unions.
|
||||
|
||||
- The __int32 type is supported.
|
||||
|
||||
- The -robust command line option is recognized (but ignored) for
|
||||
compatibility with the Microsoft IDL compiler.
|
||||
|
||||
- Multiple typelibs can be generated into a single resource file.
|
||||
|
||||
|
||||
*** .NET
|
||||
|
||||
- 32-bit CIL-only .NET binaries are supported on 64-bit.
|
||||
|
||||
- The Mono engine is updated to version 4.7.5 with some upstream Mono
|
||||
fixes.
|
||||
|
||||
|
||||
*** RPC/COM
|
||||
|
||||
- The typelib marshaller is reimplemented. It generates format strings
|
||||
and then uses the standard NDR marshalling routines; this way it
|
||||
also works on 64-bit and ARM platforms.
|
||||
|
||||
|
||||
*** Installers
|
||||
|
||||
- MSI custom actions run in a separate process, enabling proper
|
||||
support for mixed 32/64-bit installers.
|
||||
|
||||
- Deferred installation actions are supported in MSI.
|
||||
|
||||
|
||||
*** Build infrastructure
|
||||
|
||||
- The test framework supports building helper dlls inside a test, to
|
||||
allow testing features that require loading an external library.
|
||||
|
||||
- The test framework supports testing Windows kernel drivers.
|
||||
|
||||
- It is possible to build and run a WoW64 tree from inside the Wine
|
||||
source directory. Previously an out-of-tree build was required.
|
||||
|
||||
- A .editorconfig file is provided with the recommended indentation
|
||||
parameters.
|
||||
|
||||
|
||||
*** Miscellaneous
|
||||
|
||||
- The Task Scheduler service and APIs are implemented.
|
||||
|
||||
- The Windows Management Instrumentation service is implemented.
|
||||
|
||||
- The OPC Services (Open Packaging Conventions, used for Microsoft
|
||||
Office XML files) library is implemented.
|
||||
|
||||
- The HKEY_PERFORMANCE_DATA magic registry key is partially
|
||||
implemented.
|
||||
|
||||
|
||||
*** New external dependencies
|
||||
|
||||
- The Vulkan library is used to implement the Vulkan graphics driver.
|
||||
|
||||
- The Vkd3d library is used to implement Direct3D 12 on top of Vulkan.
|
||||
|
||||
- The SDL library is used to support game controllers.
|
||||
|
||||
- The GSSAPI library is used to implement Kerberos authentication.
|
||||
|
||||
Bugs fixed in 4.0.4 (total 65):
|
||||
|
||||
11998 NEXON client installers using embedded IE browser control: buttons don't respond to click (Lunia Senki, Combat Arms, War Rock)
|
||||
12406 Microsoft Document Explorer 2008 crashes when using MS Help 2 URL from command line (ieframe's WebBrowser COM object doesn't support aggregation)
|
||||
16808 Password Safe crashes with page fault when renaming entries
|
||||
20465 Brothers In Arms Hell's Highway : Setup asks for DVD for every .cab file (SetupPromptForDiskA/W should only show a dialog if the file doesn't exist)
|
||||
22030 LegoLand: crashes at main menu without native directmusic
|
||||
24529 TSDoctor 1.0.58 fails to run
|
||||
25264 treeview wstr overrun in TVN_GETDISPINFOW (ExamXML crashes when opening an XML file)
|
||||
25728 UFO: Extraterrestrials Gold - crash at start caused by wine's built-in dsound/directmusic
|
||||
30506 GdipGraphicsClear() needs to overwrite pixels, not alpha blend (Text misrendered in Brain Workshop)
|
||||
34041 Skyrim (Steam) hangup on quit
|
||||
34666 In The Adventures Of Lomax some graphic elements flicker, disappear or are garbled
|
||||
36388 Problems with Russian localization in page setup dialog
|
||||
38300 using winegcc with stdin passes arguments in the wrong position to gcc
|
||||
38817 FXCM Trading Station II installer reports 'OLE error 80004001' when running as 'Windows Vista' or higher ('ITaskbarList3::ThumbBarSetImageList' is a stub)
|
||||
39692 64-bit dlls/msdaps/row_server_p.c generates build warnings (discarded "const" qualifier)
|
||||
40364 Broken geometry in Indiana Jones and the Emperor's Tomb
|
||||
40740 Broken Sword: The Angel of Death demo needs IDirectSoundFXI3DL2Reverb interface
|
||||
40777 The Moment of Silence launcher unusable (displays only black)
|
||||
41639 Wine with freetype 2.7 causes font rendering issues
|
||||
41936 The Witcher 2: Assassins of Kings - menus and subtitles rendered incorrectly (with built-in d3dx9)
|
||||
42046 VSDC Video Editor. Crashes in ole32 when opening.
|
||||
43368 HashMyFiles: Drag & Drop from native File Managers (Dolphin, Nautilus, ...) does not work
|
||||
43817 Multiple .NET applications (Chime, DxO Photolab 2 trial) crash, need RegisterApplicationRecoveryCallback to return S_OK
|
||||
44408 Tetris for Windows has wrong colors for the game pieces and the score box
|
||||
45031 HotS - taking screenshot causes client crash, needs d3dx11_42.dll.D3DX11SaveTextureToFileW
|
||||
45732 Far Cry 5 Cannot Steer Land Vehicles
|
||||
46279 Multiple applications need msvcr120.dll.?_Yield@_Context@details@Concurrency@@SAXXZ (Darkest Dungeon, Noita, Amazon Kindle for PC)
|
||||
46404 Shed installer - text overflow in browse-for-folder dialog
|
||||
46417 Abiword 2.6.8 comboboxes should have a white background color
|
||||
46421 μTorrent has squares in its update dialog
|
||||
46560 Smoke not rendering properly in Castlevania: Lords of Shadow 2
|
||||
46578 IVMU Social Network Client (500 series) crashes when selecting menu / settings
|
||||
46972 Adobe DNG Converter 11.2+ runs into Call to unimplemented function api-ms-win-core-winrt-error-l1-1-0.dll.GetRestrictedErrorInfo
|
||||
46981 winetricks -q --verify dotnet461 crashes under win64
|
||||
46983 type command in cmd.exe with two files and stdout redirect, behavior is different
|
||||
47049 boolean type defined as 'unsigned char' rather than 'char'
|
||||
47075 32-bit LAVFilters 0.74.x installer fails to register 64-bit AX codec/filters in Wow64 environment (32-bit regsvr32.exe needs to support 64-bit dll registration and vice versa by re-exec with proper bitness)
|
||||
47101 Multiple 64-bit game and application crash reporting tools need x86_64 'ntdll.RtlCaptureStackBackTrace' implementation
|
||||
47427 Glide wrapper - Configuration buttons misbehaving
|
||||
47433 Accel World vs. Sword Art Online needs WTSRegisterSessionNotificationEx() to return true.
|
||||
47459 ListBox LB_SETSEL doesn't scroll to newly selected item
|
||||
47615 _putws outputs NULs, other wchar.h functions don't
|
||||
47693 ExHIBIT (Sample Project): Can't select menu item in the title screen
|
||||
47709 Zoom Edit&Share 5.0.0.0: installer crashes starting with wine-3.19
|
||||
47752 commit "winex11.drv: Wake up the display on user input." introduced severe performance issues with atomic modesetting kernel drivers
|
||||
47779 iCloud refuses to install: "Your computer is missing Media features."
|
||||
47790 putty.exe displays an error at startup when placed in a path with accented characters.
|
||||
47820 Magic: The Gathering Arena installer needs powershell.exe (cannot find it)
|
||||
47832 FindFirstFileExW believes every directory entry has been read if NtQueryDirectoryFile underfills buffer
|
||||
47833 FindFirstFileExW seems to be missing FILE_OPEN_FOR_BACKUP_INTENT flag to NtOpenFile
|
||||
47880 Need for Speed: Carbon - Autosculpt causes geometry corruption and GL_INVALID_OPERATION error
|
||||
47918 Blur: cars have no wheels when Wine is compiled with Ryzen optimisations
|
||||
47935 Nextiva: Logging in fails with "Client is unable to connect to the server."
|
||||
47956 IGMP source specific multicast does not create join requests for source
|
||||
47979 NtCreateFile incorrectly returns STATUS_OBJECT_NAME_NOT_FOUND when RootDirectory is populated
|
||||
47986 R-Studio (file recovery tool) wants ntoskrnl.exe.IoCreateUnprotectedSymbolicLink
|
||||
47991 motec i2 pro v1.0 data logger fails to start
|
||||
48016 Multiple applications need shcore.dll.GetScaleFactorForMonitor stub (Karafun player, Sync)
|
||||
48077 UPlay fails to start : "Error at hooking API NtProtectVirtualMemory" (UPlay's hooking engine can't handle ENDBR32 instruction inserted at non-hotpatch API entries due to distro build environments '-fcf-protection')
|
||||
48082 Visual C++ Express 2005 needs shell32.PathResolveW implementation (or fake success)
|
||||
48088 Wrong color mapping with client-side graphics on 256-color X server
|
||||
48242 IXMLDOMDocument_load() paths aren't URL-unescaped (Microsoft Document Explorer 2008 startup error)
|
||||
48314 Building wine on CentOS7 fails due to lack of libkrb5
|
||||
48358 Dell Latitude E6440 BIOS updater crashes on unimplemented function ntoskrnl.exe.KeSetImportanceDpc
|
||||
48549 Arma Cold War Assault: Cursor stuck at low fps since Wine 5.0-rc6
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
Changes since 4.0.3:
|
||||
|
||||
Akihiro Sagawa (5):
|
||||
comctl32/tests: Add tests to show no NM_RELEASEDCAPTURE notifications in the updown control.
|
||||
comctl32/updown: Suppress the NM_RELEASEDCAPTURE notification.
|
||||
msvcrt/tests: Add more tests for _mbsspn and _mbsspnp.
|
||||
msvcrt: Fix _mbsspn implementation.
|
||||
msvcrt: Reimplement _mbsspnp using _mbsspn.
|
||||
|
||||
Alex Henrie (2):
|
||||
ntoskrnl: Implement IoCreateUnprotectedSymbolicLink.
|
||||
ntoskrnl: Add KeSetImportanceDpc stub.
|
||||
|
||||
Alexandre Julliard (7):
|
||||
ntdll: Always add path separator when looking for a relative path name.
|
||||
winex11: Use the default color table for window surfaces on 8bpp displays.
|
||||
configure: Disable gssapi also when linking with kerberos doesn't work.
|
||||
msi: Use %define api.pure instead of %pure-parser.
|
||||
msxml3: Use %define api.pure instead of %pure-parser.
|
||||
vbscript: Use %define api.pure instead of %pure-parser.
|
||||
wbemprox: Use %define api.pure instead of %pure-parser.
|
||||
|
||||
Alistair Leslie-Hughes (6):
|
||||
dsound: Primary buffer doesn't support flag DSBCAPS_CTRLFX.
|
||||
kernel32: FindFirstFileExW needs to open the directory with FILE_OPEN_FOR_BACKUP_INTENT flag.
|
||||
dmloader: Stop after find first matching object.
|
||||
dmstyle: Add GUID_IDirectMusicStyle support in Style Track GetParam.
|
||||
dmime: IDirectMusicSegment8 SetLoopPoints support zero start/end.
|
||||
dinput: Cap the buffer size to 20.
|
||||
|
||||
Andrew Eikum (1):
|
||||
winex11.drv: Throttle calls to XResetScreenSaver.
|
||||
|
||||
Andrew Sheldon (1):
|
||||
wined3d: Add Navi 10 PCI id and device description.
|
||||
|
||||
Bernhard belacker (1):
|
||||
cmd.exe: Command type with multiple files should print filenames to stderr.
|
||||
|
||||
Byeong-Sik Jeon (2):
|
||||
gdi32: Add a helper macro for FreeType version check.
|
||||
gdi32: Add a workaround for Freetype < 2.8.1 using v40 FT_LOAD_TARGET_MONO.
|
||||
|
||||
Charles Davis (2):
|
||||
ntdll: Implement RtlCaptureStackBackTrace() for x86_64.
|
||||
winemac.drv: Pass the CAMetalLayer to MoltenVK.
|
||||
|
||||
Damjan Jovanovic (12):
|
||||
comctl32: Test the treeview edit control EM_LIMITTEXT.
|
||||
comctl32: Implement treeview edit control EM_SETLIMITTEXT.
|
||||
comctl32: Test treeview text trimming after label editing is complete.
|
||||
comctl32: Test text buffer passed to TVN_ENDLABELEDIT is always MAX_PATH chars long.
|
||||
comctl32: Test overwriting of pszText contents in TVN_ENDLABELEDIT.
|
||||
comctl32: Test overwriting of pszText pointer in TVN_ENDLABELEDIT.
|
||||
comctl32: Implement treeview edit control text trimming and overwriting.
|
||||
comctl32: Allocate the right wstr size for the TVN_GETDISPINFOW reply.
|
||||
ieframe: Implement COM aggregation in WebBrowser.
|
||||
msxml3: All string passed to IXMLDOMDocument_load() need to be URL-unescaped.
|
||||
gdiplus: GdipGraphicsClear() should overwrite pixels, not alpha blend.
|
||||
winex11.drv: Ignore .dwAspect in FORMATETC during XDnD.
|
||||
|
||||
Dmitry Timoshkov (2):
|
||||
gdiplus/tests: Add some tests for GdipInitializePalette.
|
||||
mshtml: Add support for DIID_HTMLDocumentEvents2 connection point sink.
|
||||
|
||||
Ethan Lee (1):
|
||||
wined3d: Add Intel HD 615 PCI id and device description.
|
||||
|
||||
Fabian Maurer (7):
|
||||
comctl32/syslink: Properly handle '\r'.
|
||||
shell32: Prevent text truncation inside the old "browse folder" dialog.
|
||||
ws2_32: Handle more IGMP socket options.
|
||||
comctl32/tests: Add combo tests for WM_CTLCOLOR*.
|
||||
comctl32/combo: Properly handle WM_CTLCOLOR* messages.
|
||||
user32/tests: Add combo tests for WM_CTLCOLOR*.
|
||||
user32/combo: Properly handle WM_CTLCOLOR* messages.
|
||||
|
||||
Felix Hädicke (1):
|
||||
msvcrt: Use memmove() instead of memcpy() puts_clbk_str().
|
||||
|
||||
Gijs Vermeulen (2):
|
||||
msvcrt: Add Concurrency::details::_Context::_Yield stub.
|
||||
shell32: Implement PathResolve.
|
||||
|
||||
Isira Seneviratne (1):
|
||||
jscript: Replace '%pure-parser' with '%define api.pure'.
|
||||
|
||||
Jacek Caban (2):
|
||||
kernel32: Terminate process in unhandled exception handler.
|
||||
include: Add roerrorapi.h header.
|
||||
|
||||
Jeff Smith (3):
|
||||
kernelbase: Fix PathAllocCanonicalize handling segments that contain dots.
|
||||
kernel32: Quote first command line arg in process paramenters.
|
||||
user.exe16: Releasing DC does not disable it.
|
||||
|
||||
Joseph Kogut (1):
|
||||
iphlpapi: Report success in NotifyIpInterfaceChange.
|
||||
|
||||
Ken Thomases (1):
|
||||
winemac: Only manipulate an NSOpenGLContext's view on the main thread.
|
||||
|
||||
Kevin Puetz (1):
|
||||
winegcc: Correctly pass the '-' file name (stdin) to the compiler.
|
||||
|
||||
Liam Middlebrook (1):
|
||||
d3dx11: Add D3DX11SaveTextureToFileA/W() stub.
|
||||
|
||||
Louis Lenders (5):
|
||||
wine.inf: Add value for DigitalProductId.
|
||||
kernel32: Return S_OK in RegisterApplicationRecoveryCallback stub.
|
||||
wine.inf: Install powershell.exe in WindowsPowerShell/v1.0/.
|
||||
include: Add restrictederrorinfo.idl.
|
||||
combase: Add GetRestrictedErrorInfo and RoOriginateLanguageException stubs.
|
||||
|
||||
Matteo Bruni (1):
|
||||
d3dx9: Handle non-zero source rect position in D3DXLoadSurfaceFromMemory().
|
||||
|
||||
Michael Müller (3):
|
||||
wine.inf: Create the WindowsMediaVersion key and set its default value.
|
||||
ole32: Fix property name handling for dictionary entries in CP_UNICODE case.
|
||||
setupapi: Add support for IDF_CHECKFIRST flag in SetupPromptForDiskW.
|
||||
|
||||
Myah Caron (1):
|
||||
kernel32: Allow NtQueryDirectoryFile underfilling FileInformation.
|
||||
|
||||
Nikolay Sivov (4):
|
||||
po: Fix Russian strings for page setup dialog.
|
||||
comctl32/rebar: Fix invalid band index access.
|
||||
explorerframe: Return success from ThumbBarSetImageList().
|
||||
user32/listbox: Update caret index on LB_SETSEL.
|
||||
|
||||
Patrick Hibbs (1):
|
||||
wtsapi32: Make WTSRegisterSessionNotificationEx's return consistent with WTSRegisterSessionNotification.
|
||||
|
||||
Paul Gofman (7):
|
||||
wined3d: Allow loading buffers mapped through system memory.
|
||||
ddraw: Enable lighting only if material is set in d3d_execute_buffer_execute().
|
||||
ddraw: Fix vertex buffer offset in d3d_execute_buffer_execute().
|
||||
d3d8: Fix stream data skip count in convert_to_wined3d_declaration().
|
||||
user32: Fix coords in WINDOWPOS for WM_NCCALCSIZE sent from SetWindowPos().
|
||||
ntdll: Add DECLSPEC_HOTPATCH to NtProtectVirtualMemory().
|
||||
d3dx9: Pass D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY when appropriate.
|
||||
|
||||
Piotr Caban (4):
|
||||
wbemdisp: Handle NULL signatures in init_members.
|
||||
msvcrt: Fix _putws implementation.
|
||||
msi: Fix component Action for shared components in CostFinalize.
|
||||
ntdll: Work around futimens weak linking problem in set_file_times.
|
||||
|
||||
Richard Pospesel (1):
|
||||
widl: Use FC_CHAR rather than FC_BYTE for boolean typedef to match midl.exe output.
|
||||
|
||||
Rémi Bernon (3):
|
||||
widl: Cast freed pointers to void* to fix discarded-array-qualifiers warning.
|
||||
dinput: Increase device buffer size to 1024.
|
||||
opencl: Define CL_TARGET_OPENCL_VERSION 220 to fix a header warning.
|
||||
|
||||
Vijay Kiran Kamuju (1):
|
||||
shcore: Add stub for GetScaleFactorForMonitor.
|
||||
|
||||
Vincent Povirk (1):
|
||||
regsvr32: Re-exec as 32-bit or 64-bit if necessary.
|
||||
|
||||
Zebediah Figura (2):
|
||||
winex11: Track the client colormap separately.
|
||||
qedit/mediadet: Check for failure from IEnumPins::Next().
|
||||
|
||||
Zhiyi Zhang (1):
|
||||
kernelbase/tests: Add more PathAllocCanonicalize tests.
|
||||
|
||||
--
|
||||
Alexandre Julliard
|
||||
julliard@winehq.org
|
||||
Michael Stefaniuc
|
||||
mstefani@winehq.org
|
||||
|
|
20
AUTHORS
20
AUTHORS
|
@ -183,6 +183,7 @@ Bernd Fuhrmann
|
|||
Bernd Herd
|
||||
Bernd Paysan
|
||||
Bernd Schmidt
|
||||
Bernhard belacker
|
||||
Bernhard Loos
|
||||
Bernhard Reiter
|
||||
Bernhard Rosenkraenzer
|
||||
|
@ -222,6 +223,7 @@ Bruno Afonso
|
|||
Bruno Jesus
|
||||
Bryan DeGrendel
|
||||
Bryan Mayland
|
||||
Bryon Roche
|
||||
Byeong-Sik Jeon
|
||||
Caibin Chen
|
||||
Cameron Heide
|
||||
|
@ -426,6 +428,7 @@ Elias Benali
|
|||
Elias Ross
|
||||
Elie Morisse
|
||||
Emmanuel Maillard
|
||||
Enol Puente
|
||||
Enrico Horn
|
||||
Erez Volk
|
||||
Eric Anholt
|
||||
|
@ -448,6 +451,7 @@ Erik Svendsen
|
|||
Erwin Wolff
|
||||
Eryk Wieliczko
|
||||
Ethan Chen
|
||||
Ethan Lee
|
||||
Eugene Mayevski
|
||||
Eugeny Gorelov
|
||||
Evan Deaubl
|
||||
|
@ -464,6 +468,7 @@ Fabrice Ménard
|
|||
Farshad Agah
|
||||
Fatih Aşıcı
|
||||
Federico Schwindt
|
||||
Felix Hädicke
|
||||
Felix Janda
|
||||
Felix Nawothnig
|
||||
Ferenc Wagner
|
||||
|
@ -773,6 +778,7 @@ John Reiser
|
|||
John Richardson
|
||||
John R. Sheets
|
||||
John Sheu
|
||||
John Thomson
|
||||
John Voltz
|
||||
John Zero
|
||||
Jonas Maebe
|
||||
|
@ -798,6 +804,7 @@ Jose Alonso
|
|||
Josef Meixner
|
||||
José Manuel Ferrer Ortiz
|
||||
Jose Marcos López Caravaca
|
||||
Joseph Kogut
|
||||
Joseph Pranevich
|
||||
Jose Rostagno
|
||||
Josh DuBois
|
||||
|
@ -870,6 +877,7 @@ Kevin Groeneveld
|
|||
Kevin Holbrook
|
||||
Kevin Koltzau
|
||||
Kevin Krammer
|
||||
Kevin Puetz
|
||||
Kieran Clancy
|
||||
Kieran Duggan
|
||||
Kim Geonwoo (김건우)
|
||||
|
@ -901,6 +909,7 @@ Krishna Murthy
|
|||
Kris Marsh
|
||||
Kristiaan Lenaerts
|
||||
Kristian Nielsen
|
||||
Kristján Gerhardsson
|
||||
Kristofer Henriksson
|
||||
Kristoffer Gleditsch
|
||||
Krzysztof Foltman
|
||||
|
@ -929,6 +938,7 @@ Leonardo Quijano Vincenzi
|
|||
Leonid Lobachev
|
||||
Leo van den Berg
|
||||
Leslie Choong
|
||||
Liam Middlebrook
|
||||
Li Keqing
|
||||
Lilia Roumiantseva
|
||||
Linus Torvalds
|
||||
|
@ -1003,6 +1013,7 @@ Martin Dalecki
|
|||
Martin Fuchs
|
||||
Martin Garton
|
||||
Martin Jesper Low Madsen
|
||||
Martin Liska
|
||||
Martin Payne
|
||||
Martin Petricek
|
||||
Martin Pilka
|
||||
|
@ -1120,6 +1131,7 @@ Moshe Vainer
|
|||
Mounir Idrassi
|
||||
Muneyuki Noguchi
|
||||
Murali Pattathe
|
||||
Myah Caron
|
||||
Mykola Zadorozhnyy
|
||||
Natanael Copa
|
||||
Nathan Beckmann
|
||||
|
@ -1144,6 +1156,7 @@ Niels de Carpentier
|
|||
Niels Kristian Bech Jensen
|
||||
Nigel Liang
|
||||
Nikita V. Youshchenko
|
||||
Nikola Pavlica
|
||||
Nikolas Zimmermann
|
||||
Nikolay Bogoychev
|
||||
Nikolay Sivov
|
||||
|
@ -1188,6 +1201,7 @@ Patrick Ammann
|
|||
Patrick Armstrong
|
||||
Patrick Gauthier
|
||||
Patrick Haller
|
||||
Patrick Hibbs
|
||||
Patrick J. McNerthney
|
||||
Patrick Moran
|
||||
Patrick Rudolph
|
||||
|
@ -1305,6 +1319,7 @@ Reece H. Dunn
|
|||
Reinhard Karcher
|
||||
Rein Klazes
|
||||
Rémi Assailly
|
||||
Rémi Bernon
|
||||
Renu Rajput
|
||||
Rex Tsai
|
||||
Rhys McGuckin
|
||||
|
@ -1317,6 +1332,7 @@ Richard A Lough
|
|||
Richard Bradbrook
|
||||
Richard Cohen
|
||||
Richard Mortimer
|
||||
Richard Pospesel
|
||||
Richard Stonehouse
|
||||
Rich Ercolani
|
||||
Rick Mutzke
|
||||
|
@ -1479,6 +1495,7 @@ Sunil Mohan Adapa
|
|||
Supphachoke Suntiwichaya
|
||||
Susan Farley
|
||||
Svante Signell
|
||||
Sveinar Søpler
|
||||
Sven Baars
|
||||
Sven Hesse
|
||||
Sven Paschukat
|
||||
|
@ -1499,6 +1516,7 @@ Thomas Crider
|
|||
Thomas Faber
|
||||
Thomas Faller
|
||||
Thomas Fitzsimmons
|
||||
Thomas J. Moore
|
||||
Thomas Kho
|
||||
Thomas Mertes
|
||||
Thomas Mullaly
|
||||
|
@ -1518,6 +1536,7 @@ Tim Hentenaar
|
|||
Tim Newsome
|
||||
Timo Kreuzer
|
||||
Timo Teräs
|
||||
Tim Schumacher
|
||||
Tim Schwartz
|
||||
Tim Segall
|
||||
Tim Wanders
|
||||
|
@ -1587,6 +1606,7 @@ Vitaly Budovski
|
|||
Vitaly Lipatov
|
||||
Vitaly Perov
|
||||
Vit Hrachovy
|
||||
Vlad Bespalov
|
||||
Vladdy Impaler
|
||||
Vladimir Bespalov
|
||||
Vladimir Pankratov
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for Wine 4.0.
|
||||
# Generated by GNU Autoconf 2.69 for Wine 4.0.4.
|
||||
#
|
||||
# Report bugs to <wine-devel@winehq.org>.
|
||||
#
|
||||
|
@ -580,8 +580,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='Wine'
|
||||
PACKAGE_TARNAME='wine'
|
||||
PACKAGE_VERSION='4.0'
|
||||
PACKAGE_STRING='Wine 4.0'
|
||||
PACKAGE_VERSION='4.0.4'
|
||||
PACKAGE_STRING='Wine 4.0.4'
|
||||
PACKAGE_BUGREPORT='wine-devel@winehq.org'
|
||||
PACKAGE_URL='https://www.winehq.org'
|
||||
|
||||
|
@ -2390,7 +2390,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 4.0 to adapt to many kinds of systems.
|
||||
\`configure' configures Wine 4.0.4 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
@ -2460,7 +2460,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of Wine 4.0:";;
|
||||
short | recursive ) echo "Configuration of Wine 4.0.4:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
@ -2692,7 +2692,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
Wine configure 4.0
|
||||
Wine configure 4.0.4
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
@ -3376,7 +3376,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 4.0, which was
|
||||
It was created by Wine $as_me 4.0.4, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
@ -14464,8 +14464,6 @@ CPPFLAGS=$ac_save_CPPFLAGS
|
|||
test -z "$KRB5_CFLAGS" || KRB5_CFLAGS=`echo " $KRB5_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
|
||||
test -z "$KRB5_LIBS" || KRB5_LIBS=`echo " $KRB5_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
|
||||
|
||||
else
|
||||
with_gssapi=${with_gssapi:-no}
|
||||
fi
|
||||
if test "x$ac_cv_lib_soname_krb5" = "x"; then :
|
||||
case "x$with_krb5" in
|
||||
|
@ -14476,6 +14474,7 @@ This is an error since --with-krb5 was requested." "$LINENO" 5 ;;
|
|||
esac
|
||||
|
||||
fi
|
||||
test "x$ac_cv_lib_soname_krb5" != "x" || with_gssapi=${with_gssapi:-no}
|
||||
|
||||
if test "x$with_gssapi" != "xno"
|
||||
then
|
||||
|
@ -18605,6 +18604,8 @@ for ac_func in \
|
|||
exp2f \
|
||||
expm1 \
|
||||
expm1f \
|
||||
ilogb \
|
||||
ilogbf \
|
||||
j0 \
|
||||
j1 \
|
||||
jn \
|
||||
|
@ -18624,6 +18625,8 @@ for ac_func in \
|
|||
lroundf \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
nexttowardf \
|
||||
powl \
|
||||
remainder \
|
||||
remainderf \
|
||||
|
@ -20870,7 +20873,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 4.0, which was
|
||||
This file was extended by Wine $as_me 4.0.4, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
@ -20941,7 +20944,7 @@ _ACEOF
|
|||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
Wine config.status 4.0
|
||||
Wine config.status 4.0.4
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
|
|
@ -1702,11 +1702,10 @@ then
|
|||
else
|
||||
KRB5_CFLAGS=""
|
||||
fi])
|
||||
else
|
||||
with_gssapi=${with_gssapi:-no}
|
||||
fi
|
||||
WINE_NOTICE_WITH(krb5,[test "x$ac_cv_lib_soname_krb5" = "x"],
|
||||
[libkrb5 ${notice_platform}development files not found (or too old), Kerberos won't be supported.])
|
||||
test "x$ac_cv_lib_soname_krb5" != "x" || with_gssapi=${with_gssapi:-no}
|
||||
|
||||
dnl **** Check for gssapi ****
|
||||
if test "x$with_gssapi" != "xno"
|
||||
|
@ -2743,6 +2742,8 @@ AC_CHECK_FUNCS(\
|
|||
exp2f \
|
||||
expm1 \
|
||||
expm1f \
|
||||
ilogb \
|
||||
ilogbf \
|
||||
j0 \
|
||||
j1 \
|
||||
jn \
|
||||
|
@ -2762,6 +2763,8 @@ AC_CHECK_FUNCS(\
|
|||
lroundf \
|
||||
nearbyint \
|
||||
nearbyintf \
|
||||
nexttoward \
|
||||
nexttowardf \
|
||||
powl \
|
||||
remainder \
|
||||
remainderf \
|
||||
|
|
|
@ -603,7 +603,7 @@ BOOL WINAPI ReadEventLogA( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOf
|
|||
FIXME("(%p,0x%08x,0x%08x,%p,0x%08x,%p,%p) stub\n", hEventLog, dwReadFlags,
|
||||
dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
|
||||
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
SetLastError(ERROR_HANDLE_EOF);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -618,7 +618,7 @@ BOOL WINAPI ReadEventLogW( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOf
|
|||
FIXME("(%p,0x%08x,0x%08x,%p,0x%08x,%p,%p) stub\n", hEventLog, dwReadFlags,
|
||||
dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
|
||||
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
SetLastError(ERROR_HANDLE_EOF);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -508,7 +508,7 @@ NTSTATUS WINAPI LsaLookupSids(
|
|||
{
|
||||
(*Names)[i].Use = SidTypeUnknown;
|
||||
(*Names)[i].DomainIndex = -1;
|
||||
(*Names)[i].Name.Buffer = NULL;
|
||||
RtlInitUnicodeStringEx(&(*Names)[i].Name, NULL);
|
||||
|
||||
memset(&(*ReferencedDomains)->Domains[i], 0, sizeof(LSA_TRUST_INFORMATION));
|
||||
|
||||
|
|
|
@ -2097,7 +2097,7 @@ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue,
|
|||
DWORD dwFlags, LPDWORD pdwType, PVOID pvData,
|
||||
LPDWORD pcbData )
|
||||
{
|
||||
DWORD dwType, cbData = pcbData ? *pcbData : 0;
|
||||
DWORD dwType, cbData = (pvData && pcbData) ? *pcbData : 0;
|
||||
PVOID pvBuf = NULL;
|
||||
LONG ret;
|
||||
|
||||
|
@ -2193,7 +2193,7 @@ LSTATUS WINAPI RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue,
|
|||
DWORD dwFlags, LPDWORD pdwType, PVOID pvData,
|
||||
LPDWORD pcbData )
|
||||
{
|
||||
DWORD dwType, cbData = pcbData ? *pcbData : 0;
|
||||
DWORD dwType, cbData = (pvData && pcbData) ? *pcbData : 0;
|
||||
PVOID pvBuf = NULL;
|
||||
LONG ret;
|
||||
|
||||
|
|
|
@ -5964,6 +5964,64 @@ BOOL WINAPI FileEncryptionStatusA(LPCSTR lpFileName, LPDWORD lpStatus)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static NTSTATUS combine_dacls(ACL *parent, ACL *child, ACL **result)
|
||||
{
|
||||
NTSTATUS status;
|
||||
ACL *combined;
|
||||
int i;
|
||||
|
||||
/* initialize a combined DACL containing both inherited and new ACEs */
|
||||
combined = heap_alloc_zero(child->AclSize+parent->AclSize);
|
||||
if (!combined)
|
||||
return STATUS_NO_MEMORY;
|
||||
|
||||
status = RtlCreateAcl(combined, parent->AclSize+child->AclSize, ACL_REVISION);
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
heap_free(combined);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* copy the new ACEs */
|
||||
for (i=0; i<child->AceCount; i++)
|
||||
{
|
||||
ACE_HEADER *ace;
|
||||
|
||||
if (!GetAce(child, i, (void*)&ace))
|
||||
continue;
|
||||
if (!AddAce(combined, ACL_REVISION, MAXDWORD, ace, ace->AceSize))
|
||||
WARN("error adding new ACE\n");
|
||||
}
|
||||
|
||||
/* copy the inherited ACEs */
|
||||
for (i=0; i<parent->AceCount; i++)
|
||||
{
|
||||
ACE_HEADER *ace;
|
||||
|
||||
if (!GetAce(parent, i, (void*)&ace))
|
||||
continue;
|
||||
if (!(ace->AceFlags & (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)))
|
||||
continue;
|
||||
if ((ace->AceFlags & (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)) !=
|
||||
(OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE))
|
||||
{
|
||||
FIXME("unsupported flags: %x\n", ace->AceFlags);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ace->AceFlags & NO_PROPAGATE_INHERIT_ACE)
|
||||
ace->AceFlags &= ~(OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE|NO_PROPAGATE_INHERIT_ACE);
|
||||
ace->AceFlags &= ~INHERIT_ONLY_ACE;
|
||||
ace->AceFlags |= INHERITED_ACE;
|
||||
|
||||
if (!AddAce(combined, ACL_REVISION, MAXDWORD, ace, ace->AceSize))
|
||||
WARN("error adding inherited ACE\n");
|
||||
}
|
||||
|
||||
*result = combined;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* SetSecurityInfo [ADVAPI32.@]
|
||||
*/
|
||||
|
@ -6063,41 +6121,10 @@ DWORD WINAPI SetSecurityInfo(HANDLE handle, SE_OBJECT_TYPE ObjectType,
|
|||
|
||||
if (!err)
|
||||
{
|
||||
int i;
|
||||
|
||||
dacl = heap_alloc_zero(pDacl->AclSize+parent_dacl->AclSize);
|
||||
if (!dacl)
|
||||
{
|
||||
LocalFree(parent_sd);
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
memcpy(dacl, pDacl, pDacl->AclSize);
|
||||
dacl->AclSize = pDacl->AclSize+parent_dacl->AclSize;
|
||||
|
||||
for (i=0; i<parent_dacl->AceCount; i++)
|
||||
{
|
||||
ACE_HEADER *ace;
|
||||
|
||||
if (!GetAce(parent_dacl, i, (void*)&ace))
|
||||
continue;
|
||||
if (!(ace->AceFlags & (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)))
|
||||
continue;
|
||||
if ((ace->AceFlags & (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)) !=
|
||||
(OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE))
|
||||
{
|
||||
FIXME("unsupported flags: %x\n", ace->AceFlags);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ace->AceFlags & NO_PROPAGATE_INHERIT_ACE)
|
||||
ace->AceFlags &= ~(OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE|NO_PROPAGATE_INHERIT_ACE);
|
||||
ace->AceFlags &= ~INHERIT_ONLY_ACE;
|
||||
ace->AceFlags |= INHERITED_ACE;
|
||||
|
||||
if(!AddAce(dacl, ACL_REVISION, MAXDWORD, ace, ace->AceSize))
|
||||
WARN("error adding inherited ACE\n");
|
||||
}
|
||||
status = combine_dacls(parent_dacl, pDacl, &dacl);
|
||||
LocalFree(parent_sd);
|
||||
if (status != STATUS_SUCCESS)
|
||||
return RtlNtStatusToDosError(status);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
@ stub EnumResourceTypesExA
|
||||
@ stub EnumResourceTypesExW
|
||||
@ stdcall FindResourceExW(long wstr wstr long) kernel32.FindResourceExW
|
||||
@ stdcall FindResourceW(long wstr wstr) kernel32.FindResourceW
|
||||
@ stdcall FindStringOrdinal(long wstr long wstr long long) kernel32.FindStringOrdinal
|
||||
@ stdcall FreeLibrary(long) kernel32.FreeLibrary
|
||||
@ stdcall FreeLibraryAndExitThread(long long) kernel32.FreeLibraryAndExitThread
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) ntdll.RtlCopyMemory
|
||||
@ cdecl -arch=arm,arm64,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable
|
||||
@ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory
|
||||
@ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr wstr) ntdll.RtlInstallFunctionTableCallback
|
||||
@ cdecl -arch=arm,arm64,x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr wstr) ntdll.RtlInstallFunctionTableCallback
|
||||
@ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry
|
||||
@ stdcall RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
|
||||
@ stdcall -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@ stub GetRestrictedErrorInfo
|
||||
@ stdcall GetRestrictedErrorInfo(ptr) combase.GetRestrictedErrorInfo
|
||||
@ stub RoCaptureErrorContext
|
||||
@ stub RoFailFastWithErrorContext
|
||||
@ stub RoGetErrorReportingFlags
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@ stub GetRestrictedErrorInfo
|
||||
@ stdcall GetRestrictedErrorInfo(ptr) combase.GetRestrictedErrorInfo
|
||||
@ stub IsErrorPropagationEnabled
|
||||
@ stub RoCaptureErrorContext
|
||||
@ stub RoClearError
|
||||
|
@ -9,7 +9,7 @@
|
|||
@ stub RoInspectThreadErrorInfo
|
||||
@ stub RoOriginateError
|
||||
@ stub RoOriginateErrorW
|
||||
@ stub RoOriginateLanguageException
|
||||
@ stdcall RoOriginateLanguageException(long ptr ptr) combase.RoOriginateLanguageException
|
||||
@ stub RoReportFailedDelegate
|
||||
@ stub RoReportUnhandledError
|
||||
@ stub RoResolveRestrictedErrorInfoReference
|
||||
|
|
|
@ -119,4 +119,4 @@
|
|||
@ cdecl wctob(long) ucrtbase.wctob
|
||||
@ cdecl wctomb(ptr long) ucrtbase.wctomb
|
||||
@ cdecl wctomb_s(ptr ptr long long) ucrtbase.wctomb_s
|
||||
@ stub wctrans
|
||||
@ cdecl wctrans(str) ucrtbase.wctrans
|
||||
|
|
|
@ -254,9 +254,9 @@
|
|||
@ cdecl -arch=arm,x86_64,arm64 fmodf(float float) ucrtbase.fmodf
|
||||
@ cdecl frexp(double ptr) ucrtbase.frexp
|
||||
@ cdecl hypot(double double) ucrtbase.hypot
|
||||
@ stub ilogb
|
||||
@ stub ilogbf
|
||||
@ stub ilogbl
|
||||
@ cdecl ilogb(double) ucrtbase.ilogb
|
||||
@ cdecl ilogbf(float) ucrtbase.ilogbf
|
||||
@ cdecl ilogbl(double) ucrtbase.ilogbl
|
||||
@ cdecl ldexp(double long) ucrtbase.ldexp
|
||||
@ cdecl lgamma(double) ucrtbase.lgamma
|
||||
@ cdecl lgammaf(float) ucrtbase.lgammaf
|
||||
|
@ -297,9 +297,9 @@
|
|||
@ cdecl nextafter(double double) ucrtbase.nextafter
|
||||
@ cdecl nextafterf(float float) ucrtbase.nextafterf
|
||||
@ cdecl nextafterl(double double) ucrtbase.nextafterl
|
||||
@ stub nexttoward
|
||||
@ stub nexttowardf
|
||||
@ stub nexttowardl
|
||||
@ cdecl nexttoward(double double) ucrtbase.nexttoward
|
||||
@ cdecl nexttowardf(float double) ucrtbase.nexttowardf
|
||||
@ cdecl nexttowardl(double double) ucrtbase.nexttowardl
|
||||
@ stub norm
|
||||
@ stub normf
|
||||
@ stub norml
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
@ stub __BuildCatchObject
|
||||
@ stub __BuildCatchObjectHelper
|
||||
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ucrtbase.__C_specific_handler
|
||||
@ stub __C_specific_handler_noexcept
|
||||
@ cdecl -arch=i386,x86_64,arm,arm64 __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow
|
||||
@ cdecl -arch=i386,x86_64,arm,arm64 __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter
|
||||
@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler
|
||||
|
@ -44,6 +45,7 @@
|
|||
@ stub __report_gsfailure
|
||||
@ cdecl __std_exception_copy(ptr ptr) ucrtbase.__std_exception_copy
|
||||
@ cdecl __std_exception_destroy(ptr) ucrtbase.__std_exception_destroy
|
||||
@ stub __std_terminate
|
||||
@ cdecl __std_type_info_compare(ptr ptr) ucrtbase.__std_type_info_compare
|
||||
@ cdecl __std_type_info_destroy_list(ptr) ucrtbase.__std_type_info_destroy_list
|
||||
@ cdecl __std_type_info_hash(ptr) ucrtbase.__std_type_info_hash
|
||||
|
@ -51,6 +53,7 @@
|
|||
@ cdecl __unDName(ptr str long ptr ptr long) ucrtbase.__unDName
|
||||
@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) ucrtbase.__unDNameEx
|
||||
@ cdecl __uncaught_exception() ucrtbase.__uncaught_exception
|
||||
@ stub __uncaught_exceptions
|
||||
@ cdecl -arch=i386 -norelay _chkesp() ucrtbase._chkesp
|
||||
@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) ucrtbase._except_handler2
|
||||
@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) ucrtbase._except_handler3
|
||||
|
@ -87,6 +90,10 @@
|
|||
@ stub _o__W_Getmonths
|
||||
@ stub _o__W_Gettnames
|
||||
@ stub _o__Wcsftime
|
||||
@ stub _o____lc_codepage_func
|
||||
@ stub _o____lc_collate_cp_func
|
||||
@ stub _o____lc_locale_name_func
|
||||
@ stub _o____mb_cur_max_func
|
||||
@ stub _o___acrt_iob_func
|
||||
@ stub _o___conio_common_vcprintf
|
||||
@ stub _o___conio_common_vcprintf_p
|
||||
|
@ -120,11 +127,11 @@
|
|||
@ stub _o___libm_sse2_sinf
|
||||
@ stub _o___libm_sse2_tan
|
||||
@ stub _o___libm_sse2_tanf
|
||||
@ stub _o___p___argc
|
||||
@ cdecl _o___p___argc() ucrtbase._o___p___argc
|
||||
@ stub _o___p___argv
|
||||
@ stub _o___p___wargv
|
||||
@ cdecl _o___p___wargv() ucrtbase._o___p___wargv
|
||||
@ stub _o___p__acmdln
|
||||
@ stub _o___p__commode
|
||||
@ cdecl _o___p__commode() ucrtbase._o___p__commode
|
||||
@ stub _o___p__environ
|
||||
@ stub _o___p__fmode
|
||||
@ stub _o___p__mbcasemap
|
||||
|
@ -135,6 +142,10 @@
|
|||
@ stub _o___p__wpgmptr
|
||||
@ stub _o___pctype_func
|
||||
@ stub _o___pwctype_func
|
||||
@ stub _o___std_exception_copy
|
||||
@ stub _o___std_exception_destroy
|
||||
@ cdecl _o___std_type_info_destroy_list(ptr) ucrtbase._o___std_type_info_destroy_list
|
||||
@ stub _o___std_type_info_name
|
||||
@ stub _o___stdio_common_vfprintf
|
||||
@ stub _o___stdio_common_vfprintf_p
|
||||
@ stub _o___stdio_common_vfprintf_s
|
||||
|
@ -184,6 +195,7 @@
|
|||
@ stub _o__cabs
|
||||
@ stub _o__callnewh
|
||||
@ stub _o__calloc_base
|
||||
@ stub _o__cexit
|
||||
@ stub _o__cgets
|
||||
@ stub _o__cgets_s
|
||||
@ stub _o__cgetws
|
||||
|
@ -195,11 +207,15 @@
|
|||
@ stub _o__chsize_s
|
||||
@ stub _o__close
|
||||
@ stub _o__commit
|
||||
@ stub _o__configure_wide_argv
|
||||
@ cdecl _o__configthreadlocale(long) ucrtbase._o__configthreadlocale
|
||||
@ stub _o__configure_narrow_argv
|
||||
@ cdecl _o__configure_wide_argv(long) ucrtbase._o__configure_wide_argv
|
||||
@ cdecl _o__controlfp_s(ptr long long) ucrtbase._o__controlfp_s
|
||||
@ stub _o__cputs
|
||||
@ stub _o__cputws
|
||||
@ stub _o__creat
|
||||
@ stub _o__create_locale
|
||||
@ cdecl _o__crt_atexit(ptr) ucrtbase._o__crt_atexit
|
||||
@ stub _o__ctime32_s
|
||||
@ stub _o__ctime64_s
|
||||
@ stub _o__cwait
|
||||
|
@ -231,6 +247,7 @@
|
|||
@ stub _o__execve
|
||||
@ stub _o__execvp
|
||||
@ stub _o__execvpe
|
||||
@ stub _o__exit
|
||||
@ stub _o__expand
|
||||
@ stub _o__fclose_nolock
|
||||
@ stub _o__fcloseall
|
||||
|
@ -301,6 +318,8 @@
|
|||
@ stub _o__get_errno
|
||||
@ stub _o__get_fmode
|
||||
@ stub _o__get_heap_handle
|
||||
@ stub _o__get_initial_narrow_environment
|
||||
@ cdecl _o__get_initial_wide_environment() ucrtbase._o__get_initial_wide_environment
|
||||
@ stub _o__get_invalid_parameter_handler
|
||||
@ stub _o__get_narrow_winmain_command_line
|
||||
@ stub _o__get_osfhandle
|
||||
|
@ -345,7 +364,9 @@
|
|||
@ stub _o__i64toa_s
|
||||
@ stub _o__i64tow
|
||||
@ stub _o__i64tow_s
|
||||
@ stub _o__initialize_narrow_environment
|
||||
@ cdecl _o__initialize_onexit_table(ptr) ucrtbase._o__initialize_onexit_table
|
||||
@ cdecl _o__initialize_wide_environment() ucrtbase._o__initialize_wide_environment
|
||||
@ stub _o__invalid_parameter_noinfo
|
||||
@ stub _o__invalid_parameter_noinfo_noreturn
|
||||
@ stub _o__isatty
|
||||
|
@ -617,6 +638,7 @@
|
|||
@ stub _o__pclose
|
||||
@ stub _o__pipe
|
||||
@ stub _o__popen
|
||||
@ stub _o__purecall
|
||||
@ stub _o__putc_nolock
|
||||
@ stub _o__putch
|
||||
@ stub _o__putch_nolock
|
||||
|
@ -638,12 +660,16 @@
|
|||
@ stub _o__scalbf
|
||||
@ stub _o__searchenv
|
||||
@ stub _o__searchenv_s
|
||||
@ cdecl _o__seh_filter_dll(long ptr) ucrtbase._o__seh_filter_dll
|
||||
@ cdecl _o__seh_filter_exe(long ptr) ucrtbase._o__seh_filter_exe
|
||||
@ stub _o__set_abort_behavior
|
||||
@ cdecl _o__set_app_type(long) ucrtbase._o__set_app_type
|
||||
@ stub _o__set_doserrno
|
||||
@ stub _o__set_errno
|
||||
@ cdecl _o__set_fmode(long) ucrtbase._o__set_fmode
|
||||
@ stub _o__set_invalid_parameter_handler
|
||||
@ stub _o__set_new_handler
|
||||
@ stub _o__set_new_mode
|
||||
@ cdecl _o__set_new_mode(long) ucrtbase._o__set_new_mode
|
||||
@ stub _o__set_thread_local_invalid_parameter_handler
|
||||
@ stub _o__seterrormode
|
||||
@ stub _o__setmbcp
|
||||
|
@ -893,7 +919,7 @@
|
|||
@ stub _o_bsearch
|
||||
@ stub _o_bsearch_s
|
||||
@ stub _o_btowc
|
||||
@ stub _o_calloc
|
||||
@ cdecl _o_calloc(long long) ucrtbase._o_calloc
|
||||
@ stub _o_cbrt
|
||||
@ stub _o_cbrtf
|
||||
@ stub _o_ceil
|
||||
|
@ -910,6 +936,7 @@
|
|||
@ stub _o_erfcl
|
||||
@ stub _o_erff
|
||||
@ stub _o_erfl
|
||||
@ cdecl _o_exit(long) ucrtbase._o_exit
|
||||
@ stub _o_exp
|
||||
@ stub _o_exp2
|
||||
@ stub _o_exp2f
|
||||
|
@ -940,7 +967,7 @@
|
|||
@ stub _o_fputws
|
||||
@ stub _o_fread
|
||||
@ stub _o_fread_s
|
||||
@ stub _o_free
|
||||
@ cdecl _o_free(ptr) ucrtbase._o_free
|
||||
@ stub _o_freopen
|
||||
@ stub _o_freopen_s
|
||||
@ stub _o_frexp
|
||||
|
@ -1026,7 +1053,7 @@
|
|||
@ stub _o_mbstowcs
|
||||
@ stub _o_mbstowcs_s
|
||||
@ stub _o_mbtowc
|
||||
@ stub _o_memset
|
||||
@ stub _o_memcpy_s
|
||||
@ stub _o_modf
|
||||
@ stub _o_modff
|
||||
@ stub _o_nan
|
||||
|
@ -1061,6 +1088,7 @@
|
|||
@ stub _o_remquo
|
||||
@ stub _o_remquof
|
||||
@ stub _o_remquol
|
||||
@ stub _o_rename
|
||||
@ stub _o_rewind
|
||||
@ stub _o_rint
|
||||
@ stub _o_rintf
|
||||
|
@ -1076,6 +1104,7 @@
|
|||
@ stub _o_scalbnl
|
||||
@ stub _o_set_terminate
|
||||
@ stub _o_setbuf
|
||||
@ stub _o_setlocale
|
||||
@ stub _o_setvbuf
|
||||
@ stub _o_sin
|
||||
@ stub _o_sinf
|
||||
|
@ -1113,7 +1142,7 @@
|
|||
@ stub _o_tmpfile_s
|
||||
@ stub _o_tmpnam_s
|
||||
@ stub _o_tolower
|
||||
@ stub _o_toupper
|
||||
@ cdecl _o_toupper(long) ucrtbase._o_toupper
|
||||
@ stub _o_towlower
|
||||
@ stub _o_towupper
|
||||
@ stub _o_ungetc
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
@ cdecl _wcsnicoll(wstr wstr long) ucrtbase._wcsnicoll
|
||||
@ cdecl _wcsnicoll_l(wstr wstr long ptr) ucrtbase._wcsnicoll_l
|
||||
@ cdecl _wcsnset(wstr long long) ucrtbase._wcsnset
|
||||
@ stub _wcsnset_s
|
||||
@ cdecl _wcsnset_s(wstr long long long) ucrtbase._wcsnset_s
|
||||
@ cdecl _wcsrev(wstr) ucrtbase._wcsrev
|
||||
@ cdecl _wcsset(wstr long) ucrtbase._wcsset
|
||||
@ cdecl _wcsset_s(wstr long long) ucrtbase._wcsset_s
|
||||
|
@ -151,7 +151,7 @@
|
|||
@ cdecl strxfrm(ptr str long) ucrtbase.strxfrm
|
||||
@ cdecl tolower(long) ucrtbase.tolower
|
||||
@ cdecl toupper(long) ucrtbase.toupper
|
||||
@ stub towctrans
|
||||
@ cdecl towctrans(long long) ucrtbase.towctrans
|
||||
@ cdecl towlower(long) ucrtbase.towlower
|
||||
@ cdecl towupper(long) ucrtbase.towupper
|
||||
@ cdecl wcscat(wstr wstr) ucrtbase.wcscat
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@ stdcall GetDpiForMonitor(long long ptr ptr) shcore.GetDpiForMonitor
|
||||
@ stdcall GetProcessDpiAwareness(long ptr) shcore.GetProcessDpiAwareness
|
||||
@ stub GetScaleFactorForDevice
|
||||
@ stub GetScaleFactorForMonitor
|
||||
@ stdcall GetScaleFactorForMonitor(long ptr) shcore.GetScaleFactorForMonitor
|
||||
@ stub RegisterScaleChangeEvent
|
||||
@ stub RegisterScaleChangeNotifications
|
||||
@ stub RevokeScaleChangeNotifications
|
||||
|
|
|
@ -59,6 +59,15 @@ BOOL WINAPI AuthzInitializeResourceManager(DWORD flags, PFN_AUTHZ_DYNAMIC_ACCESS
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AuthzFreeResourceManager (AUTHZ.@)
|
||||
*/
|
||||
BOOL WINAPI AuthzFreeResourceManager(AUTHZ_RESOURCE_MANAGER_HANDLE handle)
|
||||
{
|
||||
FIXME("%p\n", handle);
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AuthzInstallSecurityEventSource (AUTHZ.@)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@ stub AuthzFreeAuditEvent
|
||||
@ stdcall AuthzFreeContext(long)
|
||||
@ stub AuthzFreeHandle
|
||||
@ stub AuthzFreeResourceManager
|
||||
@ stdcall AuthzFreeResourceManager(ptr)
|
||||
@ stub AuthzGetInformationFromContext
|
||||
@ stub AuthzInitializeContextFromAuthzContext
|
||||
@ stdcall AuthzInitializeContextFromSid(long ptr long ptr int64 ptr ptr)
|
||||
|
|
|
@ -405,8 +405,6 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
|
|||
lpbi->biSize + lpbi->biClrUsed * sizeof(RGBQUAD));
|
||||
if (lpbi->biBitCount <= 8)
|
||||
ICDecompressGetPalette(This->hic, This->lpInFormat, This->lpOutFormat);
|
||||
|
||||
return AVIERR_OK;
|
||||
} else {
|
||||
if (bBestDisplay) {
|
||||
ICGetDisplayFormat(This->hic, This->lpInFormat,
|
||||
|
@ -416,64 +414,64 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
|
|||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
}
|
||||
|
||||
/* check output format */
|
||||
if (This->lpOutFormat->biClrUsed == 0 &&
|
||||
This->lpOutFormat->biBitCount <= 8)
|
||||
This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount;
|
||||
if (This->lpOutFormat->biSizeImage == 0 &&
|
||||
This->lpOutFormat->biCompression == BI_RGB) {
|
||||
This->lpOutFormat->biSizeImage =
|
||||
DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight;
|
||||
}
|
||||
|
||||
if (lpBits == NULL) {
|
||||
DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
|
||||
|
||||
size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
|
||||
This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
|
||||
if (This->lpOutFormat == NULL) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
This->lpOutBuffer = DIBPTR(This->lpOutFormat);
|
||||
} else
|
||||
This->lpOutBuffer = lpBits;
|
||||
|
||||
/* for user size was irrelevant */
|
||||
if (dx == -1)
|
||||
dx = This->lpOutFormat->biWidth;
|
||||
if (dy == -1)
|
||||
dy = This->lpOutFormat->biHeight;
|
||||
|
||||
/* need to resize? */
|
||||
if (x != 0 || y != 0) {
|
||||
if (dy == This->lpOutFormat->biHeight &&
|
||||
dx == This->lpOutFormat->biWidth)
|
||||
This->bResize = FALSE;
|
||||
else
|
||||
This->bResize = TRUE;
|
||||
}
|
||||
|
||||
if (This->bResize) {
|
||||
This->x = x;
|
||||
This->y = y;
|
||||
This->dx = dx;
|
||||
This->dy = dy;
|
||||
|
||||
if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0,
|
||||
0,This->lpInFormat->biWidth,
|
||||
This->lpInFormat->biHeight,This->lpOutFormat,
|
||||
This->lpOutBuffer, x, y, dx, dy) == ICERR_OK)
|
||||
return AVIERR_OK;
|
||||
} else if (ICDecompressBegin(This->hic, This->lpInFormat,
|
||||
This->lpOutFormat) == ICERR_OK)
|
||||
return AVIERR_OK;
|
||||
|
||||
AVIFILE_CloseCompressor(This);
|
||||
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
|
||||
/* check output format */
|
||||
if (This->lpOutFormat->biClrUsed == 0 &&
|
||||
This->lpOutFormat->biBitCount <= 8)
|
||||
This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount;
|
||||
if (This->lpOutFormat->biSizeImage == 0 &&
|
||||
This->lpOutFormat->biCompression == BI_RGB) {
|
||||
This->lpOutFormat->biSizeImage =
|
||||
DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight;
|
||||
}
|
||||
|
||||
if (lpBits == NULL) {
|
||||
DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
|
||||
|
||||
size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
|
||||
This->lpOutFormat = HeapReAlloc(GetProcessHeap(), 0, This->lpOutFormat, size);
|
||||
if (This->lpOutFormat == NULL) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
This->lpOutBuffer = DIBPTR(This->lpOutFormat);
|
||||
} else
|
||||
This->lpOutBuffer = lpBits;
|
||||
|
||||
/* for user size was irrelevant */
|
||||
if (dx == -1)
|
||||
dx = This->lpOutFormat->biWidth;
|
||||
if (dy == -1)
|
||||
dy = This->lpOutFormat->biHeight;
|
||||
|
||||
/* need to resize? */
|
||||
if (x != 0 || y != 0) {
|
||||
if (dy == This->lpOutFormat->biHeight &&
|
||||
dx == This->lpOutFormat->biWidth)
|
||||
This->bResize = FALSE;
|
||||
else
|
||||
This->bResize = TRUE;
|
||||
}
|
||||
|
||||
if (This->bResize) {
|
||||
This->x = x;
|
||||
This->y = y;
|
||||
This->dx = dx;
|
||||
This->dy = dy;
|
||||
|
||||
if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0,
|
||||
0,This->lpInFormat->biWidth,
|
||||
This->lpInFormat->biHeight,This->lpOutFormat,
|
||||
This->lpOutBuffer, x, y, dx, dy) == ICERR_OK)
|
||||
return AVIERR_OK;
|
||||
} else if (ICDecompressBegin(This->hic, This->lpInFormat,
|
||||
This->lpOutFormat) == ICERR_OK)
|
||||
return AVIERR_OK;
|
||||
|
||||
AVIFILE_CloseCompressor(This);
|
||||
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
|
||||
static const struct IGetFrameVtbl igetframeVtbl = {
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
@ stub BCryptEnumProviders
|
||||
@ stub BCryptEnumRegisteredProviders
|
||||
@ stdcall BCryptExportKey(ptr ptr wstr ptr long ptr long)
|
||||
@ stub BCryptFinalizeKeyPair
|
||||
@ stdcall BCryptFinalizeKeyPair(ptr long)
|
||||
@ stdcall BCryptFinishHash(ptr ptr long long)
|
||||
@ stub BCryptFreeBuffer
|
||||
@ stdcall BCryptGenRandom(ptr ptr long long)
|
||||
@ stub BCryptGenerateKeyPair
|
||||
@ stdcall BCryptGenerateKeyPair(ptr ptr long long)
|
||||
@ stdcall BCryptGenerateSymmetricKey(ptr ptr ptr long ptr long long)
|
||||
@ stdcall BCryptGetFipsAlgorithmMode(ptr)
|
||||
@ stdcall BCryptGetProperty(ptr wstr ptr long ptr long)
|
||||
|
|
|
@ -125,6 +125,7 @@ enum alg_id
|
|||
ALG_ID_SHA256,
|
||||
ALG_ID_SHA384,
|
||||
ALG_ID_SHA512,
|
||||
ALG_ID_ECDH_P256,
|
||||
ALG_ID_ECDSA_P256,
|
||||
ALG_ID_ECDSA_P384,
|
||||
};
|
||||
|
@ -156,8 +157,9 @@ struct key_symmetric
|
|||
|
||||
struct key_asymmetric
|
||||
{
|
||||
UCHAR *pubkey;
|
||||
ULONG pubkey_len;
|
||||
gnutls_privkey_t handle;
|
||||
UCHAR *pubkey;
|
||||
ULONG pubkey_len;
|
||||
};
|
||||
|
||||
struct key
|
||||
|
@ -224,6 +226,7 @@ NTSTATUS key_symmetric_encrypt( struct key *, const UCHAR *, ULONG, UCHAR *, ULO
|
|||
NTSTATUS key_symmetric_decrypt( struct key *, const UCHAR *, ULONG, UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_symmetric_get_tag( struct key *, UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_asymmetric_init( struct key *, struct algorithm *, const UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_asymmetric_generate( struct key * ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_asymmetric_verify( struct key *, void *, UCHAR *, ULONG, UCHAR *, ULONG, DWORD ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_destroy( struct key * ) DECLSPEC_HIDDEN;
|
||||
BOOL key_is_symmetric( struct key * ) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -114,6 +114,7 @@ alg_props[] =
|
|||
/* ALG_ID_SHA256 */ { 286, 32, 512, BCRYPT_SHA256_ALGORITHM, FALSE },
|
||||
/* ALG_ID_SHA384 */ { 382, 48, 1024, BCRYPT_SHA384_ALGORITHM, FALSE },
|
||||
/* ALG_ID_SHA512 */ { 382, 64, 1024, BCRYPT_SHA512_ALGORITHM, FALSE },
|
||||
/* ALG_ID_ECDH_P256 */ { 0, 0, 0, BCRYPT_ECDH_P256_ALGORITHM, FALSE },
|
||||
/* ALG_ID_ECDSA_P256 */ { 0, 0, 0, BCRYPT_ECDSA_P256_ALGORITHM, FALSE },
|
||||
/* ALG_ID_ECDSA_P384 */ { 0, 0, 0, BCRYPT_ECDSA_P384_ALGORITHM, FALSE },
|
||||
};
|
||||
|
@ -184,6 +185,7 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR
|
|||
else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256;
|
||||
else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384;
|
||||
else if (!strcmpW( id, BCRYPT_SHA512_ALGORITHM )) alg_id = ALG_ID_SHA512;
|
||||
else if (!strcmpW( id, BCRYPT_ECDH_P256_ALGORITHM )) alg_id = ALG_ID_ECDH_P256;
|
||||
else if (!strcmpW( id, BCRYPT_ECDSA_P256_ALGORITHM )) alg_id = ALG_ID_ECDSA_P256;
|
||||
else if (!strcmpW( id, BCRYPT_ECDSA_P384_ALGORITHM )) alg_id = ALG_ID_ECDSA_P384;
|
||||
else
|
||||
|
@ -499,24 +501,24 @@ static NTSTATUS set_alg_property( struct algorithm *alg, const WCHAR *prop, UCHA
|
|||
case ALG_ID_AES:
|
||||
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
|
||||
{
|
||||
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
|
||||
if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB ))
|
||||
{
|
||||
alg->mode = MODE_ID_ECB;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
|
||||
else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC ))
|
||||
{
|
||||
alg->mode = MODE_ID_CBC;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
|
||||
else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM ))
|
||||
{
|
||||
alg->mode = MODE_ID_GCM;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
|
||||
FIXME( "unsupported mode %s\n", debugstr_w((WCHAR *)value) );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
@ -1028,7 +1030,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
|
|||
if (ecc_blob->dwMagic != magic) return STATUS_NOT_SUPPORTED;
|
||||
if (ecc_blob->cbKey != key_size) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (!(key = heap_alloc( sizeof(*key) ))) return STATUS_NO_MEMORY;
|
||||
if (!(key = heap_alloc_zero( sizeof(*key) ))) return STATUS_NO_MEMORY;
|
||||
key->hdr.magic = MAGIC_KEY;
|
||||
if ((status = key_asymmetric_init( key, alg, (BYTE *)ecc_blob, sizeof(*ecc_blob) + ecc_blob->cbKey * 2 )))
|
||||
{
|
||||
|
@ -1047,7 +1049,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
|
|||
if (input_len < sizeof(*rsa_blob)) return STATUS_INVALID_PARAMETER;
|
||||
if (alg->id != ALG_ID_RSA || rsa_blob->Magic != BCRYPT_RSAPUBLIC_MAGIC) return STATUS_NOT_SUPPORTED;
|
||||
|
||||
if (!(key = heap_alloc( sizeof(*key) ))) return STATUS_NO_MEMORY;
|
||||
if (!(key = heap_alloc_zero( sizeof(*key) ))) return STATUS_NO_MEMORY;
|
||||
key->hdr.magic = MAGIC_KEY;
|
||||
|
||||
size = sizeof(*rsa_blob) + rsa_blob->cbPublicExp + rsa_blob->cbModulus;
|
||||
|
@ -1089,6 +1091,18 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
|
|||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHAR *pubkey, ULONG pubkey_len )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS key_asymmetric_generate( struct key *key )
|
||||
{
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *hash, ULONG hash_len, UCHAR *signature,
|
||||
ULONG signature_len, DWORD flags )
|
||||
{
|
||||
|
@ -1163,6 +1177,41 @@ NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI BCryptGenerateKeyPair( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE *handle, ULONG key_len,
|
||||
ULONG flags )
|
||||
{
|
||||
struct algorithm *alg = algorithm;
|
||||
struct key *key;
|
||||
NTSTATUS status;
|
||||
|
||||
TRACE( "%p, %p, %u, %08x\n", algorithm, handle, key_len, flags );
|
||||
|
||||
if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE;
|
||||
if (!handle) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (!(key = heap_alloc_zero( sizeof(*key) ))) return STATUS_NO_MEMORY;
|
||||
key->hdr.magic = MAGIC_KEY;
|
||||
|
||||
if ((status = key_asymmetric_init( key, alg, NULL, 0 )))
|
||||
{
|
||||
heap_free( key );
|
||||
return status;
|
||||
}
|
||||
|
||||
*handle = key;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI BCryptFinalizeKeyPair( BCRYPT_KEY_HANDLE handle, ULONG flags )
|
||||
{
|
||||
struct key *key = handle;
|
||||
|
||||
TRACE( "%p, %08x\n", key, flags );
|
||||
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
|
||||
return key_asymmetric_generate( key );
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI BCryptImportKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE decrypt_key, LPCWSTR type,
|
||||
BCRYPT_KEY_HANDLE *key, PUCHAR object, ULONG object_len, PUCHAR input,
|
||||
ULONG input_len, ULONG flags )
|
||||
|
@ -1192,7 +1241,7 @@ NTSTATUS WINAPI BCryptExportKey( BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE
|
|||
TRACE("%p, %p, %s, %p, %u, %p, %u\n", key, encrypt_key, debugstr_w(type), output, output_len, size, flags);
|
||||
|
||||
if (!key || key->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
if (!output || !type || !size) return STATUS_INVALID_PARAMETER;
|
||||
if (!type || !size) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (encrypt_key)
|
||||
{
|
||||
|
|
|
@ -52,6 +52,8 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
|||
#define GNUTLS_CIPHER_AES_256_GCM 94
|
||||
#define GNUTLS_PK_ECC 4
|
||||
|
||||
#define GNUTLS_CURVE_TO_BITS(curve) (unsigned int)(((unsigned int)1<<31)|((unsigned int)(curve)))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GNUTLS_ECC_CURVE_INVALID,
|
||||
|
@ -65,15 +67,20 @@ typedef enum
|
|||
/* Not present in gnutls version < 3.0 */
|
||||
static int (*pgnutls_cipher_tag)(gnutls_cipher_hd_t, void *, size_t);
|
||||
static int (*pgnutls_cipher_add_auth)(gnutls_cipher_hd_t, const void *, size_t);
|
||||
static gnutls_sign_algorithm_t (*pgnutls_pk_to_sign)(gnutls_pk_algorithm_t, gnutls_digest_algorithm_t);
|
||||
static int (*pgnutls_pubkey_import_ecc_raw)(gnutls_pubkey_t, gnutls_ecc_curve_t,
|
||||
const gnutls_datum_t *, const gnutls_datum_t *);
|
||||
static gnutls_sign_algorithm_t (*pgnutls_pk_to_sign)(gnutls_pk_algorithm_t, gnutls_digest_algorithm_t);
|
||||
static int (*pgnutls_pubkey_verify_hash2)(gnutls_pubkey_t, gnutls_sign_algorithm_t, unsigned int,
|
||||
const gnutls_datum_t *, const gnutls_datum_t *);
|
||||
|
||||
/* Not present in gnutls version < 2.11.0 */
|
||||
static int (*pgnutls_pubkey_import_rsa_raw)(gnutls_pubkey_t key, const gnutls_datum_t *m, const gnutls_datum_t *e);
|
||||
|
||||
/* Not present in gnutls version < 3.3.0 */
|
||||
static int (*pgnutls_privkey_export_ecc_raw)(gnutls_privkey_t, gnutls_ecc_curve_t *,
|
||||
gnutls_datum_t *, gnutls_datum_t *, gnutls_datum_t *);
|
||||
static int (*pgnutls_privkey_generate)(gnutls_privkey_t, gnutls_pk_algorithm_t, unsigned int, unsigned int);
|
||||
|
||||
static void *libgnutls_handle;
|
||||
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
|
||||
MAKE_FUNCPTR(gnutls_cipher_decrypt2);
|
||||
|
@ -85,8 +92,10 @@ MAKE_FUNCPTR(gnutls_global_init);
|
|||
MAKE_FUNCPTR(gnutls_global_set_log_function);
|
||||
MAKE_FUNCPTR(gnutls_global_set_log_level);
|
||||
MAKE_FUNCPTR(gnutls_perror);
|
||||
MAKE_FUNCPTR(gnutls_pubkey_init);
|
||||
MAKE_FUNCPTR(gnutls_privkey_deinit);
|
||||
MAKE_FUNCPTR(gnutls_privkey_init);
|
||||
MAKE_FUNCPTR(gnutls_pubkey_deinit);
|
||||
MAKE_FUNCPTR(gnutls_pubkey_init);
|
||||
#undef MAKE_FUNCPTR
|
||||
|
||||
static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void *tag, size_t tag_size)
|
||||
|
@ -102,7 +111,13 @@ static int compat_gnutls_cipher_add_auth(gnutls_cipher_hd_t handle, const void *
|
|||
static int compat_gnutls_pubkey_import_ecc_raw(gnutls_pubkey_t key, gnutls_ecc_curve_t curve,
|
||||
const gnutls_datum_t *x, const gnutls_datum_t *y)
|
||||
{
|
||||
return GNUTLS_E_UNKNOWN_CIPHER_TYPE;
|
||||
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
|
||||
}
|
||||
|
||||
static int compat_gnutls_privkey_export_ecc_raw(gnutls_privkey_t key, gnutls_ecc_curve_t *curve,
|
||||
gnutls_datum_t *x, gnutls_datum_t *y, gnutls_datum_t *k)
|
||||
{
|
||||
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
|
||||
}
|
||||
|
||||
static gnutls_sign_algorithm_t compat_gnutls_pk_to_sign(gnutls_pk_algorithm_t pk, gnutls_digest_algorithm_t hash)
|
||||
|
@ -114,12 +129,18 @@ static int compat_gnutls_pubkey_verify_hash2(gnutls_pubkey_t key, gnutls_sign_al
|
|||
unsigned int flags, const gnutls_datum_t *hash,
|
||||
const gnutls_datum_t *signature)
|
||||
{
|
||||
return GNUTLS_E_UNKNOWN_CIPHER_TYPE;
|
||||
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
|
||||
}
|
||||
|
||||
static int compat_gnutls_pubkey_import_rsa_raw(gnutls_pubkey_t key, const gnutls_datum_t *m, const gnutls_datum_t *e)
|
||||
{
|
||||
return GNUTLS_E_UNKNOWN_CIPHER_TYPE;
|
||||
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
|
||||
}
|
||||
|
||||
static int compat_gnutls_privkey_generate(gnutls_privkey_t key, gnutls_pk_algorithm_t algo, unsigned int bits,
|
||||
unsigned int flags)
|
||||
{
|
||||
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
|
||||
}
|
||||
|
||||
static void gnutls_log( int level, const char *msg )
|
||||
|
@ -153,8 +174,10 @@ BOOL gnutls_initialize(void)
|
|||
LOAD_FUNCPTR(gnutls_global_set_log_function)
|
||||
LOAD_FUNCPTR(gnutls_global_set_log_level)
|
||||
LOAD_FUNCPTR(gnutls_perror)
|
||||
LOAD_FUNCPTR(gnutls_pubkey_init);
|
||||
LOAD_FUNCPTR(gnutls_privkey_deinit);
|
||||
LOAD_FUNCPTR(gnutls_privkey_init);
|
||||
LOAD_FUNCPTR(gnutls_pubkey_deinit);
|
||||
LOAD_FUNCPTR(gnutls_pubkey_init);
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
if (!(pgnutls_cipher_tag = wine_dlsym( libgnutls_handle, "gnutls_cipher_tag", NULL, 0 )))
|
||||
|
@ -178,6 +201,11 @@ BOOL gnutls_initialize(void)
|
|||
WARN("gnutls_pubkey_import_ecc_raw not found\n");
|
||||
pgnutls_pubkey_import_ecc_raw = compat_gnutls_pubkey_import_ecc_raw;
|
||||
}
|
||||
if (!(pgnutls_privkey_export_ecc_raw = wine_dlsym( libgnutls_handle, "gnutls_privkey_export_ecc_raw", NULL, 0 )))
|
||||
{
|
||||
WARN("gnutls_privkey_export_ecc_raw not found\n");
|
||||
pgnutls_privkey_export_ecc_raw = compat_gnutls_privkey_export_ecc_raw;
|
||||
}
|
||||
if (!(pgnutls_pk_to_sign = wine_dlsym( libgnutls_handle, "gnutls_pk_to_sign", NULL, 0 )))
|
||||
{
|
||||
WARN("gnutls_pk_to_sign not found\n");
|
||||
|
@ -193,6 +221,11 @@ BOOL gnutls_initialize(void)
|
|||
WARN("gnutls_pubkey_import_rsa_raw not found\n");
|
||||
pgnutls_pubkey_import_rsa_raw = compat_gnutls_pubkey_import_rsa_raw;
|
||||
}
|
||||
if (!(pgnutls_privkey_generate = wine_dlsym( libgnutls_handle, "gnutls_privkey_generate", NULL, 0 )))
|
||||
{
|
||||
WARN("gnutls_privkey_generate not found\n");
|
||||
pgnutls_privkey_generate = compat_gnutls_privkey_generate;
|
||||
}
|
||||
|
||||
if (TRACE_ON( bcrypt ))
|
||||
{
|
||||
|
@ -322,24 +355,24 @@ NTSTATUS key_set_property( struct key *key, const WCHAR *prop, UCHAR *value, ULO
|
|||
{
|
||||
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
|
||||
{
|
||||
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
|
||||
if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB ))
|
||||
{
|
||||
key->u.s.mode = MODE_ID_ECB;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
|
||||
else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC ))
|
||||
{
|
||||
key->u.s.mode = MODE_ID_CBC;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
|
||||
else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM ))
|
||||
{
|
||||
key->u.s.mode = MODE_ID_GCM;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
|
||||
FIXME( "unsupported mode %s\n", debugstr_w((WCHAR *)value) );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
@ -488,12 +521,114 @@ NTSTATUS key_symmetric_get_tag( struct key *key, UCHAR *tag, ULONG len )
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static NTSTATUS export_gnutls_pubkey_ecc( gnutls_privkey_t gnutls_key, UCHAR **pubkey, ULONG *pubkey_len )
|
||||
{
|
||||
BCRYPT_ECCKEY_BLOB *ecc_blob;
|
||||
gnutls_ecc_curve_t curve;
|
||||
gnutls_datum_t x, y;
|
||||
DWORD magic, size;
|
||||
UCHAR *src, *dst;
|
||||
int ret;
|
||||
|
||||
if ((ret = pgnutls_privkey_export_ecc_raw( gnutls_key, &curve, &x, &y, NULL )))
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
switch (curve)
|
||||
{
|
||||
case GNUTLS_ECC_CURVE_SECP256R1:
|
||||
magic = BCRYPT_ECDH_PUBLIC_P256_MAGIC;
|
||||
size = 32;
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME( "curve %u not supported\n", curve );
|
||||
free( x.data ); free( y.data );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if (!(ecc_blob = heap_alloc( sizeof(*ecc_blob) + x.size + y.size )))
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
free( x.data ); free( y.data );
|
||||
return STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
ecc_blob->dwMagic = magic;
|
||||
ecc_blob->cbKey = size;
|
||||
|
||||
dst = (UCHAR *)(ecc_blob + 1);
|
||||
if (x.size == size + 1) src = x.data + 1;
|
||||
else src = x.data;
|
||||
memcpy( dst, src, size );
|
||||
|
||||
dst += size;
|
||||
if (y.size == size + 1) src = y.data + 1;
|
||||
else src = y.data;
|
||||
memcpy( dst, src, size );
|
||||
|
||||
*pubkey = (UCHAR *)ecc_blob;
|
||||
*pubkey_len = sizeof(*ecc_blob) + ecc_blob->cbKey * 2;
|
||||
|
||||
free( x.data ); free( y.data );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS key_asymmetric_generate( struct key *key )
|
||||
{
|
||||
gnutls_pk_algorithm_t pk_alg;
|
||||
gnutls_ecc_curve_t curve;
|
||||
gnutls_privkey_t handle;
|
||||
NTSTATUS status;
|
||||
int ret;
|
||||
|
||||
if (!libgnutls_handle) return STATUS_INTERNAL_ERROR;
|
||||
|
||||
switch (key->alg_id)
|
||||
{
|
||||
case ALG_ID_ECDH_P256:
|
||||
pk_alg = GNUTLS_PK_ECC; /* compatible with ECDSA and ECDH */
|
||||
curve = GNUTLS_ECC_CURVE_SECP256R1;
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME( "algorithm %u not supported\n", key->alg_id );
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if ((ret = pgnutls_privkey_init( &handle )))
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
if ((ret = pgnutls_privkey_generate( handle, pk_alg, GNUTLS_CURVE_TO_BITS(curve), 0 )))
|
||||
{
|
||||
pgnutls_perror( ret );
|
||||
pgnutls_privkey_deinit( handle );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
if ((status = export_gnutls_pubkey_ecc( handle, &key->u.a.pubkey, &key->u.a.pubkey_len )))
|
||||
{
|
||||
pgnutls_privkey_deinit( handle );
|
||||
return STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
key->u.a.handle = handle;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHAR *pubkey, ULONG pubkey_len )
|
||||
{
|
||||
if (!libgnutls_handle) return STATUS_INTERNAL_ERROR;
|
||||
|
||||
switch (alg->id)
|
||||
{
|
||||
case ALG_ID_ECDH_P256:
|
||||
case ALG_ID_ECDSA_P256:
|
||||
case ALG_ID_ECDSA_P384:
|
||||
case ALG_ID_RSA:
|
||||
|
@ -504,10 +639,13 @@ NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, const UCHA
|
|||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (!(key->u.a.pubkey = heap_alloc( pubkey_len ))) return STATUS_NO_MEMORY;
|
||||
memcpy( key->u.a.pubkey, pubkey, pubkey_len );
|
||||
key->u.a.pubkey_len = pubkey_len;
|
||||
key->alg_id = alg->id;
|
||||
if (pubkey_len)
|
||||
{
|
||||
if (!(key->u.a.pubkey = heap_alloc( pubkey_len ))) return STATUS_NO_MEMORY;
|
||||
memcpy( key->u.a.pubkey, pubkey, pubkey_len );
|
||||
key->u.a.pubkey_len = pubkey_len;
|
||||
}
|
||||
key->alg_id = alg->id;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -728,7 +866,11 @@ NTSTATUS key_destroy( struct key *key )
|
|||
if (key->u.s.handle) pgnutls_cipher_deinit( key->u.s.handle );
|
||||
heap_free( key->u.s.secret );
|
||||
}
|
||||
else heap_free( key->u.a.pubkey );
|
||||
else
|
||||
{
|
||||
if (key->u.a.handle) pgnutls_privkey_deinit( key->u.a.handle );
|
||||
heap_free( key->u.a.pubkey );
|
||||
}
|
||||
heap_free( key );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -48,19 +48,19 @@ NTSTATUS key_set_property( struct key *key, const WCHAR *prop, UCHAR *value, ULO
|
|||
{
|
||||
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
|
||||
{
|
||||
if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
|
||||
if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB ))
|
||||
{
|
||||
key->u.s.mode = MODE_ID_ECB;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
|
||||
else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC ))
|
||||
{
|
||||
key->u.s.mode = MODE_ID_CBC;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
|
||||
FIXME( "unsupported mode %s\n", debugstr_w((WCHAR *)value) );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
@ -205,6 +205,12 @@ NTSTATUS key_asymmetric_verify( struct key *key, void *padding, UCHAR *hash, ULO
|
|||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS key_asymmetric_generate( struct key *key )
|
||||
{
|
||||
FIXME( "not implemented on Mac\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS key_destroy( struct key *key )
|
||||
{
|
||||
if (key->u.s.ref_encrypt) CCCryptorRelease( key->u.s.ref_encrypt );
|
||||
|
|
|
@ -26,31 +26,34 @@
|
|||
|
||||
#include "wine/test.h"
|
||||
|
||||
static NTSTATUS (WINAPI *pBCryptOpenAlgorithmProvider)(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptCloseAlgorithmProvider)(BCRYPT_ALG_HANDLE, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptGetFipsAlgorithmMode)(BOOLEAN *);
|
||||
static NTSTATUS (WINAPI *pBCryptCreateHash)(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR,
|
||||
ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptHash)(BCRYPT_ALG_HANDLE, UCHAR *, ULONG, UCHAR *, ULONG, UCHAR *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptHashData)(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDuplicateHash)(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptFinishHash)(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDecrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG,
|
||||
ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDestroyHash)(BCRYPT_HASH_HANDLE);
|
||||
static NTSTATUS (WINAPI *pBCryptGenRandom)(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptGetProperty)(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptSetProperty)(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE);
|
||||
static NTSTATUS (WINAPI *pBCryptDuplicateHash)(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDuplicateKey)(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptEncrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG,
|
||||
ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptExportKey)(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptFinalizeKeyPair)(BCRYPT_KEY_HANDLE, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptFinishHash)(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptGenerateKeyPair)(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptGenerateSymmetricKey)(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE *, PUCHAR, ULONG,
|
||||
PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptEncrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG,
|
||||
ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDecrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG,
|
||||
ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDuplicateKey)(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE);
|
||||
static NTSTATUS (WINAPI *pBCryptGetFipsAlgorithmMode)(BOOLEAN *);
|
||||
static NTSTATUS (WINAPI *pBCryptGetProperty)(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptGenRandom)(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptHash)(BCRYPT_ALG_HANDLE, UCHAR *, ULONG, UCHAR *, ULONG, UCHAR *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptHashData)(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptImportKey)(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *,
|
||||
PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptExportKey)(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptImportKeyPair)(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptImportKeyPair)(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *,
|
||||
UCHAR *, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptOpenAlgorithmProvider)(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptSetProperty)(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG);
|
||||
static NTSTATUS (WINAPI *pBCryptVerifySignature)(BCRYPT_KEY_HANDLE, VOID *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG);
|
||||
|
||||
static void test_BCryptGenRandom(void)
|
||||
|
@ -485,7 +488,7 @@ static void test_aes(void)
|
|||
ok(key_lengths.dwIncrement == 64, "Expected 64, got %d\n", key_lengths.dwIncrement);
|
||||
|
||||
memcpy(mode, BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM));
|
||||
ret = pBCryptSetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode), 0);
|
||||
ret = pBCryptSetProperty(alg, BCRYPT_CHAINING_MODE, mode, 0, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
size = 0;
|
||||
|
@ -540,6 +543,25 @@ static void test_BCryptGenerateSymmetricKey(void)
|
|||
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
|
||||
size = 0;
|
||||
memset(mode, 0, sizeof(mode));
|
||||
ret = pBCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
|
||||
ok(size == 64, "got %u\n", size);
|
||||
|
||||
ret = pBCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_ECB, 0, 0);
|
||||
ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
|
||||
if (ret == STATUS_SUCCESS)
|
||||
{
|
||||
size = 0;
|
||||
memset(mode, 0, sizeof(mode));
|
||||
ret = pBCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
|
||||
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
|
||||
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_ECB), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
|
||||
ok(size == 64, "got %u\n", size);
|
||||
}
|
||||
|
||||
ret = pBCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
|
||||
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
|
||||
ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
|
||||
|
@ -1654,6 +1676,31 @@ static void test_RSA(void)
|
|||
ok(!ret, "pBCryptCloseAlgorithmProvider failed: %08x\n", ret);
|
||||
}
|
||||
|
||||
static void test_ECDH(void)
|
||||
{
|
||||
BCRYPT_ALG_HANDLE alg;
|
||||
BCRYPT_KEY_HANDLE key;
|
||||
NTSTATUS status;
|
||||
|
||||
status = pBCryptOpenAlgorithmProvider(&alg, BCRYPT_ECDH_P256_ALGORITHM, NULL, 0);
|
||||
if (status)
|
||||
{
|
||||
skip("Failed to open BCRYPT_ECDH_P256_ALGORITHM provider %08x\n", status);
|
||||
return;
|
||||
}
|
||||
|
||||
key = NULL;
|
||||
status = pBCryptGenerateKeyPair(alg, &key, 256, 0);
|
||||
ok(status == STATUS_SUCCESS, "got %08x\n", status);
|
||||
ok(key != NULL, "key not set\n");
|
||||
|
||||
status = pBCryptFinalizeKeyPair(key, 0);
|
||||
ok(status == STATUS_SUCCESS, "got %08x\n", status);
|
||||
|
||||
pBCryptDestroyKey(key);
|
||||
pBCryptCloseAlgorithmProvider(alg, 0);
|
||||
}
|
||||
|
||||
START_TEST(bcrypt)
|
||||
{
|
||||
HMODULE module;
|
||||
|
@ -1665,26 +1712,28 @@ START_TEST(bcrypt)
|
|||
return;
|
||||
}
|
||||
|
||||
pBCryptOpenAlgorithmProvider = (void *)GetProcAddress(module, "BCryptOpenAlgorithmProvider");
|
||||
pBCryptCloseAlgorithmProvider = (void *)GetProcAddress(module, "BCryptCloseAlgorithmProvider");
|
||||
pBCryptGetFipsAlgorithmMode = (void *)GetProcAddress(module, "BCryptGetFipsAlgorithmMode");
|
||||
pBCryptCreateHash = (void *)GetProcAddress(module, "BCryptCreateHash");
|
||||
pBCryptDecrypt = (void *)GetProcAddress(module, "BCryptDecrypt");
|
||||
pBCryptDestroyHash = (void *)GetProcAddress(module, "BCryptDestroyHash");
|
||||
pBCryptDestroyKey = (void *)GetProcAddress(module, "BCryptDestroyKey");
|
||||
pBCryptDuplicateHash = (void *)GetProcAddress(module, "BCryptDuplicateHash");
|
||||
pBCryptDuplicateKey = (void *)GetProcAddress(module, "BCryptDuplicateKey");
|
||||
pBCryptEncrypt = (void *)GetProcAddress(module, "BCryptEncrypt");
|
||||
pBCryptExportKey = (void *)GetProcAddress(module, "BCryptExportKey");
|
||||
pBCryptFinalizeKeyPair = (void *)GetProcAddress(module, "BCryptFinalizeKeyPair");
|
||||
pBCryptFinishHash = (void *)GetProcAddress(module, "BCryptFinishHash");
|
||||
pBCryptGenerateKeyPair = (void *)GetProcAddress(module, "BCryptGenerateKeyPair");
|
||||
pBCryptGenerateSymmetricKey = (void *)GetProcAddress(module, "BCryptGenerateSymmetricKey");
|
||||
pBCryptGenRandom = (void *)GetProcAddress(module, "BCryptGenRandom");
|
||||
pBCryptGetFipsAlgorithmMode = (void *)GetProcAddress(module, "BCryptGetFipsAlgorithmMode");
|
||||
pBCryptGetProperty = (void *)GetProcAddress(module, "BCryptGetProperty");
|
||||
pBCryptHash = (void *)GetProcAddress(module, "BCryptHash");
|
||||
pBCryptHashData = (void *)GetProcAddress(module, "BCryptHashData");
|
||||
pBCryptDuplicateHash = (void *)GetProcAddress(module, "BCryptDuplicateHash");
|
||||
pBCryptFinishHash = (void *)GetProcAddress(module, "BCryptFinishHash");
|
||||
pBCryptDestroyHash = (void *)GetProcAddress(module, "BCryptDestroyHash");
|
||||
pBCryptGenRandom = (void *)GetProcAddress(module, "BCryptGenRandom");
|
||||
pBCryptGetProperty = (void *)GetProcAddress(module, "BCryptGetProperty");
|
||||
pBCryptSetProperty = (void *)GetProcAddress(module, "BCryptSetProperty");
|
||||
pBCryptGenerateSymmetricKey = (void *)GetProcAddress(module, "BCryptGenerateSymmetricKey");
|
||||
pBCryptEncrypt = (void *)GetProcAddress(module, "BCryptEncrypt");
|
||||
pBCryptDecrypt = (void *)GetProcAddress(module, "BCryptDecrypt");
|
||||
pBCryptDuplicateKey = (void *)GetProcAddress(module, "BCryptDuplicateKey");
|
||||
pBCryptDestroyKey = (void *)GetProcAddress(module, "BCryptDestroyKey");
|
||||
pBCryptImportKey = (void *)GetProcAddress(module, "BCryptImportKey");
|
||||
pBCryptExportKey = (void *)GetProcAddress(module, "BCryptExportKey");
|
||||
pBCryptImportKeyPair = (void *)GetProcAddress(module, "BCryptImportKeyPair");
|
||||
pBCryptOpenAlgorithmProvider = (void *)GetProcAddress(module, "BCryptOpenAlgorithmProvider");
|
||||
pBCryptSetProperty = (void *)GetProcAddress(module, "BCryptSetProperty");
|
||||
pBCryptVerifySignature = (void *)GetProcAddress(module, "BCryptVerifySignature");
|
||||
|
||||
test_BCryptGenRandom();
|
||||
|
@ -1698,6 +1747,7 @@ START_TEST(bcrypt)
|
|||
test_key_import_export();
|
||||
test_ECDSA();
|
||||
test_RSA();
|
||||
test_ECDH();
|
||||
|
||||
if (pBCryptHash) /* >= Win 10 */
|
||||
test_BcryptHash();
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
@ stub BluetoothEnumerateInstalledServicesEx
|
||||
@ stub BluetoothFindBrowseGroupClose
|
||||
@ stub BluetoothFindClassIdClose
|
||||
@ stub BluetoothFindDeviceClose
|
||||
@ stdcall BluetoothFindDeviceClose(ptr)
|
||||
@ stub BluetoothFindFirstBrowseGroup
|
||||
@ stub BluetoothFindFirstClassId
|
||||
@ stdcall BluetoothFindFirstDevice(ptr ptr)
|
||||
|
|
|
@ -60,3 +60,13 @@ BOOL WINAPI BluetoothFindRadioClose(HBLUETOOTH_RADIO_FIND find)
|
|||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* BluetoothFindDeviceClose
|
||||
*/
|
||||
BOOL WINAPI BluetoothFindDeviceClose(HBLUETOOTH_DEVICE_FIND find)
|
||||
{
|
||||
FIXME("(%p): stub!\n", find);
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
@ stub GetFuncDescs
|
||||
@ stdcall GetHGlobalFromStream(ptr ptr) ole32.GetHGlobalFromStream
|
||||
@ stub GetHookInterface
|
||||
@ stub GetRestrictedErrorInfo
|
||||
@ stdcall GetRestrictedErrorInfo(ptr)
|
||||
@ stub HSTRING_UserFree
|
||||
@ stub HSTRING_UserFree64
|
||||
@ stub HSTRING_UserMarshal
|
||||
|
@ -260,7 +260,7 @@
|
|||
@ stub RoInspectThreadErrorInfo
|
||||
@ stub RoOriginateError
|
||||
@ stub RoOriginateErrorW
|
||||
@ stub RoOriginateLanguageException
|
||||
@ stdcall RoOriginateLanguageException(long ptr ptr)
|
||||
@ stub RoParameterizedTypeExtraGetTypeSignature
|
||||
@ stdcall RoRegisterActivationFactories(ptr ptr long ptr)
|
||||
@ stdcall RoRegisterForApartmentShutdown(ptr ptr ptr)
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "initguid.h"
|
||||
#include "roapi.h"
|
||||
#include "roparameterizediid.h"
|
||||
#include "roerrorapi.h"
|
||||
#include "winstring.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
@ -275,6 +276,24 @@ HRESULT WINAPI RoRegisterActivationFactories(HSTRING *classes, PFNGETACTIVATIONF
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetRestrictedErrorInfo (combase.@)
|
||||
*/
|
||||
HRESULT WINAPI GetRestrictedErrorInfo(IRestrictedErrorInfo **info)
|
||||
{
|
||||
FIXME( "(%p)\n", info );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* RoOriginateLanguageException (combase.@)
|
||||
*/
|
||||
BOOL WINAPI RoOriginateLanguageException(HRESULT error, HSTRING message, IUnknown *language_exception)
|
||||
{
|
||||
FIXME("(%x %s %p) stub\n", error, debugstr_hstring(message), language_exception);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CleanupTlsOleState (combase.@)
|
||||
*/
|
||||
|
|
|
@ -1964,6 +1964,16 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam
|
|||
if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0);
|
||||
return TRUE;
|
||||
|
||||
case WM_CTLCOLOR:
|
||||
case WM_CTLCOLORMSGBOX:
|
||||
case WM_CTLCOLOREDIT:
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
case WM_CTLCOLORBTN:
|
||||
case WM_CTLCOLORDLG:
|
||||
case WM_CTLCOLORSCROLLBAR:
|
||||
case WM_CTLCOLORSTATIC:
|
||||
return SendMessageW(lphc->owner, message, wParam, lParam);
|
||||
|
||||
/* Combo messages */
|
||||
case CB_ADDSTRING:
|
||||
if (lphc->dwStyle & CBS_LOWERCASE)
|
||||
|
|
|
@ -2012,7 +2012,7 @@ static LRESULT LISTBOX_HandleHScroll( LB_DESCR *descr, WORD scrollReq, WORD pos
|
|||
|
||||
static LRESULT LISTBOX_HandleMouseWheel(LB_DESCR *descr, SHORT delta )
|
||||
{
|
||||
UINT pulScrollLines = 3;
|
||||
INT pulScrollLines = 3;
|
||||
|
||||
SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
|
||||
|
||||
|
@ -2026,9 +2026,20 @@ static LRESULT LISTBOX_HandleMouseWheel(LB_DESCR *descr, SHORT delta )
|
|||
if (descr->wheel_remain && pulScrollLines)
|
||||
{
|
||||
int cLineScroll;
|
||||
pulScrollLines = min((UINT) descr->page_size, pulScrollLines);
|
||||
cLineScroll = pulScrollLines * (float)descr->wheel_remain / WHEEL_DELTA;
|
||||
descr->wheel_remain -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
|
||||
if (descr->style & LBS_MULTICOLUMN)
|
||||
{
|
||||
pulScrollLines = min(descr->width / descr->column_width, pulScrollLines);
|
||||
pulScrollLines = max(1, pulScrollLines);
|
||||
cLineScroll = pulScrollLines * descr->wheel_remain / WHEEL_DELTA;
|
||||
descr->wheel_remain -= WHEEL_DELTA * cLineScroll / pulScrollLines;
|
||||
cLineScroll *= descr->page_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
pulScrollLines = min(descr->page_size, pulScrollLines);
|
||||
cLineScroll = pulScrollLines * descr->wheel_remain / WHEEL_DELTA;
|
||||
descr->wheel_remain -= WHEEL_DELTA * cLineScroll / pulScrollLines;
|
||||
}
|
||||
LISTBOX_SetTopItem( descr, descr->top_item - cLineScroll, TRUE );
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -11084,13 +11084,21 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
|
|||
infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0);
|
||||
}
|
||||
|
||||
/* if control created invisible header isn't created */
|
||||
/* When ListView control is created invisible, header isn't created right away. */
|
||||
if (infoPtr->hwndHeader)
|
||||
{
|
||||
HDLAYOUT hl;
|
||||
WINDOWPOS wp;
|
||||
POINT origin;
|
||||
WINDOWPOS wp;
|
||||
HDLAYOUT hl;
|
||||
RECT rect;
|
||||
|
||||
hl.prc = &infoPtr->rcList;
|
||||
LISTVIEW_GetOrigin(infoPtr, &origin);
|
||||
|
||||
rect = infoPtr->rcList;
|
||||
rect.left += origin.x;
|
||||
rect.top += origin.y;
|
||||
|
||||
hl.prc = ▭
|
||||
hl.pwpos = ℘
|
||||
SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
|
||||
TRACE(" wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy);
|
||||
|
|
|
@ -652,23 +652,24 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
|||
|
||||
case PBM_STEPIT:
|
||||
{
|
||||
INT oldVal;
|
||||
oldVal = infoPtr->CurVal;
|
||||
infoPtr->CurVal += infoPtr->Step;
|
||||
if (infoPtr->CurVal > infoPtr->MaxVal)
|
||||
int oldVal = infoPtr->CurVal;
|
||||
|
||||
if (infoPtr->MinVal != infoPtr->MaxVal)
|
||||
{
|
||||
infoPtr->CurVal = (infoPtr->CurVal - infoPtr->MinVal) % (infoPtr->MaxVal - infoPtr->MinVal) + infoPtr->MinVal;
|
||||
infoPtr->CurVal += infoPtr->Step;
|
||||
if (infoPtr->CurVal > infoPtr->MaxVal)
|
||||
infoPtr->CurVal = (infoPtr->CurVal - infoPtr->MinVal) % (infoPtr->MaxVal - infoPtr->MinVal) + infoPtr->MinVal;
|
||||
if (infoPtr->CurVal < infoPtr->MinVal)
|
||||
infoPtr->CurVal = (infoPtr->CurVal - infoPtr->MinVal) % (infoPtr->MaxVal - infoPtr->MinVal) + infoPtr->MaxVal;
|
||||
|
||||
if (oldVal != infoPtr->CurVal)
|
||||
{
|
||||
TRACE("PBM_STEPIT: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal);
|
||||
PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal );
|
||||
UpdateWindow( infoPtr->Self );
|
||||
}
|
||||
}
|
||||
if (infoPtr->CurVal < infoPtr->MinVal)
|
||||
{
|
||||
infoPtr->CurVal = (infoPtr->CurVal - infoPtr->MinVal) % (infoPtr->MaxVal - infoPtr->MinVal) + infoPtr->MaxVal;
|
||||
}
|
||||
if(oldVal != infoPtr->CurVal)
|
||||
{
|
||||
TRACE("PBM_STEPIT: current pos changed from %d to %d\n", oldVal, infoPtr->CurVal);
|
||||
PROGRESS_Invalidate( infoPtr, oldVal, infoPtr->CurVal );
|
||||
UpdateWindow( infoPtr->Self );
|
||||
}
|
||||
|
||||
return oldVal;
|
||||
}
|
||||
|
||||
|
|
|
@ -2760,7 +2760,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
|
|||
|
||||
static INT do_loop(const PropSheetInfo *psInfo)
|
||||
{
|
||||
MSG msg;
|
||||
MSG msg = { 0 };
|
||||
INT ret = 0;
|
||||
HWND hwnd = psInfo->hwnd;
|
||||
HWND parent = psInfo->ppshheader.hwndParent;
|
||||
|
@ -2777,7 +2777,7 @@ static INT do_loop(const PropSheetInfo *psInfo)
|
|||
}
|
||||
}
|
||||
|
||||
if(ret == 0)
|
||||
if(ret == 0 && msg.message)
|
||||
PostQuitMessage(msg.wParam);
|
||||
|
||||
if(ret != -1)
|
||||
|
|
|
@ -1294,8 +1294,8 @@ static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT i
|
|||
REBAR_BAND *lpBand;
|
||||
int yMaxHeight = 0;
|
||||
int yPos = yStart;
|
||||
int row = REBAR_GetBand(infoPtr, iBeginBand)->iRow;
|
||||
int i;
|
||||
int row, i;
|
||||
|
||||
for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i))
|
||||
{
|
||||
lpBand = REBAR_GetBand(infoPtr, i);
|
||||
|
@ -1304,6 +1304,8 @@ static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT i
|
|||
}
|
||||
TRACE("Bands [%d; %d) height: %d\n", iBeginBand, iEndBand, yMaxHeight);
|
||||
|
||||
row = iBeginBand < iEndBand ? REBAR_GetBand(infoPtr, iBeginBand)->iRow : 0;
|
||||
|
||||
for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i))
|
||||
{
|
||||
lpBand = REBAR_GetBand(infoPtr, i);
|
||||
|
|
|
@ -566,12 +566,12 @@ static BOOL SYSLINK_WrapLine (LPWSTR Text, WCHAR BreakChar, int x, int *LineLen,
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nFit; i++) if (Text[i] == '\n') break;
|
||||
for (i = 0; i < nFit; i++) if (Text[i] == '\r' || Text[i] == '\n') break;
|
||||
|
||||
if (i == *LineLen) return FALSE;
|
||||
|
||||
/* check if we're in the middle of a word */
|
||||
if (Text[i] != '\n' && Text[i] != BreakChar)
|
||||
if (Text[i] != '\r' && Text[i] != '\n' && Text[i] != BreakChar)
|
||||
{
|
||||
/* search for the beginning of the word */
|
||||
while (i && Text[i - 1] != BreakChar) i--;
|
||||
|
@ -654,6 +654,12 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
|
|||
/* skip break characters unless they're the first of the doc item */
|
||||
if(tx != Current->Text || x == SL_LEFTMARGIN)
|
||||
{
|
||||
if (n && *tx == '\r')
|
||||
{
|
||||
tx++;
|
||||
SkipChars++;
|
||||
n--;
|
||||
}
|
||||
if (n && *tx == '\n')
|
||||
{
|
||||
tx++;
|
||||
|
|
|
@ -46,6 +46,8 @@ static HWND hComboExParentWnd, hMainWnd;
|
|||
static HINSTANCE hMainHinst;
|
||||
static const char ComboExTestClass[] = "ComboExTestClass";
|
||||
|
||||
static HBRUSH brush_red;
|
||||
|
||||
static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);
|
||||
|
||||
#define MAX_CHARS 100
|
||||
|
@ -507,6 +509,8 @@ static BOOL init(void)
|
|||
wc.lpfnWndProc = ComboExTestWndProc;
|
||||
RegisterClassA(&wc);
|
||||
|
||||
brush_red = CreateSolidBrush(RGB(255, 0, 0));
|
||||
|
||||
hMainWnd = CreateWindowA(WC_STATICA, "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0);
|
||||
ShowWindow(hMainWnd, SW_SHOW);
|
||||
|
||||
|
@ -533,6 +537,7 @@ static void cleanup(void)
|
|||
UnregisterClassA(ComboExTestClass, GetModuleHandleA(NULL));
|
||||
|
||||
DestroyWindow(hMainWnd);
|
||||
DeleteObject(brush_red);
|
||||
}
|
||||
|
||||
static void test_comboex_subclass(void)
|
||||
|
@ -717,6 +722,7 @@ static LRESULT (CALLBACK *old_parent_proc)(HWND hwnd, UINT msg, WPARAM wparam, L
|
|||
static LPCSTR expected_edit_text;
|
||||
static LPCSTR expected_list_text;
|
||||
static BOOL selchange_fired;
|
||||
static HWND lparam_for_WM_CTLCOLOR;
|
||||
|
||||
static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
|
@ -748,6 +754,20 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPAR
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case WM_CTLCOLOR:
|
||||
case WM_CTLCOLORMSGBOX:
|
||||
case WM_CTLCOLOREDIT:
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
case WM_CTLCOLORBTN:
|
||||
case WM_CTLCOLORDLG:
|
||||
case WM_CTLCOLORSCROLLBAR:
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if (lparam_for_WM_CTLCOLOR)
|
||||
{
|
||||
ok(lparam_for_WM_CTLCOLOR == (HWND)lparam, "Expected %p, got %p\n", lparam_for_WM_CTLCOLOR, (HWND)lparam);
|
||||
return (LRESULT) brush_red;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return CallWindowProcA(old_parent_proc, hwnd, msg, wparam, lparam);
|
||||
|
@ -1254,6 +1274,80 @@ static void test_combo_dropdown_size(DWORD style)
|
|||
}
|
||||
}
|
||||
|
||||
static void test_combo_ctlcolor(void)
|
||||
{
|
||||
static const int messages[] =
|
||||
{
|
||||
WM_CTLCOLOR,
|
||||
WM_CTLCOLORMSGBOX,
|
||||
WM_CTLCOLOREDIT,
|
||||
WM_CTLCOLORLISTBOX,
|
||||
WM_CTLCOLORBTN,
|
||||
WM_CTLCOLORDLG,
|
||||
WM_CTLCOLORSCROLLBAR,
|
||||
WM_CTLCOLORSTATIC,
|
||||
};
|
||||
|
||||
HBRUSH brush, global_brush;
|
||||
COMBOBOXINFO info;
|
||||
unsigned int i;
|
||||
HWND combo;
|
||||
|
||||
combo = create_combobox(CBS_DROPDOWN);
|
||||
ok(!!combo, "Failed to create combo window.\n");
|
||||
|
||||
old_parent_proc = (void *)SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)parent_wnd_proc);
|
||||
|
||||
get_combobox_info(combo, &info);
|
||||
|
||||
lparam_for_WM_CTLCOLOR = info.hwndItem;
|
||||
|
||||
/* Parent returns valid brush handle. */
|
||||
for (i = 0; i < ARRAY_SIZE(messages); ++i)
|
||||
{
|
||||
brush = (HBRUSH)SendMessageA(combo, messages[i], 0, (LPARAM)info.hwndItem);
|
||||
ok(brush == brush_red, "%u: unexpected brush %p, expected got %p.\n", i, brush, brush_red);
|
||||
}
|
||||
|
||||
/* Parent returns NULL brush. */
|
||||
global_brush = brush_red;
|
||||
brush_red = NULL;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(messages); ++i)
|
||||
{
|
||||
brush = (HBRUSH)SendMessageA(combo, messages[i], 0, (LPARAM)info.hwndItem);
|
||||
ok(!brush, "%u: unexpected brush %p.\n", i, brush);
|
||||
}
|
||||
|
||||
brush_red = global_brush;
|
||||
|
||||
lparam_for_WM_CTLCOLOR = 0;
|
||||
|
||||
/* Parent does default processing. */
|
||||
for (i = 0; i < ARRAY_SIZE(messages); ++i)
|
||||
{
|
||||
brush = (HBRUSH)SendMessageA(combo, messages[i], 0, (LPARAM)info.hwndItem);
|
||||
ok(!!brush && brush != brush_red, "%u: unexpected brush %p.\n", i, brush);
|
||||
}
|
||||
|
||||
SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc);
|
||||
DestroyWindow(combo);
|
||||
|
||||
/* Combo without a parent. */
|
||||
combo = CreateWindowA(WC_COMBOBOXA, "Combo", CBS_DROPDOWN, 5, 5, 100, 100, NULL, NULL, NULL, 0);
|
||||
ok(!!combo, "Failed to create combo window.\n");
|
||||
|
||||
get_combobox_info(combo, &info);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(messages); ++i)
|
||||
{
|
||||
brush = (HBRUSH)SendMessageA(combo, messages[i], 0, (LPARAM)info.hwndItem);
|
||||
ok(!brush, "%u: unexpected brush %p.\n", i, brush);
|
||||
}
|
||||
|
||||
DestroyWindow(combo);
|
||||
}
|
||||
|
||||
START_TEST(combo)
|
||||
{
|
||||
ULONG_PTR ctx_cookie;
|
||||
|
@ -1297,6 +1391,7 @@ START_TEST(combo)
|
|||
test_combo_listbox_styles(CBS_DROPDOWNLIST);
|
||||
test_combo_dropdown_size(0);
|
||||
test_combo_dropdown_size(CBS_NOINTEGRALHEIGHT);
|
||||
test_combo_ctlcolor();
|
||||
|
||||
cleanup();
|
||||
unload_v6_module(ctx_cookie, hCtx);
|
||||
|
|
|
@ -1812,7 +1812,7 @@ static void test_listbox_dlgdir(void)
|
|||
strcpy(pathBuffer, "C:\\");
|
||||
res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE);
|
||||
ok(res, "DlgDirList failed to list C:\\ folders\n");
|
||||
todo_wine ok(!strcmp(pathBuffer, "*"), "DlgDirList set the invalid path spec '%s', expected '*'\n", pathBuffer);
|
||||
ok(!strcmp(pathBuffer, "*"), "DlgDirList set the invalid path spec '%s', expected '*'\n", pathBuffer);
|
||||
|
||||
strcpy(pathBuffer, "C:\\*");
|
||||
res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE);
|
||||
|
@ -1823,8 +1823,8 @@ static void test_listbox_dlgdir(void)
|
|||
SetLastError(0xdeadbeef);
|
||||
strcpy(pathBuffer, "C:\\INVALID$$DIR");
|
||||
res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE);
|
||||
todo_wine ok(!res, "DlgDirList should have failed with 0 but %d was returned\n", res);
|
||||
todo_wine ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS,
|
||||
ok(!res, "DlgDirList should have failed with 0 but %d was returned\n", res);
|
||||
ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS,
|
||||
"GetLastError should return 0x589, got 0x%X\n",GetLastError());
|
||||
|
||||
DestroyWindow(hWnd);
|
||||
|
|
|
@ -254,6 +254,13 @@ static void test_PBM_STEPIT(void)
|
|||
{ 3, 15, 5 },
|
||||
{ 3, 15, -5 },
|
||||
{ 3, 15, 50 },
|
||||
{ -15, 15, 5 },
|
||||
{ -3, -2, -5 },
|
||||
{ 0, 0, 1 },
|
||||
{ 5, 5, 1 },
|
||||
{ 0, 0, -1 },
|
||||
{ 5, 5, -1 },
|
||||
{ 10, 5, 2 },
|
||||
};
|
||||
HWND progress;
|
||||
int i, j;
|
||||
|
@ -261,6 +268,7 @@ static void test_PBM_STEPIT(void)
|
|||
for (i = 0; i < ARRAY_SIZE(stepit_tests); i++)
|
||||
{
|
||||
struct stepit_test *test = &stepit_tests[i];
|
||||
PBRANGE range;
|
||||
LRESULT ret;
|
||||
|
||||
progress = create_progress(0);
|
||||
|
@ -268,6 +276,9 @@ static void test_PBM_STEPIT(void)
|
|||
ret = SendMessageA(progress, PBM_SETRANGE32, test->min, test->max);
|
||||
ok(ret != 0, "Unexpected return value.\n");
|
||||
|
||||
SendMessageA(progress, PBM_GETRANGE, 0, (LPARAM)&range);
|
||||
ok(range.iLow == test->min && range.iHigh == test->max, "Unexpected range.\n");
|
||||
|
||||
SendMessageA(progress, PBM_SETPOS, test->min, 0);
|
||||
SendMessageA(progress, PBM_SETSTEP, test->step, 0);
|
||||
|
||||
|
@ -277,15 +288,20 @@ static void test_PBM_STEPIT(void)
|
|||
int current;
|
||||
|
||||
pos += test->step;
|
||||
if (pos > test->max)
|
||||
pos = (pos - test->min) % (test->max - test->min) + test->min;
|
||||
if (pos < test->min)
|
||||
pos = (pos - test->min) % (test->max - test->min) + test->max;
|
||||
if (test->min != test->max)
|
||||
{
|
||||
if (pos > test->max)
|
||||
pos = (pos - test->min) % (test->max - test->min) + test->min;
|
||||
if (pos < test->min)
|
||||
pos = (pos - test->min) % (test->max - test->min) + test->max;
|
||||
}
|
||||
else
|
||||
pos = test->min;
|
||||
|
||||
SendMessageA(progress, PBM_STEPIT, 0, 0);
|
||||
|
||||
current = SendMessageA(progress, PBM_GETPOS, 0, 0);
|
||||
ok(current == pos, "Unexpected position %d, expected %d.\n", current, pos);
|
||||
ok(current == pos, "%u: unexpected position %d, expected %d.\n", i, current, pos);
|
||||
}
|
||||
|
||||
DestroyWindow(progress);
|
||||
|
|
|
@ -499,6 +499,7 @@ static void test_layout(void)
|
|||
REBARBANDINFOA rbi;
|
||||
HIMAGELIST himl;
|
||||
REBARINFO ri;
|
||||
int count;
|
||||
|
||||
rbsize_results_init();
|
||||
|
||||
|
@ -660,9 +661,27 @@ static void test_layout(void)
|
|||
SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
|
||||
check_sizes();
|
||||
|
||||
rbsize_results_free();
|
||||
DestroyWindow(hRebar);
|
||||
pImageList_Destroy(himl);
|
||||
|
||||
/* One hidden band. */
|
||||
hRebar = create_rebar_control();
|
||||
|
||||
rbi.cbSize = REBARBANDINFOA_V6_SIZE;
|
||||
rbi.fMask = RBBIM_STYLE | RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD;
|
||||
rbi.fStyle = RBBS_HIDDEN;
|
||||
rbi.cx = 200;
|
||||
rbi.cxMinChild = 100;
|
||||
rbi.cyMinChild = 30;
|
||||
rbi.hwndChild = NULL;
|
||||
|
||||
SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
|
||||
count = SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0);
|
||||
ok(!count, "Unexpected row count %d.\n", count);
|
||||
|
||||
DestroyWindow(hRebar);
|
||||
|
||||
rbsize_results_free();
|
||||
}
|
||||
|
||||
#if 0 /* use this to generate more tests */
|
||||
|
|
|
@ -931,7 +931,7 @@ static void test_selection(void)
|
|||
static void test_thumb_length(void)
|
||||
{
|
||||
HWND hWndTrackbar;
|
||||
int r;
|
||||
int r, r2;
|
||||
|
||||
hWndTrackbar = create_trackbar(defaultstyle, hWndParent);
|
||||
ok(hWndTrackbar != NULL, "Expected non NULL value\n");
|
||||
|
@ -963,6 +963,22 @@ static void test_thumb_length(void)
|
|||
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_thumb_length_test_seq, "parent thumb length test sequence", TRUE);
|
||||
|
||||
DestroyWindow(hWndTrackbar);
|
||||
|
||||
/* Fixed thumb length does not depend on window size. */
|
||||
hWndTrackbar = CreateWindowA(TRACKBAR_CLASSA, "Trackbar Control", WS_VISIBLE | TBS_ENABLESELRANGE
|
||||
| TBS_FIXEDLENGTH, 0, 0, 0, 0, hWndParent, NULL, GetModuleHandleA(NULL), NULL);
|
||||
|
||||
r = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0, 0);
|
||||
|
||||
DestroyWindow(hWndTrackbar);
|
||||
|
||||
hWndTrackbar = CreateWindowA(TRACKBAR_CLASSA, "Trackbar Control", WS_VISIBLE | TBS_ENABLESELRANGE
|
||||
| TBS_FIXEDLENGTH, 0, 0, 200, 200, hWndParent, NULL, GetModuleHandleA(NULL), NULL);
|
||||
|
||||
r2 = SendMessageA(hWndTrackbar, TBM_GETTHUMBLENGTH, 0, 0);
|
||||
ok(r2 == r, "Unexpected thumb length %d.\n", r);
|
||||
|
||||
DestroyWindow(hWndTrackbar);
|
||||
}
|
||||
|
||||
static void test_tic_settings(void)
|
||||
|
|
|
@ -42,6 +42,8 @@ static BOOL g_get_rect_in_expand;
|
|||
static BOOL g_disp_A_to_W;
|
||||
static BOOL g_disp_set_stateimage;
|
||||
static BOOL g_beginedit_alter_text;
|
||||
static const char *g_endedit_overwrite_contents;
|
||||
static char *g_endedit_overwrite_ptr;
|
||||
static HFONT g_customdraw_font;
|
||||
static BOOL g_v6;
|
||||
|
||||
|
@ -1320,7 +1322,19 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
|
|||
break;
|
||||
}
|
||||
|
||||
case TVN_ENDLABELEDITA: return TRUE;
|
||||
case TVN_ENDLABELEDITA:
|
||||
{
|
||||
NMTVDISPINFOA *disp = (NMTVDISPINFOA *)lParam;
|
||||
if (disp->item.mask & TVIF_TEXT)
|
||||
{
|
||||
ok(disp->item.cchTextMax == MAX_PATH, "cchTextMax is %d\n", disp->item.cchTextMax);
|
||||
if (g_endedit_overwrite_contents)
|
||||
strcpy(disp->item.pszText, g_endedit_overwrite_contents);
|
||||
if (g_endedit_overwrite_ptr)
|
||||
disp->item.pszText = g_endedit_overwrite_ptr;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case TVN_ITEMEXPANDINGA:
|
||||
{
|
||||
UINT newmask = pTreeView->itemNew.mask & ~TVIF_CHILDREN;
|
||||
|
@ -1576,7 +1590,7 @@ static void test_itemedit(void)
|
|||
DWORD r;
|
||||
HWND edit;
|
||||
TVITEMA item;
|
||||
CHAR buffA[20];
|
||||
CHAR buffA[500];
|
||||
HWND hTree;
|
||||
|
||||
hTree = create_treeview_control(0);
|
||||
|
@ -1667,6 +1681,84 @@ static void test_itemedit(void)
|
|||
GetWindowTextA(edit, buffA, ARRAY_SIZE(buffA));
|
||||
ok(!strcmp(buffA, "<edittextaltered>"), "got string %s\n", buffA);
|
||||
|
||||
r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
|
||||
expect(0, r);
|
||||
|
||||
/* How much text can be typed? */
|
||||
edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot);
|
||||
ok(IsWindow(edit), "Expected valid handle\n");
|
||||
r = SendMessageA(edit, EM_GETLIMITTEXT, 0, 0);
|
||||
expect(MAX_PATH - 1, r);
|
||||
/* WM_SETTEXT can set more... */
|
||||
memset(buffA, 'a', ARRAY_SIZE(buffA));
|
||||
buffA[ARRAY_SIZE(buffA)-1] = 0;
|
||||
r = SetWindowTextA(edit, buffA);
|
||||
expect(TRUE, r);
|
||||
r = GetWindowTextA(edit, buffA, ARRAY_SIZE(buffA));
|
||||
expect(ARRAY_SIZE(buffA) - 1, r);
|
||||
/* ...but it's trimmed to MAX_PATH chars when editing ends */
|
||||
r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
|
||||
expect(0, r);
|
||||
item.mask = TVIF_TEXT;
|
||||
item.hItem = hRoot;
|
||||
item.pszText = buffA;
|
||||
item.cchTextMax = ARRAY_SIZE(buffA);
|
||||
r = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||
expect(TRUE, r);
|
||||
expect(MAX_PATH - 1, strlen(item.pszText));
|
||||
|
||||
/* We can't get around that MAX_PATH limit by increasing EM_SETLIMITTEXT */
|
||||
edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot);
|
||||
ok(IsWindow(edit), "Expected valid handle\n");
|
||||
SendMessageA(edit, EM_SETLIMITTEXT, ARRAY_SIZE(buffA)-1, 0);
|
||||
memset(buffA, 'a', ARRAY_SIZE(buffA));
|
||||
buffA[ARRAY_SIZE(buffA)-1] = 0;
|
||||
r = SetWindowTextA(edit, buffA);
|
||||
expect(TRUE, r);
|
||||
r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
|
||||
expect(0, r);
|
||||
item.mask = TVIF_TEXT;
|
||||
item.hItem = hRoot;
|
||||
item.pszText = buffA;
|
||||
item.cchTextMax = ARRAY_SIZE(buffA);
|
||||
r = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||
expect(TRUE, r);
|
||||
expect(MAX_PATH - 1, strlen(item.pszText));
|
||||
|
||||
/* Overwriting of pszText contents in TVN_ENDLABELEDIT */
|
||||
edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot);
|
||||
ok(IsWindow(edit), "Expected valid handle\n");
|
||||
r = SetWindowTextA(edit, "old");
|
||||
expect(TRUE, r);
|
||||
g_endedit_overwrite_contents = "<new_contents>";
|
||||
r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
|
||||
expect(0, r);
|
||||
g_endedit_overwrite_contents = NULL;
|
||||
item.mask = TVIF_TEXT;
|
||||
item.hItem = hRoot;
|
||||
item.pszText = buffA;
|
||||
item.cchTextMax = ARRAY_SIZE(buffA);
|
||||
r = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||
expect(TRUE, r);
|
||||
expect(0, strcmp(item.pszText, "<new_contents>"));
|
||||
|
||||
/* Overwriting of pszText pointer in TVN_ENDLABELEDIT */
|
||||
edit = (HWND)SendMessageA(hTree, TVM_EDITLABELA, 0, (LPARAM)hRoot);
|
||||
ok(IsWindow(edit), "Expected valid handle\n");
|
||||
r = SetWindowTextA(edit, "old");
|
||||
expect(TRUE, r);
|
||||
g_endedit_overwrite_ptr = (char*) "<new_ptr>";
|
||||
r = SendMessageA(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
|
||||
expect(0, r);
|
||||
g_endedit_overwrite_ptr = NULL;
|
||||
item.mask = TVIF_TEXT;
|
||||
item.hItem = hRoot;
|
||||
item.pszText = buffA;
|
||||
item.cchTextMax = ARRAY_SIZE(buffA);
|
||||
r = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||
expect(TRUE, r);
|
||||
expect(0, strcmp(item.pszText, "<new_ptr>"));
|
||||
|
||||
DestroyWindow(hTree);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
* - check UDM_SETBUDDY message
|
||||
* - check UDM_GETBUDDY message
|
||||
* - up-down control and buddy control must have the same parent
|
||||
* - up-down control notifies its parent window when its position changes with UDN_DELTAPOS + WM_VSCROLL or WM_HSCROLL
|
||||
* - check UDS_ALIGN[LEFT,RIGHT]...check that width of buddy window is decreased
|
||||
* - check that UDS_SETBUDDYINT sets the caption of the buddy window when it is changed
|
||||
* - check that the thousands operator is set for large numbers
|
||||
|
@ -165,6 +164,32 @@ static const struct message test_updown_pos_nochange_seq[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const struct message test_updown_pos_notifications_seq[] = {
|
||||
{ WM_CTLCOLOREDIT, sent|optional },
|
||||
{ WM_COMMAND, sent|wparam, MAKELONG(0, EN_SETFOCUS) },
|
||||
{ WM_NOTIFY, sent|id, 0, 0, UDN_DELTAPOS },
|
||||
{ WM_COMMAND, sent|wparam, MAKELONG(0, EN_UPDATE) },
|
||||
{ WM_COMMAND, sent|wparam, MAKELONG(0, EN_CHANGE) },
|
||||
{ WM_VSCROLL, sent|wparam, MAKELONG(SB_THUMBPOSITION, 51) },
|
||||
{ WM_CTLCOLOREDIT, sent|optional },
|
||||
{ WM_VSCROLL, sent|wparam, MAKELONG(SB_ENDSCROLL, 51) },
|
||||
/* no WM_NOTIFY(NM_RELEASEDCAPTURE) message */
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static const struct message test_updown_pos_notifications_horz_seq[] = {
|
||||
{ WM_CTLCOLOREDIT, sent|optional },
|
||||
{ WM_COMMAND, sent|wparam, MAKELONG(0, EN_SETFOCUS) },
|
||||
{ WM_NOTIFY, sent|id, 0, 0, UDN_DELTAPOS },
|
||||
{ WM_COMMAND, sent|wparam, MAKELONG(0, EN_UPDATE) },
|
||||
{ WM_COMMAND, sent|wparam, MAKELONG(0, EN_CHANGE) },
|
||||
{ WM_HSCROLL, sent|wparam, MAKELONG(SB_THUMBPOSITION, 51) },
|
||||
{ WM_CTLCOLOREDIT, sent|optional },
|
||||
{ WM_HSCROLL, sent|wparam, MAKELONG(SB_ENDSCROLL, 51) },
|
||||
/* no WM_NOTIFY(NM_RELEASEDCAPTURE) message */
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static LONG defwndproc_counter = 0;
|
||||
|
@ -186,6 +211,8 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
|
|||
if (defwndproc_counter) msg.flags |= defwinproc;
|
||||
msg.wParam = wParam;
|
||||
msg.lParam = lParam;
|
||||
if (message == WM_NOTIFY && lParam)
|
||||
msg.id = ((NMHDR*)lParam)->code;
|
||||
add_message(sequences, PARENT_SEQ_INDEX, &msg);
|
||||
}
|
||||
|
||||
|
@ -900,6 +927,52 @@ static void test_CreateUpDownControl(void)
|
|||
DestroyWindow(updown);
|
||||
}
|
||||
|
||||
static void test_updown_pos_notifications(void)
|
||||
{
|
||||
HWND updown;
|
||||
RECT rect;
|
||||
UINT x, y;
|
||||
int result;
|
||||
|
||||
/* test updown control notifications without UDS_HORZ style */
|
||||
updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT, g_edit);
|
||||
SetFocus(updown);
|
||||
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||
|
||||
/* click on the up-arrow button */
|
||||
GetClientRect(updown, &rect);
|
||||
x = rect.left + (rect.right - rect.left) / 2;
|
||||
y = rect.top + (rect.bottom - rect.top) / 4;
|
||||
result = SendMessageA(updown, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
|
||||
expect(result, 0);
|
||||
result = SendMessageA(updown, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
|
||||
expect(result, 0);
|
||||
|
||||
ok_sequence(sequences, PARENT_SEQ_INDEX, test_updown_pos_notifications_seq,
|
||||
"test updown to parent notify (vertical)", FALSE);
|
||||
|
||||
DestroyWindow(updown);
|
||||
|
||||
/* test updown control notifications with UDS_HORZ style */
|
||||
updown = create_updown_control(UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_HORZ, g_edit);
|
||||
SetFocus(updown);
|
||||
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||
|
||||
/* click on the right-arrow button */
|
||||
GetClientRect(updown, &rect);
|
||||
x = rect.left + (rect.right - rect.left) * 3 / 4;
|
||||
y = rect.top + (rect.bottom - rect.top) / 2;
|
||||
result = SendMessageA(updown, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y));
|
||||
expect(result, 0);
|
||||
result = SendMessageA(updown, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
|
||||
expect(result, 0);
|
||||
|
||||
ok_sequence(sequences, PARENT_SEQ_INDEX, test_updown_pos_notifications_horz_seq,
|
||||
"test updown to parent notify (horizontal)", FALSE);
|
||||
|
||||
DestroyWindow(updown);
|
||||
}
|
||||
|
||||
static void init_functions(void)
|
||||
{
|
||||
HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
|
||||
|
@ -931,6 +1004,7 @@ START_TEST(updown)
|
|||
test_updown_unicode();
|
||||
test_UDS_SETBUDDYINT();
|
||||
test_CreateUpDownControl();
|
||||
test_updown_pos_notifications();
|
||||
|
||||
DestroyWindow(g_edit);
|
||||
DestroyWindow(parent_wnd);
|
||||
|
|
|
@ -5733,7 +5733,10 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
TOOLBAR_SendNotify(&hdr, infoPtr, TBN_TOOLBARCHANGE);
|
||||
}
|
||||
else if (infoPtr->nButtonDown >= 0) {
|
||||
else if (infoPtr->nButtonDown >= 0)
|
||||
{
|
||||
BOOL was_clicked = nHit == infoPtr->nButtonDown;
|
||||
|
||||
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
|
||||
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
||||
|
||||
|
@ -5775,7 +5778,7 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
|||
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
|
||||
TBN_ENDDRAG);
|
||||
|
||||
if (btnPtr->fsState & TBSTATE_ENABLED)
|
||||
if (was_clicked && btnPtr->fsState & TBSTATE_ENABLED)
|
||||
{
|
||||
SendMessageW (infoPtr->hwndNotify, WM_COMMAND,
|
||||
MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)infoPtr->hwndSelf);
|
||||
|
|
|
@ -1660,6 +1660,13 @@ TOOLTIPS_SetToolInfoT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
|||
toolPtr->rect = ti->rect;
|
||||
toolPtr->hinst = ti->hinst;
|
||||
|
||||
if ( (toolPtr->lpszText) &&
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) ) {
|
||||
if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
}
|
||||
|
||||
if (IS_INTRESOURCE(ti->lpszText)) {
|
||||
TRACE("set string id %x\n", LOWORD(ti->lpszText));
|
||||
toolPtr->lpszText = ti->lpszText;
|
||||
|
@ -1668,12 +1675,6 @@ TOOLTIPS_SetToolInfoT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
|
|||
if (ti->lpszText == LPSTR_TEXTCALLBACKW)
|
||||
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
|
||||
else {
|
||||
if ( (toolPtr->lpszText) &&
|
||||
!IS_INTRESOURCE(toolPtr->lpszText) ) {
|
||||
if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
|
||||
Free (toolPtr->lpszText);
|
||||
toolPtr->lpszText = NULL;
|
||||
}
|
||||
if (ti->lpszText) {
|
||||
if (isW) {
|
||||
INT len = lstrlenW (ti->lpszText);
|
||||
|
|
|
@ -1481,15 +1481,18 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr)
|
|||
|
||||
infoPtr->uThumbLen = get_scaled_metric(infoPtr, infoPtr->dwStyle & TBS_ENABLESELRANGE ? 23 : 21);
|
||||
|
||||
GetClientRect(infoPtr->hwndSelf,&rect);
|
||||
if (infoPtr->dwStyle & TBS_VERT)
|
||||
client_size = rect.right - rect.left;
|
||||
else
|
||||
client_size = rect.bottom - rect.top;
|
||||
if (!(infoPtr->dwStyle & TBS_FIXEDLENGTH))
|
||||
{
|
||||
GetClientRect(infoPtr->hwndSelf, &rect);
|
||||
if (infoPtr->dwStyle & TBS_VERT)
|
||||
client_size = rect.right - rect.left;
|
||||
else
|
||||
client_size = rect.bottom - rect.top;
|
||||
|
||||
if (client_size < infoPtr->uThumbLen)
|
||||
infoPtr->uThumbLen = client_size > get_scaled_metric(infoPtr, 9) ?
|
||||
client_size - get_scaled_metric(infoPtr, 5) : get_scaled_metric(infoPtr, 4);
|
||||
if (client_size < infoPtr->uThumbLen)
|
||||
infoPtr->uThumbLen = client_size > get_scaled_metric(infoPtr, 9) ?
|
||||
client_size - get_scaled_metric(infoPtr, 5) : get_scaled_metric(infoPtr, 4);
|
||||
}
|
||||
|
||||
TRACKBAR_CalcChannel (infoPtr);
|
||||
TRACKBAR_UpdateThumb (infoPtr);
|
||||
|
|
|
@ -758,7 +758,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item,
|
|||
else {
|
||||
int len = max(lstrlenW(callback.item.pszText) + 1,
|
||||
TEXT_CALLBACK_SIZE);
|
||||
LPWSTR newText = heap_realloc(item->pszText, len);
|
||||
LPWSTR newText = heap_realloc(item->pszText, len*sizeof(WCHAR));
|
||||
|
||||
TRACE("returned wstr %s, len=%d\n",
|
||||
debugstr_w(callback.item.pszText), len);
|
||||
|
@ -3971,6 +3971,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
|
|||
infoPtr->wpEditOrig = (WNDPROC)SetWindowLongPtrW(hwndEdit, GWLP_WNDPROC,
|
||||
(DWORD_PTR)
|
||||
TREEVIEW_Edit_SubclassProc);
|
||||
SendMessageW(hwndEdit, EM_SETLIMITTEXT, MAX_PATH - 1, 0);
|
||||
if (hItem->pszText)
|
||||
SetWindowTextW(hwndEdit, hItem->pszText);
|
||||
|
||||
|
@ -3996,8 +3997,8 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
|
|||
TREEVIEW_ITEM *editedItem = infoPtr->editItem;
|
||||
NMTVDISPINFOW tvdi;
|
||||
BOOL bCommit;
|
||||
WCHAR tmpText[1024] = { '\0' };
|
||||
WCHAR *newText = tmpText;
|
||||
WCHAR tmpText[MAX_PATH] = { '\0' };
|
||||
WCHAR *newText;
|
||||
int iLength = 0;
|
||||
|
||||
if (!IsWindow(infoPtr->hwndEdit)) return FALSE;
|
||||
|
@ -4010,18 +4011,13 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
|
|||
if (!bCancel)
|
||||
{
|
||||
if (!infoPtr->bNtfUnicode)
|
||||
iLength = GetWindowTextA(infoPtr->hwndEdit, (LPSTR)tmpText, 1023);
|
||||
iLength = GetWindowTextA(infoPtr->hwndEdit, (LPSTR)tmpText, ARRAY_SIZE(tmpText));
|
||||
else
|
||||
iLength = GetWindowTextW(infoPtr->hwndEdit, tmpText, 1023);
|
||||
|
||||
if (iLength >= 1023)
|
||||
{
|
||||
ERR("Insufficient space to retrieve new item label\n");
|
||||
}
|
||||
iLength = GetWindowTextW(infoPtr->hwndEdit, tmpText, ARRAY_SIZE(tmpText));
|
||||
|
||||
tvdi.item.mask = TVIF_TEXT;
|
||||
tvdi.item.pszText = tmpText;
|
||||
tvdi.item.cchTextMax = iLength + 1;
|
||||
tvdi.item.cchTextMax = ARRAY_SIZE(tmpText);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4035,11 +4031,13 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
|
|||
{
|
||||
if (!infoPtr->bNtfUnicode)
|
||||
{
|
||||
DWORD len = MultiByteToWideChar( CP_ACP, 0, (LPSTR)tmpText, -1, NULL, 0 );
|
||||
DWORD len = MultiByteToWideChar( CP_ACP, 0, (LPSTR)tvdi.item.pszText, -1, NULL, 0 );
|
||||
newText = heap_alloc(len * sizeof(WCHAR));
|
||||
MultiByteToWideChar( CP_ACP, 0, (LPSTR)tmpText, -1, newText, len );
|
||||
MultiByteToWideChar( CP_ACP, 0, (LPSTR)tvdi.item.pszText, -1, newText, len );
|
||||
iLength = len - 1;
|
||||
}
|
||||
else
|
||||
newText = tvdi.item.pszText;
|
||||
|
||||
if (strcmpW(newText, editedItem->pszText) != 0)
|
||||
{
|
||||
|
|
|
@ -781,14 +781,8 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
|
|||
KillTimer (infoPtr->Self, TIMER_ACCEL);
|
||||
KillTimer (infoPtr->Self, TIMER_AUTOPRESS);
|
||||
|
||||
if (GetCapture() == infoPtr->Self) {
|
||||
NMHDR hdr;
|
||||
hdr.hwndFrom = infoPtr->Self;
|
||||
hdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
|
||||
hdr.code = NM_RELEASEDCAPTURE;
|
||||
SendMessageW(infoPtr->Notify, WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr);
|
||||
if (GetCapture() == infoPtr->Self)
|
||||
ReleaseCapture();
|
||||
}
|
||||
|
||||
infoPtr->Flags &= ~FLAG_PRESSED;
|
||||
InvalidateRect (infoPtr->Self, NULL, FALSE);
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef struct dispensermanager
|
|||
{
|
||||
IDispenserManager IDispenserManager_iface;
|
||||
LONG ref;
|
||||
|
||||
HANDLE mta_thread, mta_stop_event;
|
||||
} dispensermanager;
|
||||
|
||||
typedef struct holder
|
||||
|
@ -264,12 +264,27 @@ static ULONG WINAPI dismanager_Release(IDispenserManager *iface)
|
|||
|
||||
if (!ref)
|
||||
{
|
||||
heap_free(This);
|
||||
if (This->mta_thread)
|
||||
{
|
||||
SetEvent(This->mta_stop_event);
|
||||
WaitForSingleObject(This->mta_thread, INFINITE);
|
||||
CloseHandle(This->mta_stop_event);
|
||||
CloseHandle(This->mta_thread);
|
||||
}
|
||||
heap_free(This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static DWORD WINAPI mta_thread_proc(void *arg)
|
||||
{
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
WaitForSingleObject(arg, INFINITE);
|
||||
CoUninitialize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dismanager_RegisterDispenser(IDispenserManager *iface, IDispenserDriver *driver,
|
||||
LPCOLESTR name, IHolder **dispenser)
|
||||
{
|
||||
|
@ -283,6 +298,12 @@ static HRESULT WINAPI dismanager_RegisterDispenser(IDispenserManager *iface, IDi
|
|||
|
||||
hr = create_holder(driver, dispenser);
|
||||
|
||||
if (!This->mta_thread)
|
||||
{
|
||||
This->mta_stop_event = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||
This->mta_thread = CreateThread(NULL, 0, mta_thread_proc, This->mta_stop_event, 0, NULL);
|
||||
}
|
||||
|
||||
TRACE("<-- 0x%08x, %p\n", hr, *dispenser);
|
||||
|
||||
return hr;
|
||||
|
@ -313,7 +334,7 @@ static HRESULT WINAPI comsvcscf_CreateInstance(IClassFactory *cf,IUnknown* outer
|
|||
|
||||
TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), object);
|
||||
|
||||
dismanager = heap_alloc(sizeof(*dismanager));
|
||||
dismanager = heap_alloc_zero(sizeof(*dismanager));
|
||||
if (!dismanager)
|
||||
{
|
||||
*object = NULL;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "winbase.h"
|
||||
#include "ole2.h"
|
||||
#include "comsvcs.h"
|
||||
#include "msxml.h"
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
|
@ -141,6 +142,17 @@ static const struct IDispenserDriverVtbl driver_vtbl =
|
|||
|
||||
static IDispenserDriver DispenserDriver = { &driver_vtbl };
|
||||
|
||||
static DWORD WINAPI com_thread(void *arg)
|
||||
{
|
||||
IUnknown *unk;
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_XMLDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
|
||||
if (hr == S_OK) IUnknown_Release(unk);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static void create_dispenser(void)
|
||||
{
|
||||
static const WCHAR pool0[] = {'S','C','.','P','o','o','l',' ','0',' ','0',0};
|
||||
|
@ -149,7 +161,9 @@ static void create_dispenser(void)
|
|||
HRESULT hr;
|
||||
IDispenserManager *dispenser = NULL;
|
||||
IHolder *holder1 = NULL, *holder2 = NULL, *holder3 = NULL;
|
||||
HANDLE thread;
|
||||
RESID resid;
|
||||
DWORD ret;
|
||||
BSTR str;
|
||||
|
||||
hr = CoCreateInstance( &CLSID_DispenserManager, NULL, CLSCTX_ALL, &IID_IDispenserManager, (void**)&dispenser);
|
||||
|
@ -160,9 +174,22 @@ static void create_dispenser(void)
|
|||
return;
|
||||
}
|
||||
|
||||
thread = CreateThread(NULL, 0, com_thread, NULL, 0, NULL);
|
||||
ok(!WaitForSingleObject(thread, 1000), "wait failed\n");
|
||||
GetExitCodeThread(thread, &ret);
|
||||
ok(ret == CO_E_NOTINITIALIZED, "got unexpected hr %#x\n", ret);
|
||||
|
||||
hr = IDispenserManager_RegisterDispenser(dispenser, &DispenserDriver, pool0, &holder1);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
||||
/* The above call creates an MTA thread, but we need to wait for it to
|
||||
* actually initialize. */
|
||||
Sleep(200);
|
||||
thread = CreateThread(NULL, 0, com_thread, NULL, 0, NULL);
|
||||
ok(!WaitForSingleObject(thread, 1000), "wait failed\n");
|
||||
GetExitCodeThread(thread, &ret);
|
||||
ok(ret == S_OK, "got unexpected hr %#x\n", ret);
|
||||
|
||||
hr = IDispenserManager_RegisterDispenser(dispenser, &DispenserDriver, pool0, &holder2);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(holder1 != holder2, "same holder object returned\n");
|
||||
|
|
|
@ -468,7 +468,7 @@
|
|||
@ stub -arch=win64 ?_TryAcquireWrite@_ReaderWriterLock@details@Concurrency@@QEAA_NXZ
|
||||
@ stub ?_UnderlyingYield@details@Concurrency@@YAXXZ
|
||||
@ cdecl ?_Value@_SpinCount@details@Concurrency@@SAIXZ() msvcr120.?_Value@_SpinCount@details@Concurrency@@SAIXZ
|
||||
@ stub ?_Yield@_Context@details@Concurrency@@SAXXZ
|
||||
@ cdecl ?_Yield@_Context@details@Concurrency@@SAXXZ() msvcr120.?_Yield@_Context@details@Concurrency@@SAXXZ
|
||||
@ stub -arch=i386 ?cancel@agent@Concurrency@@QAE_NXZ
|
||||
@ stub -arch=win64 ?cancel@agent@Concurrency@@QEAA_NXZ
|
||||
@ stub ?current@location@Concurrency@@SA?AV12@XZ
|
||||
|
|
|
@ -683,6 +683,13 @@ static BOOL CRYPT_AsnDecodeArray(const struct AsnArrayDescriptor *arrayDesc,
|
|||
&itemDecoded);
|
||||
if (ret)
|
||||
{
|
||||
/* Ignore an item that failed to decode but the decoder doesn't want to fail the whole process */
|
||||
if (!size)
|
||||
{
|
||||
ptr += itemEncoded;
|
||||
continue;
|
||||
}
|
||||
|
||||
cItems++;
|
||||
if (itemSizes != &itemSize)
|
||||
itemSizes = CryptMemRealloc(itemSizes,
|
||||
|
@ -5631,6 +5638,25 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSSignerInfo(DWORD dwCertEncodingType,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL verify_and_copy_certificate(const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
|
||||
void *pvStructInfo, DWORD *pcbStructInfo, DWORD *pcbDecoded)
|
||||
{
|
||||
PCCERT_CONTEXT cert;
|
||||
|
||||
cert = CertCreateCertificateContext(X509_ASN_ENCODING, pbEncoded, cbEncoded);
|
||||
if (!cert)
|
||||
{
|
||||
WARN("CertCreateCertificateContext error %#x\n", GetLastError());
|
||||
*pcbStructInfo = 0;
|
||||
*pcbDecoded = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CertFreeCertificateContext(cert);
|
||||
|
||||
return CRYPT_AsnDecodeCopyBytes(pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo, pcbDecoded);
|
||||
}
|
||||
|
||||
static BOOL CRYPT_AsnDecodeCMSCertEncoded(const BYTE *pbEncoded,
|
||||
DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo,
|
||||
DWORD *pcbDecoded)
|
||||
|
@ -5640,7 +5666,7 @@ static BOOL CRYPT_AsnDecodeCMSCertEncoded(const BYTE *pbEncoded,
|
|||
offsetof(CRYPT_SIGNED_INFO, cCertEncoded),
|
||||
offsetof(CRYPT_SIGNED_INFO, rgCertEncoded),
|
||||
MEMBERSIZE(CRYPT_SIGNED_INFO, cCertEncoded, cCrlEncoded),
|
||||
CRYPT_AsnDecodeCopyBytes,
|
||||
verify_and_copy_certificate,
|
||||
sizeof(CRYPT_DER_BLOB), TRUE, offsetof(CRYPT_DER_BLOB, pbData) };
|
||||
|
||||
TRACE("%p, %d, %08x, %p, %d, %p\n", pbEncoded, cbEncoded, dwFlags,
|
||||
|
|
|
@ -3648,9 +3648,15 @@ static UINT STDMETHODCALLTYPE d3d11_device_GetExceptionMode(ID3D11Device2 *iface
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *iface, ID3D11DeviceContext1 **context)
|
||||
static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *iface,
|
||||
ID3D11DeviceContext1 **immediate_context)
|
||||
{
|
||||
FIXME("iface %p, context %p stub!\n", iface, context);
|
||||
struct d3d_device *device = impl_from_ID3D11Device2(iface);
|
||||
|
||||
TRACE("iface %p, immediate_context %p.\n", iface, immediate_context);
|
||||
|
||||
*immediate_context = &device->immediate_context.ID3D11DeviceContext1_iface;
|
||||
ID3D11DeviceContext1_AddRef(*immediate_context);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Device2 *iface, UINT flags,
|
||||
|
|
|
@ -6439,12 +6439,7 @@ static void test_device_context_state(void)
|
|||
|
||||
feature_level = ID3D11Device1_GetFeatureLevel(device);
|
||||
ID3D11Device1_GetImmediateContext1(device, &context);
|
||||
todo_wine ok(!!context, "Failed to get immediate context.\n");
|
||||
if (!context)
|
||||
{
|
||||
ID3D11Device1_Release(device);
|
||||
return;
|
||||
}
|
||||
ok(!!context, "Failed to get immediate context.\n");
|
||||
|
||||
sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
|
||||
sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
|
@ -6471,7 +6466,14 @@ static void test_device_context_state(void)
|
|||
feature_level = min(feature_level, D3D_FEATURE_LEVEL_10_1);
|
||||
hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION,
|
||||
&IID_ID3D10Device, NULL, &context_state);
|
||||
todo_wine
|
||||
ok(SUCCEEDED(hr), "Failed to create device context state, hr %#x.\n", hr);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ID3D11SamplerState_Release(sampler);
|
||||
ID3D11Device1_Release(device);
|
||||
return;
|
||||
}
|
||||
refcount = get_refcount(context_state);
|
||||
ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);
|
||||
|
||||
|
|
|
@ -56,9 +56,10 @@ static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface)
|
|||
{
|
||||
IDirect3DDevice8_AddRef(buffer->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_incref(buffer->draw_buffer);
|
||||
else
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -78,9 +79,10 @@ static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface)
|
|||
IDirect3DDevice8 *device = buffer->parent_device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
if (draw_buffer)
|
||||
wined3d_buffer_decref(draw_buffer);
|
||||
else
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -266,6 +268,9 @@ static const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl =
|
|||
static void STDMETHODCALLTYPE d3d8_vertexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
struct d3d8_vertexbuffer *buffer = parent;
|
||||
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
d3d8_resource_cleanup(&buffer->resource);
|
||||
heap_free(buffer);
|
||||
}
|
||||
|
@ -377,9 +382,10 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface)
|
|||
{
|
||||
IDirect3DDevice8_AddRef(buffer->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_incref(buffer->draw_buffer);
|
||||
else
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -399,9 +405,10 @@ static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface)
|
|||
IDirect3DDevice8 *device = buffer->parent_device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
if (draw_buffer)
|
||||
wined3d_buffer_decref(draw_buffer);
|
||||
else
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -586,6 +593,9 @@ static const IDirect3DIndexBuffer8Vtbl d3d8_indexbuffer_vtbl =
|
|||
static void STDMETHODCALLTYPE d3d8_indexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
struct d3d8_indexbuffer *buffer = parent;
|
||||
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
d3d8_resource_cleanup(&buffer->resource);
|
||||
heap_free(buffer);
|
||||
}
|
||||
|
|
|
@ -60,16 +60,16 @@ IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
|
|||
* ValidateVertexShader (D3D8.@)
|
||||
*
|
||||
* I've seen reserved1 and reserved2 always passed as 0's
|
||||
* bool seems always passed as 0 or 1, but other values work as well...
|
||||
* boolean seems always passed as 0 or 1, but other values work as well...
|
||||
* toto result?
|
||||
*/
|
||||
HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
|
||||
HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL boolean, DWORD* toto)
|
||||
{
|
||||
HRESULT ret;
|
||||
static BOOL warned;
|
||||
|
||||
if (TRACE_ON(d3d8) || !warned) {
|
||||
FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
|
||||
FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, boolean, toto);
|
||||
warned = TRUE;
|
||||
}
|
||||
|
||||
|
@ -98,13 +98,13 @@ HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD
|
|||
* PARAMS
|
||||
* toto result?
|
||||
*/
|
||||
HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
|
||||
HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL boolean, DWORD* toto)
|
||||
{
|
||||
HRESULT ret;
|
||||
static BOOL warned;
|
||||
|
||||
if (TRACE_ON(d3d8) || !warned) {
|
||||
FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
|
||||
FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, boolean, toto);
|
||||
warned = TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -2423,9 +2423,9 @@ static HRESULT WINAPI d3d8_device_DrawPrimitiveUP(IDirect3DDevice8 *iface,
|
|||
TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
|
||||
iface, primitive_type, primitive_count, data, stride);
|
||||
|
||||
if (!primitive_count)
|
||||
if (!primitive_count || !stride)
|
||||
{
|
||||
WARN("primitive_count is 0, returning D3D_OK\n");
|
||||
WARN("primitive_count or stride is 0, returning D3D_OK.\n");
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
@ -2523,9 +2523,9 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface
|
|||
iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
|
||||
index_data, index_format, vertex_data, vertex_stride);
|
||||
|
||||
if (!primitive_count)
|
||||
if (!primitive_count || !vertex_stride)
|
||||
{
|
||||
WARN("primitive_count is 0, returning D3D_OK\n");
|
||||
WARN("primitive_count or vertex_stride is 0, returning D3D_OK.\n");
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -241,10 +241,11 @@ static HRESULT WINAPI d3d8_CheckDeviceFormat(IDirect3D8 *iface, UINT adapter, D3
|
|||
TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n",
|
||||
iface, adapter, device_type, adapter_format, usage, resource_type, format);
|
||||
|
||||
if (!adapter_format)
|
||||
if (adapter_format != D3DFMT_X8R8G8B8 && adapter_format != D3DFMT_R5G6B5
|
||||
&& adapter_format != D3DFMT_X1R5G5B5)
|
||||
{
|
||||
WARN("Invalid adapter format.\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
return adapter_format ? D3DERR_NOTAVAILABLE : D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
bind_flags = wined3d_bind_flags_from_d3d8_usage(usage);
|
||||
|
|
|
@ -3055,6 +3055,7 @@ static void test_wndproc(void)
|
|||
ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it.\n",
|
||||
expect_messages->message, expect_messages->window);
|
||||
expect_messages = NULL;
|
||||
flush_events();
|
||||
SetForegroundWindow(GetDesktopWindow());
|
||||
flush_events();
|
||||
|
||||
|
@ -9208,6 +9209,198 @@ static void test_resource_access(void)
|
|||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
static void test_draw_primitive(void)
|
||||
{
|
||||
static const struct
|
||||
{
|
||||
float position[3];
|
||||
DWORD color;
|
||||
}
|
||||
quad[] =
|
||||
{
|
||||
{{-1.0f, -1.0f, 0.0f}, 0xffff0000},
|
||||
{{-1.0f, 1.0f, 0.0f}, 0xffff0000},
|
||||
{{ 1.0f, 1.0f, 0.0f}, 0xffff0000},
|
||||
{{ 1.0f, -1.0f, 0.0f}, 0xffff0000},
|
||||
{{-1.0f, -1.0f, 0.0f}, 0xffff0000},
|
||||
};
|
||||
static const WORD indices[] = {0, 1, 2, 3, 0, 2};
|
||||
|
||||
IDirect3DVertexBuffer8 *vertex_buffer, *current_vb;
|
||||
IDirect3DIndexBuffer8 *index_buffer, *current_ib;
|
||||
UINT stride, base_vertex_index;
|
||||
IDirect3DDevice8 *device;
|
||||
DWORD stateblock;
|
||||
IDirect3D8 *d3d;
|
||||
ULONG refcount;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
BYTE *ptr;
|
||||
|
||||
window = create_window();
|
||||
d3d = Direct3DCreate8(D3D_SDK_VERSION);
|
||||
ok(!!d3d, "Failed to create a D3D object.\n");
|
||||
if (!(device = create_device(d3d, window, NULL)))
|
||||
{
|
||||
skip("Failed to create a D3D device.\n");
|
||||
IDirect3D8_Release(d3d);
|
||||
DestroyWindow(window);
|
||||
return;
|
||||
}
|
||||
|
||||
hr = IDirect3DDevice8_CreateVertexBuffer(device, sizeof(quad), 0, 0,
|
||||
D3DPOOL_DEFAULT, &vertex_buffer);
|
||||
ok(SUCCEEDED(hr), "CreateVertexBuffer failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DVertexBuffer8_Lock(vertex_buffer, 0, 0, &ptr, D3DLOCK_DISCARD);
|
||||
ok(SUCCEEDED(hr), "Lock failed, hr %#x.\n", hr);
|
||||
memcpy(ptr, quad, sizeof(quad));
|
||||
hr = IDirect3DVertexBuffer8_Unlock(vertex_buffer);
|
||||
ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_SetStreamSource(device, 0, vertex_buffer, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "SetStreamSource failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_CreateIndexBuffer(device, sizeof(indices), 0, D3DFMT_INDEX16,
|
||||
D3DPOOL_DEFAULT, &index_buffer);
|
||||
ok(SUCCEEDED(hr), "CreateIndexBuffer failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DIndexBuffer8_Lock(index_buffer, 0, 0, &ptr, D3DLOCK_DISCARD);
|
||||
ok(SUCCEEDED(hr), "Lock failed, hr %#x.\n", hr);
|
||||
memcpy(ptr, indices, sizeof(indices));
|
||||
hr = IDirect3DIndexBuffer8_Unlock(index_buffer);
|
||||
ok(SUCCEEDED(hr), "Unlock failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE);
|
||||
ok(SUCCEEDED(hr), "SetRenderState D3DRS_LIGHTING failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_BeginScene(device);
|
||||
ok(SUCCEEDED(hr), "BeginScene failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, 2);
|
||||
ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetStreamSource(device, 0, ¤t_vb, &stride);
|
||||
ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr);
|
||||
ok(current_vb == vertex_buffer, "Unexpected vb %p.\n", current_vb);
|
||||
ok(stride == sizeof(*quad), "Unexpected stride %u.\n", stride);
|
||||
IDirect3DVertexBuffer8_Release(current_vb);
|
||||
|
||||
hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, 0);
|
||||
ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, sizeof(*quad));
|
||||
ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "DrawPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetStreamSource(device, 0, ¤t_vb, &stride);
|
||||
ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr);
|
||||
ok(!current_vb, "Unexpected vb %p.\n", current_vb);
|
||||
ok(!stride, "Unexpected stride %u.\n", stride);
|
||||
|
||||
/* NULL index buffer, NULL stream source. */
|
||||
hr = IDirect3DDevice8_SetIndices(device, NULL, 0);
|
||||
ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
todo_wine ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr);
|
||||
|
||||
/* Valid index buffer, NULL stream source. */
|
||||
hr = IDirect3DDevice8_SetIndices(device, index_buffer, 1);
|
||||
ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetIndices(device, ¤t_ib, &base_vertex_index);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
ok(current_ib == index_buffer, "Unexpected index buffer %p.\n", current_ib);
|
||||
ok(base_vertex_index == 1, "Unexpected base vertex index %u.\n", base_vertex_index);
|
||||
IDirect3DIndexBuffer8_Release(current_ib);
|
||||
|
||||
hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 0,
|
||||
indices, D3DFMT_INDEX16, quad, 0);
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2,
|
||||
indices, D3DFMT_INDEX16, quad, 0);
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2,
|
||||
indices, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetIndices(device, ¤t_ib, &base_vertex_index);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
ok(!current_ib, "Unexpected index buffer %p.\n", current_ib);
|
||||
ok(!base_vertex_index, "Unexpected base vertex index %u.\n", base_vertex_index);
|
||||
|
||||
/* Resetting of stream source and index buffer is not recorded in stateblocks. */
|
||||
|
||||
hr = IDirect3DDevice8_SetStreamSource(device, 0, vertex_buffer, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "SetStreamSource failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_SetIndices(device, index_buffer, 1);
|
||||
ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_BeginStateBlock(device);
|
||||
ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2,
|
||||
indices, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_EndStateBlock(device, &stateblock);
|
||||
ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetStreamSource(device, 0, ¤t_vb, &stride);
|
||||
ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr);
|
||||
todo_wine {
|
||||
ok(!current_vb, "Unexpected vb %p.\n", current_vb);
|
||||
ok(!stride, "Unexpected stride %u.\n", stride);
|
||||
}
|
||||
if (current_vb)
|
||||
IDirect3DVertexBuffer8_Release(current_vb);
|
||||
hr = IDirect3DDevice8_GetIndices(device, ¤t_ib, &base_vertex_index);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
todo_wine {
|
||||
ok(!current_ib, "Unexpected index buffer %p.\n", current_ib);
|
||||
ok(!base_vertex_index, "Unexpected base vertex index %u.\n", base_vertex_index);
|
||||
}
|
||||
if (current_ib)
|
||||
IDirect3DIndexBuffer8_Release(current_ib);
|
||||
|
||||
hr = IDirect3DDevice8_CaptureStateBlock(device, stateblock);
|
||||
ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_SetStreamSource(device, 0, vertex_buffer, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "SetStreamSource failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice8_SetIndices(device, index_buffer, 1);
|
||||
ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_ApplyStateBlock(device, stateblock);
|
||||
ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_GetStreamSource(device, 0, ¤t_vb, &stride);
|
||||
ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr);
|
||||
ok(current_vb == vertex_buffer, "Unexpected vb %p.\n", current_vb);
|
||||
ok(stride == sizeof(*quad), "Unexpected stride %u.\n", stride);
|
||||
IDirect3DVertexBuffer8_Release(current_vb);
|
||||
hr = IDirect3DDevice8_GetIndices(device, ¤t_ib, &base_vertex_index);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
ok(current_ib == index_buffer, "Unexpected index buffer %p.\n", current_ib);
|
||||
ok(base_vertex_index == 1, "Unexpected base vertex index %u.\n", base_vertex_index);
|
||||
IDirect3DIndexBuffer8_Release(current_ib);
|
||||
|
||||
hr = IDirect3DDevice8_EndScene(device);
|
||||
ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr);
|
||||
|
||||
IDirect3DDevice8_DeleteStateBlock(device, stateblock);
|
||||
IDirect3DVertexBuffer8_Release(vertex_buffer);
|
||||
IDirect3DIndexBuffer8_Release(index_buffer);
|
||||
refcount = IDirect3DDevice8_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
IDirect3D8_Release(d3d);
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
START_TEST(device)
|
||||
{
|
||||
HMODULE d3d8_handle = GetModuleHandleA("d3d8.dll");
|
||||
|
@ -9321,6 +9514,7 @@ START_TEST(device)
|
|||
test_device_caps();
|
||||
test_get_info();
|
||||
test_resource_access();
|
||||
test_draw_primitive();
|
||||
|
||||
UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL));
|
||||
}
|
||||
|
|
|
@ -7746,13 +7746,19 @@ static void test_vshader_input(void)
|
|||
{{ 0.0f, 0.0f, 0.1f}, 0x00ff8040},
|
||||
{{ 1.0f, -1.0f, 0.1f}, 0x00ff8040},
|
||||
{{ 1.0f, 0.0f, 0.1f}, 0x00ff8040},
|
||||
},
|
||||
};
|
||||
static const struct
|
||||
{
|
||||
struct vec3 position;
|
||||
struct vec3 dummy; /* testing D3DVSD_SKIP */
|
||||
DWORD diffuse;
|
||||
}
|
||||
quad3_color[] =
|
||||
{
|
||||
{{-1.0f, 0.0f, 0.1f}, 0x00ff8040},
|
||||
{{-1.0f, 1.0f, 0.1f}, 0x00ff8040},
|
||||
{{ 0.0f, 0.0f, 0.1f}, 0x00ff8040},
|
||||
{{ 0.0f, 1.0f, 0.1f}, 0x00ff8040},
|
||||
{{-1.0f, 0.0f, 0.1f}, {0.0f}, 0x00ff8040},
|
||||
{{-1.0f, 1.0f, 0.1f}, {0.0f}, 0x00ff8040},
|
||||
{{ 0.0f, 0.0f, 0.1f}, {0.0f}, 0x00ff8040},
|
||||
{{ 0.0f, 1.0f, 0.1f}, {0.0f}, 0x00ff8040},
|
||||
};
|
||||
static const float quad4_color[] =
|
||||
{
|
||||
|
@ -7803,6 +7809,7 @@ static void test_vshader_input(void)
|
|||
{
|
||||
D3DVSD_STREAM(0),
|
||||
D3DVSD_REG(0, D3DVSDT_FLOAT3), /* position */
|
||||
D3DVSD_SKIP(3), /* not used */
|
||||
D3DVSD_REG(5, D3DVSDT_D3DCOLOR), /* diffuse */
|
||||
D3DVSD_END()
|
||||
};
|
||||
|
|
|
@ -294,8 +294,8 @@ static UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3
|
|||
|
||||
offset += wined3d_type_sizes[type];
|
||||
} else if (token_type == D3DVSD_TOKEN_STREAMDATA && (*token & D3DVSD_DATALOADTYPEMASK)) {
|
||||
TRACE(" 0x%08x SKIP(%u)\n", token_type, ((token_type & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT));
|
||||
offset += sizeof(DWORD) * ((token_type & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT);
|
||||
TRACE(" 0x%08x SKIP(%u)\n", *token, (*token & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT);
|
||||
offset += sizeof(DWORD) * ((*token & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT);
|
||||
}
|
||||
|
||||
if (element_count >= 127) {
|
||||
|
|
|
@ -58,9 +58,10 @@ static ULONG WINAPI d3d9_vertexbuffer_AddRef(IDirect3DVertexBuffer9 *iface)
|
|||
{
|
||||
IDirect3DDevice9Ex_AddRef(buffer->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_incref(buffer->draw_buffer);
|
||||
else
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -80,9 +81,10 @@ static ULONG WINAPI d3d9_vertexbuffer_Release(IDirect3DVertexBuffer9 *iface)
|
|||
IDirect3DDevice9Ex *device = buffer->parent_device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
if (draw_buffer)
|
||||
wined3d_buffer_decref(draw_buffer);
|
||||
else
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -267,6 +269,9 @@ static const IDirect3DVertexBuffer9Vtbl d3d9_vertexbuffer_vtbl =
|
|||
static void STDMETHODCALLTYPE d3d9_vertexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
struct d3d9_vertexbuffer *buffer = parent;
|
||||
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
d3d9_resource_cleanup(&buffer->resource);
|
||||
heap_free(buffer);
|
||||
}
|
||||
|
@ -384,9 +389,10 @@ static ULONG WINAPI d3d9_indexbuffer_AddRef(IDirect3DIndexBuffer9 *iface)
|
|||
{
|
||||
IDirect3DDevice9Ex_AddRef(buffer->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_incref(buffer->draw_buffer);
|
||||
else
|
||||
wined3d_buffer_incref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -406,9 +412,10 @@ static ULONG WINAPI d3d9_indexbuffer_Release(IDirect3DIndexBuffer9 *iface)
|
|||
IDirect3DDevice9Ex *device = buffer->parent_device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
if (draw_buffer)
|
||||
wined3d_buffer_decref(draw_buffer);
|
||||
else
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -591,6 +598,9 @@ static const IDirect3DIndexBuffer9Vtbl d3d9_indexbuffer_vtbl =
|
|||
static void STDMETHODCALLTYPE d3d9_indexbuffer_wined3d_object_destroyed(void *parent)
|
||||
{
|
||||
struct d3d9_indexbuffer *buffer = parent;
|
||||
|
||||
if (buffer->draw_buffer)
|
||||
wined3d_buffer_decref(buffer->wined3d_buffer);
|
||||
d3d9_resource_cleanup(&buffer->resource);
|
||||
heap_free(buffer);
|
||||
}
|
||||
|
|
|
@ -1757,6 +1757,9 @@ static HRESULT WINAPI d3d9_device_ColorFill(IDirect3DDevice9Ex *iface,
|
|||
|
||||
TRACE("iface %p, surface %p, rect %p, color 0x%08x.\n", iface, surface, rect, color);
|
||||
|
||||
if (!surface)
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
if (FAILED(wined3d_texture_get_sub_resource_desc(surface_impl->wined3d_texture,
|
||||
|
@ -2890,9 +2893,14 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface,
|
|||
TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
|
||||
iface, primitive_type, primitive_count, data, stride);
|
||||
|
||||
if (!stride)
|
||||
{
|
||||
WARN("stride is 0, returning D3DERR_INVALIDCALL.\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
if (!primitive_count)
|
||||
{
|
||||
WARN("primitive_count is 0, returning D3D_OK\n");
|
||||
WARN("primitive_count is 0, returning D3D_OK.\n");
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
@ -3001,6 +3009,11 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
|
|||
iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
|
||||
index_data, index_format, vertex_data, vertex_stride);
|
||||
|
||||
if (!vertex_stride)
|
||||
{
|
||||
WARN("vertex_stride is 0, returning D3DERR_INVALIDCALL.\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
if (!primitive_count)
|
||||
{
|
||||
WARN("primitive_count is 0, returning D3D_OK.\n");
|
||||
|
|
|
@ -254,10 +254,11 @@ static HRESULT WINAPI d3d9_CheckDeviceFormat(IDirect3D9Ex *iface, UINT adapter,
|
|||
TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n",
|
||||
iface, adapter, device_type, adapter_format, usage, resource_type, format);
|
||||
|
||||
if (!adapter_format)
|
||||
if (adapter_format != D3DFMT_X8R8G8B8 && adapter_format != D3DFMT_R5G6B5
|
||||
&& adapter_format != D3DFMT_X1R5G5B5)
|
||||
{
|
||||
WARN("Invalid adapter format.\n");
|
||||
return D3DERR_INVALIDCALL;
|
||||
return adapter_format ? D3DERR_NOTAVAILABLE : D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
bind_flags = wined3d_bind_flags_from_d3d9_usage(usage);
|
||||
|
|
|
@ -3078,6 +3078,7 @@ static void test_wndproc(void)
|
|||
"Expected IsIconic %u, got %u, i=%u.\n", tests[i].iconic, IsIconic(focus_window), i);
|
||||
|
||||
ShowWindow(focus_window, SW_SHOWNOACTIVATE);
|
||||
flush_events();
|
||||
ShowWindow(focus_window, SW_SHOWMINNOACTIVE);
|
||||
flush_events();
|
||||
|
||||
|
|
|
@ -2874,6 +2874,7 @@ static void test_draw_primitive(void)
|
|||
IDirect3DVertexBuffer9 *vertex_buffer, *current_vb;
|
||||
IDirect3DIndexBuffer9 *index_buffer, *current_ib;
|
||||
IDirect3DVertexDeclaration9 *vertex_declaration;
|
||||
IDirect3DStateBlock9 *stateblock;
|
||||
IDirect3DDevice9 *device;
|
||||
UINT offset, stride;
|
||||
IDirect3D9 *d3d9;
|
||||
|
@ -2975,6 +2976,11 @@ static void test_draw_primitive(void)
|
|||
hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, 2);
|
||||
ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, 0);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, quad, 0);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "DrawPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
|
@ -2998,16 +3004,88 @@ static void test_draw_primitive(void)
|
|||
0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */);
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_GetIndices(device, ¤t_ib);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
ok(current_ib == index_buffer, "Unexpected index buffer %p.\n", current_ib);
|
||||
IDirect3DIndexBuffer9_Release(current_ib);
|
||||
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2,
|
||||
indices, D3DFMT_INDEX16, quad, 0);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 0,
|
||||
indices, D3DFMT_INDEX16, quad, 0);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2,
|
||||
indices, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_GetIndices(device, ¤t_ib);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
ok(!current_ib, "Unexpected index buffer %p.\n", current_ib);
|
||||
|
||||
/* Resetting of stream source and index buffer is not recorded in stateblocks. */
|
||||
|
||||
hr = IDirect3DDevice9_SetStreamSource(device, 0, vertex_buffer, 0, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "SetStreamSource failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetIndices(device, index_buffer);
|
||||
ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginStateBlock(device);
|
||||
ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, 2,
|
||||
indices, D3DFMT_INDEX16, quad, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "DrawIndexedPrimitiveUP failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_EndStateBlock(device, &stateblock);
|
||||
ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_GetStreamSource(device, 0, ¤t_vb, &offset, &stride);
|
||||
ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr);
|
||||
todo_wine
|
||||
ok(!current_vb, "Unexpected vb %p.\n", current_vb);
|
||||
ok(!offset, "Unexpected offset %u.\n", offset);
|
||||
todo_wine
|
||||
ok(!stride, "Unexpected stride %u.\n", stride);
|
||||
if (current_vb)
|
||||
IDirect3DVertexBuffer9_Release(current_vb);
|
||||
hr = IDirect3DDevice9_GetIndices(device, ¤t_ib);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
todo_wine
|
||||
ok(!current_ib, "Unexpected index buffer %p.\n", current_ib);
|
||||
if (current_ib)
|
||||
IDirect3DIndexBuffer9_Release(current_ib);
|
||||
|
||||
hr = IDirect3DStateBlock9_Capture(stateblock);
|
||||
ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetStreamSource(device, 0, vertex_buffer, 0, sizeof(*quad));
|
||||
ok(SUCCEEDED(hr), "SetStreamSource failed, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetIndices(device, index_buffer);
|
||||
ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DStateBlock9_Apply(stateblock);
|
||||
ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_GetStreamSource(device, 0, ¤t_vb, &offset, &stride);
|
||||
ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr);
|
||||
ok(current_vb == vertex_buffer, "Unexpected vb %p.\n", current_vb);
|
||||
ok(!offset, "Unexpected offset %u.\n", offset);
|
||||
ok(stride == sizeof(*quad), "Unexpected stride %u.\n", stride);
|
||||
IDirect3DVertexBuffer9_Release(current_vb);
|
||||
hr = IDirect3DDevice9_GetIndices(device, ¤t_ib);
|
||||
ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr);
|
||||
ok(current_ib == index_buffer, "Unexpected index buffer %p.\n", current_ib);
|
||||
IDirect3DIndexBuffer9_Release(current_ib);
|
||||
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr);
|
||||
|
||||
IDirect3DStateBlock9_Release(stateblock);
|
||||
IDirect3DVertexBuffer9_Release(vertex_buffer);
|
||||
IDirect3DIndexBuffer9_Release(index_buffer);
|
||||
IDirect3DVertexDeclaration9_Release(vertex_declaration);
|
||||
|
|
|
@ -1529,6 +1529,9 @@ static void color_fill_test(void)
|
|||
goto done;
|
||||
}
|
||||
|
||||
hr = IDirect3DDevice9_ColorFill(device, NULL, NULL, 0);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* Test ColorFill on a the backbuffer (should pass) */
|
||||
hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &surface);
|
||||
ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr);
|
||||
|
@ -8883,11 +8886,11 @@ done:
|
|||
|
||||
static void srgbtexture_test(void)
|
||||
{
|
||||
/* Fill a texture with 0x7f (~ .5), and then turn on the D3DSAMP_SRGBTEXTURE
|
||||
* texture stage state to render a quad using that texture. The resulting
|
||||
* color components should be 0x36 (~ 0.21), per this formula:
|
||||
/* The result of sRGB to linear conversion for value 0x7f (~ .5) used on
|
||||
* texture mip level 0 should be 0x36 (~ 0.21), per this formula:
|
||||
* linear_color = ((srgb_color + 0.055) / 1.055) ^ 2.4
|
||||
* This is true where srgb_color > 0.04045. */
|
||||
* This is true where srgb_color > 0.04045.
|
||||
* For the value of 0x3f used on mip level 1 the result should be 0x0d (~0.05). */
|
||||
struct IDirect3DTexture9 *texture;
|
||||
struct IDirect3DSurface9 *surface;
|
||||
IDirect3DDevice9 *device;
|
||||
|
@ -8895,6 +8898,7 @@ static void srgbtexture_test(void)
|
|||
D3DCOLOR color;
|
||||
ULONG refcount;
|
||||
HWND window;
|
||||
DWORD value;
|
||||
HRESULT hr;
|
||||
|
||||
static const float quad[] =
|
||||
|
@ -8922,38 +8926,170 @@ static void srgbtexture_test(void)
|
|||
goto done;
|
||||
}
|
||||
|
||||
hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL);
|
||||
ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface);
|
||||
ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr);
|
||||
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
fill_surface(surface, 0xff7f7f7f, 0);
|
||||
IDirect3DSurface9_Release(surface);
|
||||
hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
fill_surface(surface, 0xff3f3f3f, 0);
|
||||
IDirect3DSurface9_Release(surface);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* AMD uses the LSB of the D3DSAMP_SRGBTEXTURE value.
|
||||
* NVIDIA ignores any values other than 0 and 1, leaving the previous
|
||||
* D3DSAMP_SRGBTEXTURE state.
|
||||
* Intel, WARP treat the value as boolean. */
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
|
||||
"Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE);
|
||||
ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
|
||||
ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 100);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 100, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x00363636, 1), "sRGB quad has color 0x%08x, expected 0x00363636.\n", color);
|
||||
|
||||
ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
|
||||
"Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 2);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 2, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x007f7f7f, 1) || broken(color_match(color, 0x00363636, 1)),
|
||||
"Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 3);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 3, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x007f7f7f, 1) || color_match(color, 0x00363636, 1),
|
||||
"Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == TRUE, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x00363636, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
/* Set the other state to verify that the sampler just inherits old
|
||||
* D3DSAMP_SRGBTEXTURE but * the old sampler is not preserved entirely on
|
||||
* NVIDIA. */
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x000d0d0d, 1) || color_match(color, 0x003f3f3f, 1),
|
||||
"Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 0, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x003f3f3f, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, 0x7e41882a);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, &value);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(value == 0x7e41882a, "Got unexpected value %#x.\n", value);
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = getPixelColor(device, 320, 240);
|
||||
ok(color_match(color, 0x003f3f3f, 1) || broken(color_match(color, 0x000d0d0d, 1)),
|
||||
"Got unexpected color 0x%08x.\n", color);
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3DTexture9_Release(texture);
|
||||
refcount = IDirect3DDevice9_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
|
@ -10754,33 +10890,37 @@ static void stencil_cull_test(void)
|
|||
D3DCAPS9 caps;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
static const float quad1[] =
|
||||
static const struct
|
||||
{
|
||||
-1.0, -1.0, 0.1,
|
||||
0.0, -1.0, 0.1,
|
||||
-1.0, 0.0, 0.1,
|
||||
0.0, 0.0, 0.1,
|
||||
};
|
||||
static const float quad2[] =
|
||||
struct vec3 position;
|
||||
}
|
||||
quad1[] =
|
||||
{
|
||||
0.0, -1.0, 0.1,
|
||||
1.0, -1.0, 0.1,
|
||||
0.0, 0.0, 0.1,
|
||||
1.0, 0.0, 0.1,
|
||||
};
|
||||
static const float quad3[] =
|
||||
{{-1.0f, -1.0f, 0.1f}},
|
||||
{{ 0.0f, -1.0f, 0.1f}},
|
||||
{{-1.0f, 0.0f, 0.1f}},
|
||||
{{ 0.0f, 0.0f, 0.1f}},
|
||||
},
|
||||
quad2[] =
|
||||
{
|
||||
0.0, 0.0, 0.1,
|
||||
1.0, 0.0, 0.1,
|
||||
0.0, 1.0, 0.1,
|
||||
1.0, 1.0, 0.1,
|
||||
};
|
||||
static const float quad4[] =
|
||||
{{ 0.0f, -1.0f, 0.1f}},
|
||||
{{ 1.0f, -1.0f, 0.1f}},
|
||||
{{ 0.0f, 0.0f, 0.1f}},
|
||||
{{ 1.0f, 0.0f, 0.1f}},
|
||||
},
|
||||
quad3[] =
|
||||
{
|
||||
-1.0, 0.0, 0.1,
|
||||
0.0, 0.0, 0.1,
|
||||
-1.0, 1.0, 0.1,
|
||||
0.0, 1.0, 0.1,
|
||||
{{ 0.0f, 0.0f, 0.1f}},
|
||||
{{ 1.0f, 0.0f, 0.1f}},
|
||||
{{ 0.0f, 1.0f, 0.1f}},
|
||||
{{ 1.0f, 1.0f, 0.1f}},
|
||||
},
|
||||
quad4[] =
|
||||
{
|
||||
{{-1.0f, 0.0f, 0.1f}},
|
||||
{{ 0.0f, 0.0f, 0.1f}},
|
||||
{{-1.0f, 1.0f, 0.1f}},
|
||||
{{ 0.0f, 1.0f, 0.1f}},
|
||||
};
|
||||
struct
|
||||
{
|
||||
|
@ -10849,70 +10989,73 @@ static void stencil_cull_test(void)
|
|||
|
||||
/* First pass: Fill the stencil buffer with some values... */
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad1, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad1, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_cw, D3DFMT_INDEX16, quad1, sizeof(*quad1));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_ccw, D3DFMT_INDEX16, quad1, sizeof(*quad1));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TWOSIDEDSTENCILMODE, TRUE);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad2, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad2, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_cw, D3DFMT_INDEX16, quad2, sizeof(*quad2));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_ccw, D3DFMT_INDEX16, quad2, sizeof(*quad2));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad3, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad3, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_cw, D3DFMT_INDEX16, quad3, sizeof(*quad3));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_ccw, D3DFMT_INDEX16, quad3, sizeof(*quad3));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CCW);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad4, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */,
|
||||
1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad4, sizeof(float) * 3);
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_cw, D3DFMT_INDEX16, quad4, sizeof(*quad4));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_ccw, D3DFMT_INDEX16, quad4, sizeof(*quad4));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILPASS, D3DSTENCILOP_KEEP);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TWOSIDEDSTENCILMODE, FALSE);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFUNC, D3DCMP_EQUAL);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILMASK, 0x000000ff);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* 2nd pass: Make the stencil values visible */
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
|
||||
ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, i);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, 0x0000ff00 | i);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
|
||||
painter[0].diffuse = (i * 16); /* Creates shades of blue */
|
||||
|
@ -10920,13 +11063,13 @@ static void stencil_cull_test(void)
|
|||
painter[2].diffuse = (i * 16);
|
||||
painter[3].diffuse = (i * 16);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, painter, sizeof(painter[0]));
|
||||
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
}
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, FALSE);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
color = getPixelColor(device, 160, 420);
|
||||
ok(color == 0x00000030, "CCW triangle, twoside FALSE, cull cw, replace, has color 0x%08x, expected 0x00000030\n", color);
|
||||
|
@ -10948,8 +11091,62 @@ static void stencil_cull_test(void)
|
|||
color = getPixelColor(device, 480, 60);
|
||||
ok(color == 0x00000080, "CW triangle, twoside TRUE, cull cw, culled, has color 0x%08x, expected 0x00000080\n", color);
|
||||
|
||||
/* Test for reference truncation. */
|
||||
/* 1st pass: set stencil. */
|
||||
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_STENCIL, 0x00ff0000, 0.0f, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, 0x1cc);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILMASK, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFUNC, D3DCMP_ALWAYS);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, TRUE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST,
|
||||
0, 4, 1, indices_cw, D3DFMT_INDEX16, quad1, sizeof(*quad1));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* 2nd pass: draw image. */
|
||||
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff0000, 0.0f, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, 0xdb);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILMASK, 0x0f);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFUNC, D3DCMP_LESS);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, painter, sizeof(painter[0]));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
color = getPixelColor(device, 280, 360);
|
||||
ok(color == 0x000000f0, "Got unexpected colour 0x%08x.\n", color);
|
||||
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
cleanup:
|
||||
refcount = IDirect3DDevice9_Release(device);
|
||||
|
@ -24533,6 +24730,145 @@ static void test_sysmem_draw(void)
|
|||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
static void test_draw_mapped_buffer(void)
|
||||
{
|
||||
IDirect3DVertexBuffer9 *vb;
|
||||
IDirect3DIndexBuffer9 *ib;
|
||||
IDirect3DDevice9 *device;
|
||||
IDirect3D9 *d3d;
|
||||
unsigned int i;
|
||||
D3DCOLOR color;
|
||||
ULONG refcount;
|
||||
BOOL test_pass;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
void *data;
|
||||
|
||||
static const short indices[] = {0, 1, 2};
|
||||
static const struct
|
||||
{
|
||||
struct vec3 position;
|
||||
DWORD diffuse;
|
||||
}
|
||||
quad[] =
|
||||
{
|
||||
{{-1.0f, -1.0f, 0.1f}, 0xffff0000},
|
||||
{{-1.0f, 1.0f, 0.1f}, 0xffff0000},
|
||||
{{ 1.0f, 1.0f, 0.1f}, 0xffff0000},
|
||||
};
|
||||
static const struct
|
||||
{
|
||||
D3DPOOL pool;
|
||||
DWORD usage;
|
||||
BOOL ignore_wine_result;
|
||||
}
|
||||
tests[] =
|
||||
{
|
||||
{D3DPOOL_DEFAULT, D3DUSAGE_DYNAMIC, TRUE},
|
||||
{D3DPOOL_MANAGED, 0},
|
||||
{D3DPOOL_SYSTEMMEM, 0},
|
||||
};
|
||||
|
||||
window = create_window();
|
||||
ok(!!window, "Failed to create a window.\n");
|
||||
|
||||
d3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
ok(!!d3d, "Failed to create a D3D object.\n");
|
||||
if (!(device = create_device(d3d, window, window, TRUE)))
|
||||
{
|
||||
skip("Failed to create a D3D device, skipping tests.\n");
|
||||
IDirect3D9_Release(d3d);
|
||||
DestroyWindow(window);
|
||||
return;
|
||||
}
|
||||
|
||||
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0,
|
||||
D3DFMT_INDEX16, D3DPOOL_DEFAULT, &ib, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), &data, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
memcpy(data, indices, sizeof(indices));
|
||||
|
||||
hr = IDirect3DDevice9_SetIndices(device, ib);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tests); ++i)
|
||||
{
|
||||
hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), tests[i].usage,
|
||||
D3DFVF_XYZ | D3DFVF_DIFFUSE, tests[i].pool, &vb, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), &data, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
memcpy(data, quad, sizeof(quad));
|
||||
|
||||
hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad[0]));
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, ARRAY_SIZE(quad), 0, 1);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x, test %u.\n", hr, i);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
color = getPixelColor(device, 160, 120);
|
||||
ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x, test %u.\n", color, i);
|
||||
color = getPixelColor(device, 480, 360);
|
||||
ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x, test %u.\n", color, i);
|
||||
|
||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DVertexBuffer9_Unlock(vb);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* One more time now when buffer object in wined3d is already created. */
|
||||
hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), &data, D3DLOCK_DISCARD);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
memcpy(data, quad, sizeof(quad));
|
||||
|
||||
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_BeginScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, ARRAY_SIZE(quad), 0, 1);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x, test %u.\n", hr, i);
|
||||
hr = IDirect3DDevice9_EndScene(device);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
color = getPixelColor(device, 160, 120);
|
||||
|
||||
test_pass = color_match(color, 0x00ff0000, 1);
|
||||
todo_wine_if(tests[i].ignore_wine_result && !test_pass)
|
||||
ok(test_pass, "Got unexpected color 0x%08x, test %u.\n", color, i);
|
||||
|
||||
color = getPixelColor(device, 480, 360);
|
||||
ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x, test %u.\n", color, i);
|
||||
|
||||
hr = IDirect3DVertexBuffer9_Unlock(vb);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3DVertexBuffer9_Release(vb);
|
||||
}
|
||||
|
||||
hr = IDirect3DIndexBuffer9_Unlock(ib);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
IDirect3DIndexBuffer9_Release(ib);
|
||||
refcount = IDirect3DDevice9_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
|
||||
IDirect3D9_Release(d3d);
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
|
||||
START_TEST(visual)
|
||||
{
|
||||
D3DADAPTER_IDENTIFIER9 identifier;
|
||||
|
@ -24673,4 +25009,5 @@ START_TEST(visual)
|
|||
test_map_synchronisation();
|
||||
test_color_vertex();
|
||||
test_sysmem_draw();
|
||||
test_draw_mapped_buffer();
|
||||
}
|
||||
|
|
|
@ -903,7 +903,7 @@ static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tr
|
|||
%}
|
||||
|
||||
%locations
|
||||
%error-verbose
|
||||
%define parse.error verbose
|
||||
%expect 1
|
||||
|
||||
%union
|
||||
|
|
|
@ -6342,10 +6342,12 @@ static void test_viewport_clear1(void)
|
|||
ret_color = IDirect3DRMFrame_GetSceneBackground(camera1);
|
||||
ok(ret_color == 0xff00ff00, "Expected scene color returned == 0xff00ff00, got %#x.\n", ret_color);
|
||||
|
||||
CHECK_REFCOUNT(frame1, 1);
|
||||
hr = IDirect3DRMViewport_Clear(viewport1);
|
||||
ok(SUCCEEDED(hr), "Cannot clear viewport (hr = %#x).\n", hr);
|
||||
ret_color = get_surface_color(surface, 320, 240);
|
||||
ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08x.\n", ret_color);
|
||||
CHECK_REFCOUNT(frame1, 1);
|
||||
|
||||
hr = IDirect3DRMFrame_SetSceneBackgroundRGB(frame1, 0.0f, 0.0f, 1.0f);
|
||||
ok(SUCCEEDED(hr), "Cannot set scene background RGB (hr = %#x)\n", hr);
|
||||
|
@ -6545,10 +6547,12 @@ static void test_viewport_clear2(void)
|
|||
ret_color = IDirect3DRMFrame3_GetSceneBackground(camera3);
|
||||
ok(ret_color == 0xff00ff00, "Expected scene color returned == 0xff00ff00, got %#x.\n", ret_color);
|
||||
|
||||
CHECK_REFCOUNT(frame3, 1);
|
||||
hr = IDirect3DRMViewport2_Clear(viewport2, D3DRMCLEAR_ALL);
|
||||
ok(SUCCEEDED(hr), "Cannot clear viewport (hr = %#x).\n", hr);
|
||||
ret_color = get_surface_color(surface, 320, 240);
|
||||
ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08x.\n", ret_color);
|
||||
CHECK_REFCOUNT(frame3, 1);
|
||||
|
||||
hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport);
|
||||
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
|
||||
|
|
|
@ -53,6 +53,7 @@ static HRESULT d3drm_update_background_material(struct d3drm_viewport *viewport)
|
|||
if (FAILED(hr = IDirect3DRMFrame_GetScene(viewport->camera, &root_frame)))
|
||||
return hr;
|
||||
color = IDirect3DRMFrame_GetSceneBackground(root_frame);
|
||||
IDirect3DRMFrame_Release(root_frame);
|
||||
|
||||
memset(&mat, 0, sizeof(mat));
|
||||
mat.dwSize = sizeof(mat);
|
||||
|
|
|
@ -39,6 +39,6 @@
|
|||
@ stub D3DX11PreprocessShaderFromResourceA
|
||||
@ stub D3DX11PreprocessShaderFromResourceW
|
||||
@ stub D3DX11SHProjectCubeMap
|
||||
@ stub D3DX11SaveTextureToFileA
|
||||
@ stub D3DX11SaveTextureToFileW
|
||||
@ stdcall D3DX11SaveTextureToFileA(ptr ptr long str)
|
||||
@ stdcall D3DX11SaveTextureToFileW(ptr ptr long wstr)
|
||||
@ stdcall D3DX11SaveTextureToMemory(ptr ptr long ptr long)
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
@ stub D3DX11CreateAsyncTextureProcessor
|
||||
@ stub D3DX11CreateShaderResourceViewFromFileA
|
||||
@ stub D3DX11CreateShaderResourceViewFromFileW
|
||||
@ stub D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr)
|
||||
@ stdcall D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr)
|
||||
@ stub D3DX11CreateShaderResourceViewFromResourceA
|
||||
@ stub D3DX11CreateShaderResourceViewFromResourceW
|
||||
@ stdcall D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr)
|
||||
|
@ -39,6 +39,6 @@
|
|||
@ stub D3DX11PreprocessShaderFromResourceA
|
||||
@ stub D3DX11PreprocessShaderFromResourceW
|
||||
@ stub D3DX11SHProjectCubeMap
|
||||
@ stub D3DX11SaveTextureToFileA
|
||||
@ stub D3DX11SaveTextureToFileW
|
||||
@ stdcall D3DX11SaveTextureToFileA(ptr ptr long str)
|
||||
@ stdcall D3DX11SaveTextureToFileW(ptr ptr long wstr)
|
||||
@ stdcall D3DX11SaveTextureToMemory(ptr ptr long ptr long)
|
||||
|
|
|
@ -65,6 +65,24 @@ HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *d
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DX11SaveTextureToFileW(ID3D11DeviceContext *context, ID3D11Resource *texture,
|
||||
D3DX11_IMAGE_FILE_FORMAT format, const WCHAR *filename)
|
||||
{
|
||||
FIXME("context %p, texture %p, format %u, filename %s stub!\n",
|
||||
context, texture, format, debugstr_w(filename));
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DX11SaveTextureToFileA(ID3D11DeviceContext *context, ID3D11Resource *texture,
|
||||
D3DX11_IMAGE_FILE_FORMAT format, const char *filename)
|
||||
{
|
||||
FIXME("context %p, texture %p, format %u, filename %s stub!\n",
|
||||
context, texture, format, debugstr_a(filename));
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DX11SaveTextureToMemory(ID3D11DeviceContext *context, ID3D11Resource *texture,
|
||||
D3DX11_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags)
|
||||
{
|
||||
|
|
|
@ -121,6 +121,10 @@ HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *d
|
|||
const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN;
|
||||
HRESULT load_volume_texture_from_dds(IDirect3DVolumeTexture9 *volume_texture, const void *src_data,
|
||||
const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN;
|
||||
HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock,
|
||||
IDirect3DSurface9 **temp_surface, BOOL write) DECLSPEC_HIDDEN;
|
||||
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock,
|
||||
IDirect3DSurface9 *temp_surface, BOOL update) DECLSPEC_HIDDEN;
|
||||
|
||||
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN;
|
||||
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -530,6 +530,7 @@ static void free_sampler(struct d3dx_sampler *sampler)
|
|||
free_state(&sampler->states[i]);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, sampler->states);
|
||||
HeapFree(GetProcessHeap(), 0, sampler);
|
||||
}
|
||||
|
||||
static void d3dx_pool_release_shared_parameter(struct d3dx_top_level_parameter *param);
|
||||
|
@ -562,7 +563,7 @@ static void free_parameter_data(struct d3dx_parameter *param, BOOL child)
|
|||
case D3DXPT_SAMPLER3D:
|
||||
case D3DXPT_SAMPLERCUBE:
|
||||
free_sampler((struct d3dx_sampler *)param->data);
|
||||
break;
|
||||
return;
|
||||
|
||||
default:
|
||||
FIXME("Unhandled type %s\n", debug_d3dxparameter_type(param->type));
|
||||
|
@ -592,6 +593,9 @@ static void free_parameter(struct d3dx_parameter *param, BOOL element, BOOL chil
|
|||
HeapFree(GetProcessHeap(), 0, param->members);
|
||||
}
|
||||
|
||||
if (param->full_name)
|
||||
heap_free(param->full_name);
|
||||
|
||||
free_parameter_data(param, child);
|
||||
|
||||
/* only the parent has to release name and semantic */
|
||||
|
|
|
@ -744,157 +744,119 @@ D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, const D3DXVECTOR4 *plight,
|
|||
return pout;
|
||||
}
|
||||
|
||||
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 D3DXMatrixTransformation(D3DXMATRIX *out, const D3DXVECTOR3 *scaling_center,
|
||||
const D3DXQUATERNION *scaling_rotation, const D3DXVECTOR3 *scaling,
|
||||
const D3DXVECTOR3 *rotation_center, const D3DXQUATERNION *rotation,
|
||||
const D3DXVECTOR3 *translation)
|
||||
{
|
||||
D3DXMATRIX m1, m2, m3, m4, m5, m6, m7;
|
||||
D3DXQUATERNION prc;
|
||||
D3DXVECTOR3 psc, pt;
|
||||
static const D3DXVECTOR3 zero_vector;
|
||||
D3DXMATRIX m1, msr1, ms, msr, msc, mrc1, mr, mrc, mt;
|
||||
D3DXVECTOR3 sc, rc;
|
||||
D3DXQUATERNION q;
|
||||
|
||||
TRACE("pout %p, pscalingcenter %p, pscalingrotation %p, pscaling %p, protationcentr %p, protation %p, ptranslation %p\n",
|
||||
pout, pscalingcenter, pscalingrotation, pscaling, protationcenter, protation, ptranslation);
|
||||
TRACE("out %p, scaling_center %p, scaling_rotation %p, scaling %p, rotation_center %p,"
|
||||
" rotation %p, translation %p.\n",
|
||||
out, scaling_center, scaling_rotation, scaling, rotation_center, rotation, translation);
|
||||
|
||||
if ( !pscalingcenter )
|
||||
if (scaling)
|
||||
{
|
||||
psc.x = 0.0f;
|
||||
psc.y = 0.0f;
|
||||
psc.z = 0.0f;
|
||||
sc = scaling_center ? *scaling_center : zero_vector;
|
||||
D3DXMatrixTranslation(&m1, -sc.x, -sc.y, -sc.z);
|
||||
if (scaling_rotation)
|
||||
{
|
||||
q.x = -scaling_rotation->x;
|
||||
q.y = -scaling_rotation->y;
|
||||
q.z = -scaling_rotation->z;
|
||||
q.w = scaling_rotation->w;
|
||||
D3DXMatrixRotationQuaternion(&msr1, &q);
|
||||
D3DXMatrixMultiply(&m1, &m1, &msr1);
|
||||
}
|
||||
D3DXMatrixScaling(&ms, scaling->x, scaling->y, scaling->z);
|
||||
D3DXMatrixMultiply(&m1, &m1, &ms);
|
||||
if (scaling_rotation)
|
||||
{
|
||||
D3DXMatrixRotationQuaternion(&msr, scaling_rotation);
|
||||
D3DXMatrixMultiply(&m1, &m1, &msr);
|
||||
}
|
||||
D3DXMatrixTranslation(&msc, sc.x, sc.y, sc.z);
|
||||
D3DXMatrixMultiply(&m1, &m1, &msc);
|
||||
}
|
||||
else
|
||||
{
|
||||
psc.x = pscalingcenter->x;
|
||||
psc.y = pscalingcenter->y;
|
||||
psc.z = pscalingcenter->z;
|
||||
D3DXMatrixIdentity(&m1);
|
||||
}
|
||||
|
||||
if ( !protationcenter )
|
||||
if (rotation)
|
||||
{
|
||||
prc.x = 0.0f;
|
||||
prc.y = 0.0f;
|
||||
prc.z = 0.0f;
|
||||
rc = rotation_center ? *rotation_center : zero_vector;
|
||||
D3DXMatrixTranslation(&mrc1, -rc.x, -rc.y, -rc.z);
|
||||
D3DXMatrixMultiply(&m1, &m1, &mrc1);
|
||||
D3DXMatrixRotationQuaternion(&mr, rotation);
|
||||
D3DXMatrixMultiply(&m1, &m1, &mr);
|
||||
D3DXMatrixTranslation(&mrc, rc.x, rc.y, rc.z);
|
||||
D3DXMatrixMultiply(&m1, &m1, &mrc);
|
||||
}
|
||||
|
||||
if (translation)
|
||||
{
|
||||
D3DXMatrixTranslation(&mt, translation->x, translation->y, translation->z);
|
||||
D3DXMatrixMultiply(out, &m1, &mt);
|
||||
}
|
||||
else
|
||||
{
|
||||
prc.x = protationcenter->x;
|
||||
prc.y = protationcenter->y;
|
||||
prc.z = protationcenter->z;
|
||||
*out = m1;
|
||||
}
|
||||
|
||||
if ( !ptranslation )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
D3DXMatrixTranslation(&m1, -psc.x, -psc.y, -psc.z);
|
||||
|
||||
if ( !pscalingrotation )
|
||||
{
|
||||
D3DXMatrixIdentity(&m2);
|
||||
D3DXMatrixIdentity(&m4);
|
||||
}
|
||||
else
|
||||
{
|
||||
D3DXMatrixRotationQuaternion(&m4, pscalingrotation);
|
||||
D3DXMatrixInverse(&m2, NULL, &m4);
|
||||
}
|
||||
|
||||
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;
|
||||
return out;
|
||||
}
|
||||
|
||||
D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, const D3DXVECTOR2 *pscalingcenter, FLOAT scalingrotation, const D3DXVECTOR2 *pscaling, const D3DXVECTOR2 *protationcenter, FLOAT rotation, const D3DXVECTOR2 *ptranslation)
|
||||
static void vec3_from_vec2(D3DXVECTOR3 *v3, const D3DXVECTOR2 *v2)
|
||||
{
|
||||
D3DXQUATERNION rot, sca_rot;
|
||||
D3DXVECTOR3 rot_center, sca, sca_center, trans;
|
||||
if (!v2)
|
||||
return;
|
||||
|
||||
TRACE("pout %p, pscalingcenter %p, scalingrotation %f, pscaling %p, protztioncenter %p, rotation %f, ptranslation %p\n",
|
||||
pout, pscalingcenter, scalingrotation, pscaling, protationcenter, rotation, ptranslation);
|
||||
v3->x = v2->x;
|
||||
v3->y = v2->y;
|
||||
v3->z = 0.0f;
|
||||
}
|
||||
|
||||
if ( pscalingcenter )
|
||||
D3DXMATRIX * WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *out, const D3DXVECTOR2 *scaling_center,
|
||||
float scaling_rotation, const D3DXVECTOR2 *scaling, const D3DXVECTOR2 *rotation_center,
|
||||
float rotation, const D3DXVECTOR2 *translation)
|
||||
{
|
||||
D3DXVECTOR3 r_c, s, s_c, t;
|
||||
D3DXQUATERNION r, s_r;
|
||||
|
||||
TRACE("out %p, scaling_center %p, scaling_rotation %.8e, scaling %p, rotation_center %p, "
|
||||
"rotation %.8e, translation %p.\n",
|
||||
out, scaling_center, scaling_rotation, scaling, rotation_center, rotation, translation);
|
||||
|
||||
vec3_from_vec2(&s_c, scaling_center);
|
||||
vec3_from_vec2(&s, scaling);
|
||||
if (scaling)
|
||||
s.z = 1.0f;
|
||||
vec3_from_vec2(&r_c, rotation_center);
|
||||
vec3_from_vec2(&t, translation);
|
||||
|
||||
if (rotation)
|
||||
{
|
||||
sca_center.x=pscalingcenter->x;
|
||||
sca_center.y=pscalingcenter->y;
|
||||
sca_center.z=0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
sca_center.x=0.0f;
|
||||
sca_center.y=0.0f;
|
||||
sca_center.z=0.0f;
|
||||
r.w = cosf(rotation / 2.0f);
|
||||
r.x = 0.0f;
|
||||
r.y = 0.0f;
|
||||
r.z = sinf(rotation / 2.0f);
|
||||
}
|
||||
|
||||
if ( pscaling )
|
||||
if (scaling_rotation)
|
||||
{
|
||||
sca.x=pscaling->x;
|
||||
sca.y=pscaling->y;
|
||||
sca.z=1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
sca.x=1.0f;
|
||||
sca.y=1.0f;
|
||||
sca.z=1.0f;
|
||||
s_r.w = cosf(scaling_rotation / 2.0f);
|
||||
s_r.x = 0.0f;
|
||||
s_r.y = 0.0f;
|
||||
s_r.z = sinf(scaling_rotation / 2.0f);
|
||||
}
|
||||
|
||||
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=cosf(rotation/2.0f);
|
||||
rot.x=0.0f;
|
||||
rot.y=0.0f;
|
||||
rot.z=sinf(rotation/2.0f);
|
||||
|
||||
sca_rot.w=cosf(scalingrotation/2.0f);
|
||||
sca_rot.x=0.0f;
|
||||
sca_rot.y=0.0f;
|
||||
sca_rot.z=sinf(scalingrotation/2.0f);
|
||||
|
||||
D3DXMatrixTransformation(pout, &sca_center, &sca_rot, &sca, &rot_center, &rot, &trans);
|
||||
|
||||
return pout;
|
||||
return D3DXMatrixTransformation(out, scaling_center ? &s_c : NULL,
|
||||
scaling_rotation ? &s_r : NULL, scaling ? &s : NULL, rotation_center ? &r_c: NULL,
|
||||
rotation ? &r : NULL, translation ? &t : NULL);
|
||||
}
|
||||
|
||||
D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z)
|
||||
|
|
|
@ -3332,6 +3332,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
|
|||
goto end;
|
||||
}
|
||||
|
||||
if ((provide_flags & PROVIDE_SKININFO) && !mesh_data->skin_info)
|
||||
{
|
||||
if (FAILED(hr = D3DXCreateSkinInfoFVF(mesh_data->num_vertices, mesh_data->fvf,
|
||||
mesh_data->nb_bones, &mesh_data->skin_info)))
|
||||
goto end;
|
||||
}
|
||||
|
||||
hr = D3D_OK;
|
||||
|
||||
end:
|
||||
|
|
|
@ -426,6 +426,9 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
|
|||
debugstr_a(data), length, defines, include, debugstr_a(function), debugstr_a(profile),
|
||||
flags, shader, error_msgs, constant_table);
|
||||
|
||||
if (D3DX_SDK_VERSION <= 36)
|
||||
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
|
||||
|
||||
hr = D3DCompile(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include,
|
||||
function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
|
||||
|
||||
|
@ -506,6 +509,9 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO
|
|||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (D3DX_SDK_VERSION <= 36)
|
||||
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
|
||||
|
||||
hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines,
|
||||
(ID3DInclude *)include, entrypoint, profile, flags, 0,
|
||||
(ID3DBlob **)shader, (ID3DBlob **)error_messages);
|
||||
|
|
|
@ -199,6 +199,100 @@ static const struct {
|
|||
{ 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000, D3DFMT_X8B8G8R8 },
|
||||
};
|
||||
|
||||
HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock,
|
||||
IDirect3DSurface9 **temp_surface, BOOL write)
|
||||
{
|
||||
unsigned int width, height;
|
||||
IDirect3DDevice9 *device;
|
||||
D3DSURFACE_DESC desc;
|
||||
DWORD lock_flag;
|
||||
HRESULT hr;
|
||||
|
||||
lock_flag = write ? D3DLOCK_DISCARD : D3DLOCK_READONLY;
|
||||
*temp_surface = NULL;
|
||||
if (FAILED(hr = IDirect3DSurface9_LockRect(surface, lock, surface_rect, lock_flag)))
|
||||
{
|
||||
IDirect3DSurface9_GetDevice(surface, &device);
|
||||
IDirect3DSurface9_GetDesc(surface, &desc);
|
||||
|
||||
if (surface_rect)
|
||||
{
|
||||
width = surface_rect->right - surface_rect->left;
|
||||
height = surface_rect->bottom - surface_rect->top;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = desc.Width;
|
||||
height = desc.Height;
|
||||
}
|
||||
|
||||
hr = write ? IDirect3DDevice9_CreateOffscreenPlainSurface(device, width, height,
|
||||
desc.Format, D3DPOOL_SYSTEMMEM, temp_surface, NULL)
|
||||
: IDirect3DDevice9_CreateRenderTarget(device, width, height,
|
||||
desc.Format, D3DMULTISAMPLE_NONE, 0, TRUE, temp_surface, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create temporary surface, surface %p, format %#x,"
|
||||
" usage %#x, pool %#x, write %#x, width %u, height %u.\n",
|
||||
surface, desc.Format, desc.Usage, desc.Pool, write, width, height);
|
||||
IDirect3DDevice9_Release(device);
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (write || SUCCEEDED(hr = IDirect3DDevice9_StretchRect(device, surface, surface_rect,
|
||||
*temp_surface, NULL, D3DTEXF_NONE)))
|
||||
hr = IDirect3DSurface9_LockRect(*temp_surface, lock, NULL, lock_flag);
|
||||
|
||||
IDirect3DDevice9_Release(device);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to lock surface %p, write %#x, usage %#x, pool %#x.\n",
|
||||
surface, write, desc.Usage, desc.Pool);
|
||||
IDirect3DSurface9_Release(*temp_surface);
|
||||
*temp_surface = NULL;
|
||||
return hr;
|
||||
}
|
||||
TRACE("Created temporary surface %p.\n", surface);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock,
|
||||
IDirect3DSurface9 *temp_surface, BOOL update)
|
||||
{
|
||||
IDirect3DDevice9 *device;
|
||||
POINT surface_point;
|
||||
HRESULT hr;
|
||||
|
||||
if (!temp_surface)
|
||||
{
|
||||
hr = IDirect3DSurface9_UnlockRect(surface);
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = IDirect3DSurface9_UnlockRect(temp_surface);
|
||||
if (update)
|
||||
{
|
||||
if (surface_rect)
|
||||
{
|
||||
surface_point.x = surface_rect->left;
|
||||
surface_point.y = surface_rect->top;
|
||||
}
|
||||
else
|
||||
{
|
||||
surface_point.x = 0;
|
||||
surface_point.y = 0;
|
||||
}
|
||||
IDirect3DSurface9_GetDevice(surface, &device);
|
||||
if (FAILED(hr = IDirect3DDevice9_UpdateSurface(device, temp_surface, NULL, surface, &surface_point)))
|
||||
WARN("Updating surface failed, hr %#x, surface %p, temp_surface %p.\n",
|
||||
hr, surface, temp_surface);
|
||||
IDirect3DDevice9_Release(device);
|
||||
}
|
||||
IDirect3DSurface9_Release(temp_surface);
|
||||
return hr;
|
||||
}
|
||||
|
||||
static D3DFORMAT dds_rgb_to_d3dformat(const struct dds_pixel_format *pixel_format)
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -462,6 +556,7 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
|
|||
BYTE *pixels;
|
||||
struct volume volume;
|
||||
const struct pixel_format_desc *pixel_format;
|
||||
IDirect3DSurface9 *temp_surface;
|
||||
|
||||
if (src_rect)
|
||||
{
|
||||
|
@ -501,7 +596,7 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
|
|||
return hr;
|
||||
}
|
||||
|
||||
hr = IDirect3DSurface9_LockRect(src_surface, &locked_rect, NULL, D3DLOCK_READONLY);
|
||||
hr = lock_surface(src_surface, NULL, &locked_rect, &temp_surface, FALSE);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ID3DXBuffer_Release(buffer);
|
||||
|
@ -514,7 +609,7 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
|
|||
copy_pixels(locked_rect.pBits, locked_rect.Pitch, 0, pixels, dst_pitch, 0,
|
||||
&volume, pixel_format);
|
||||
|
||||
IDirect3DSurface9_UnlockRect(src_surface);
|
||||
unlock_surface(src_surface, NULL, &locked_rect, temp_surface, FALSE);
|
||||
|
||||
*dst_buffer = buffer;
|
||||
return D3D_OK;
|
||||
|
@ -1753,8 +1848,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
|||
DWORD filter, D3DCOLOR color_key)
|
||||
{
|
||||
const struct pixel_format_desc *srcformatdesc, *destformatdesc;
|
||||
IDirect3DSurface9 *surface = dst_surface;
|
||||
IDirect3DDevice9 *device;
|
||||
IDirect3DSurface9 *surface;
|
||||
D3DSURFACE_DESC surfdesc;
|
||||
D3DLOCKED_RECT lockrect;
|
||||
struct volume src_size, dst_size;
|
||||
|
@ -1814,25 +1908,11 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
if (surfdesc.Pool == D3DPOOL_DEFAULT && !(surfdesc.Usage & D3DUSAGE_DYNAMIC))
|
||||
{
|
||||
IDirect3DSurface9_GetDevice(dst_surface, &device);
|
||||
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, surfdesc.Width,
|
||||
surfdesc.Height, surfdesc.Format, D3DPOOL_SYSTEMMEM, &surface, NULL);
|
||||
IDirect3DDevice9_Release(device);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create staging surface, hr %#x.\n", hr);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
}
|
||||
if (FAILED(hr = lock_surface(dst_surface, dst_rect, &lockrect, &surface, TRUE)))
|
||||
return hr;
|
||||
|
||||
if (FAILED(IDirect3DSurface9_LockRect(surface, &lockrect, dst_rect, 0)))
|
||||
{
|
||||
if (surface != dst_surface)
|
||||
IDirect3DSurface9_Release(surface);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
src_memory = (BYTE *)src_memory + src_rect->top / srcformatdesc->block_height * src_pitch
|
||||
+ src_rect->left / srcformatdesc->block_width * srcformatdesc->block_byte_count;
|
||||
|
||||
if (src_format == surfdesc.Format
|
||||
&& dst_size.width == src_size.width
|
||||
|
@ -1847,8 +1927,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
|||
&& src_size.height != surfdesc.Height))
|
||||
{
|
||||
WARN("Source rect %s is misaligned.\n", wine_dbgstr_rect(src_rect));
|
||||
hr = D3DXERR_INVALIDDATA;
|
||||
goto done;
|
||||
unlock_surface(dst_surface, dst_rect, &lockrect, surface, FALSE);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
|
||||
copy_pixels(src_memory, src_pitch, 0, lockrect.pBits, lockrect.Pitch, 0,
|
||||
|
@ -1860,8 +1940,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
|||
|| !is_conversion_to_supported(destformatdesc))
|
||||
{
|
||||
FIXME("Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.Format);
|
||||
hr = E_NOTIMPL;
|
||||
goto done;
|
||||
unlock_surface(dst_surface, dst_rect, &lockrect, surface, FALSE);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
if ((filter & 0xf) == D3DX_FILTER_NONE)
|
||||
|
@ -1881,21 +1961,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
|
|||
}
|
||||
}
|
||||
|
||||
hr = D3D_OK;
|
||||
done:
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
if (surface != dst_surface)
|
||||
{
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
IDirect3DSurface9_GetDevice(dst_surface, &device);
|
||||
hr = IDirect3DDevice9_UpdateSurface(device, surface, NULL, dst_surface, NULL);
|
||||
IDirect3DDevice9_Release(device);
|
||||
}
|
||||
IDirect3DSurface9_Release(surface);
|
||||
}
|
||||
|
||||
return hr;
|
||||
return unlock_surface(dst_surface, dst_rect, &lockrect, surface, TRUE);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
|
@ -1924,7 +1990,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface,
|
|||
const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface,
|
||||
const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
|
||||
{
|
||||
IDirect3DSurface9 *surface = src_surface;
|
||||
IDirect3DSurface9 *temp_surface;
|
||||
D3DTEXTUREFILTERTYPE d3d_filter;
|
||||
IDirect3DDevice9 *device;
|
||||
D3DSURFACE_DESC src_desc;
|
||||
|
@ -1979,32 +2045,14 @@ HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface,
|
|||
src_rect = &s;
|
||||
}
|
||||
|
||||
if (FAILED(IDirect3DSurface9_LockRect(surface, &lock, NULL, D3DLOCK_READONLY)))
|
||||
{
|
||||
IDirect3DSurface9_GetDevice(src_surface, &device);
|
||||
if (FAILED(IDirect3DDevice9_CreateRenderTarget(device, src_desc.Width, src_desc.Height,
|
||||
src_desc.Format, D3DMULTISAMPLE_NONE, 0, TRUE, &surface, NULL)))
|
||||
{
|
||||
IDirect3DDevice9_Release(device);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr = IDirect3DDevice9_StretchRect(device, src_surface, NULL, surface, NULL, D3DTEXF_NONE)))
|
||||
hr = IDirect3DSurface9_LockRect(surface, &lock, NULL, D3DLOCK_READONLY);
|
||||
IDirect3DDevice9_Release(device);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
IDirect3DSurface9_Release(surface);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
if (FAILED(lock_surface(src_surface, NULL, &lock, &temp_surface, FALSE)))
|
||||
return D3DXERR_INVALIDDATA;
|
||||
|
||||
hr = D3DXLoadSurfaceFromMemory(dst_surface, dst_palette, dst_rect, lock.pBits,
|
||||
src_desc.Format, lock.Pitch, src_palette, src_rect, filter, color_key);
|
||||
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
if (surface != src_surface)
|
||||
IDirect3DSurface9_Release(surface);
|
||||
if (FAILED(unlock_surface(src_surface, NULL, &lock, temp_surface, FALSE)))
|
||||
return D3DXERR_INVALIDDATA;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
@ -2074,6 +2122,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
|
|||
WICPixelFormatGUID wic_pixel_format;
|
||||
D3DFORMAT d3d_pixel_format;
|
||||
D3DSURFACE_DESC src_surface_desc;
|
||||
IDirect3DSurface9 *temp_surface;
|
||||
D3DLOCKED_RECT locked_rect;
|
||||
int width, height;
|
||||
STATSTG stream_stats;
|
||||
|
@ -2081,7 +2130,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
|
|||
ID3DXBuffer *buffer;
|
||||
DWORD size;
|
||||
|
||||
TRACE("(%p, %#x, %p, %p, %s)\n",
|
||||
TRACE("dst_buffer %p, file_format %#x, src_surface %p, src_palette %p, src_rect %s.\n",
|
||||
dst_buffer, file_format, src_surface, src_palette, wine_dbgstr_rect(src_rect));
|
||||
|
||||
if (!dst_buffer || !src_surface) return D3DERR_INVALIDCALL;
|
||||
|
@ -2175,16 +2224,14 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
|
|||
if (SUCCEEDED(hr) && d3d_pixel_format != D3DFMT_UNKNOWN)
|
||||
{
|
||||
TRACE("Using pixel format %s %#x\n", debugstr_guid(&wic_pixel_format), d3d_pixel_format);
|
||||
|
||||
if (src_surface_desc.Format == d3d_pixel_format) /* Simple copy */
|
||||
{
|
||||
hr = IDirect3DSurface9_LockRect(src_surface, &locked_rect, src_rect, D3DLOCK_READONLY);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
IWICBitmapFrameEncode_WritePixels(frame, height,
|
||||
locked_rect.Pitch, height * locked_rect.Pitch, locked_rect.pBits);
|
||||
IDirect3DSurface9_UnlockRect(src_surface);
|
||||
}
|
||||
if (FAILED(hr = lock_surface(src_surface, src_rect, &locked_rect, &temp_surface, FALSE)))
|
||||
goto cleanup;
|
||||
|
||||
IWICBitmapFrameEncode_WritePixels(frame, height,
|
||||
locked_rect.Pitch, height * locked_rect.Pitch, locked_rect.pBits);
|
||||
unlock_surface(src_surface, src_rect, &locked_rect, temp_surface, FALSE);
|
||||
}
|
||||
else /* Pixel format conversion */
|
||||
{
|
||||
|
@ -2214,14 +2261,14 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
|
|||
hr = E_OUTOFMEMORY;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
hr = IDirect3DSurface9_LockRect(src_surface, &locked_rect, src_rect, D3DLOCK_READONLY);
|
||||
if (SUCCEEDED(hr))
|
||||
if (FAILED(hr = lock_surface(src_surface, src_rect, &locked_rect, &temp_surface, FALSE)))
|
||||
{
|
||||
convert_argb_pixels(locked_rect.pBits, locked_rect.Pitch, 0, &size, src_format_desc,
|
||||
dst_data, dst_pitch, 0, &size, dst_format_desc, 0, NULL);
|
||||
IDirect3DSurface9_UnlockRect(src_surface);
|
||||
HeapFree(GetProcessHeap(), 0, dst_data);
|
||||
goto cleanup;
|
||||
}
|
||||
convert_argb_pixels(locked_rect.pBits, locked_rect.Pitch, 0, &size, src_format_desc,
|
||||
dst_data, dst_pitch, 0, &size, dst_format_desc, 0, NULL);
|
||||
unlock_surface(src_surface, src_rect, &locked_rect, temp_surface, FALSE);
|
||||
|
||||
IWICBitmapFrameEncode_WritePixels(frame, height, dst_pitch, dst_pitch * height, dst_data);
|
||||
HeapFree(GetProcessHeap(), 0, dst_data);
|
||||
|
|
|
@ -1093,16 +1093,16 @@ static void D3DXQuaternionTest(void)
|
|||
expectedquat.x = 7.121285f; expectedquat.y = 2.159964f; expectedquat.z = -3.855094f; expectedquat.w = 5.362844f;
|
||||
expect_quaternion(&expectedquat, &gotquat, 2);
|
||||
expectedquat.x = -1113.492920f; expectedquat.y = 82.679260f; expectedquat.z = -6.696645f; expectedquat.w = -4.090050f;
|
||||
expect_quaternion(&expectedquat, &Nq, 2);
|
||||
expect_quaternion(&expectedquat, &Nq, 4);
|
||||
expectedquat.x = -1111.0f; expectedquat.y = 111.0f; expectedquat.z = -11.0f; expectedquat.w = 1.0f;
|
||||
expect_quaternion(&expectedquat, &Nq1, 0);
|
||||
gotquat = s;
|
||||
D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &gotquat, &t, &u);
|
||||
expectedquat.x = -1113.492920f; expectedquat.y = 82.679260f; expectedquat.z = -6.696645f; expectedquat.w = -4.090050f;
|
||||
expect_quaternion(&expectedquat, &Nq, 2);
|
||||
expect_quaternion(&expectedquat, &Nq, 4);
|
||||
Nq1 = u;
|
||||
D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &t, &Nq1);
|
||||
expect_quaternion(&expectedquat, &Nq, 2);
|
||||
expect_quaternion(&expectedquat, &Nq, 4);
|
||||
r.x = 0.2f; r.y = 0.3f; r.z = 1.3f; r.w = -0.6f;
|
||||
s.x = -3.0f; s.y =-2.0f; s.z = 4.0f; s.w = 0.2f;
|
||||
t.x = 0.4f; t.y = 8.3f; t.z = -3.1f; t.w = -2.7f;
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
#include <limits.h>
|
||||
#include "wine/test.h"
|
||||
#include "d3dx9.h"
|
||||
#include "initguid.h"
|
||||
#include "rmxftmpl.h"
|
||||
#include "rmxfguid.h"
|
||||
|
||||
#ifndef NAN
|
||||
/* From wine/port.h */
|
||||
|
@ -11191,6 +11194,182 @@ static void test_D3DXFrameFind(void)
|
|||
ok(ret == &child3, "Unexpected frame, %p.\n", ret);
|
||||
}
|
||||
|
||||
static ID3DXFileData *get_mesh_data(const void *memory, SIZE_T length)
|
||||
{
|
||||
ID3DXFileData *file_data, *ret = NULL;
|
||||
ID3DXFileEnumObject *enum_obj = NULL;
|
||||
D3DXF_FILELOADMEMORY source;
|
||||
ID3DXFile *file;
|
||||
SIZE_T i, count;
|
||||
GUID guid;
|
||||
|
||||
if (FAILED(D3DXFileCreate(&file)))
|
||||
return NULL;
|
||||
|
||||
if (FAILED(file->lpVtbl->RegisterTemplates(file, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES)))
|
||||
goto cleanup;
|
||||
|
||||
source.lpMemory = memory;
|
||||
source.dSize = length;
|
||||
if (FAILED(file->lpVtbl->CreateEnumObject(file, &source, D3DXF_FILELOAD_FROMMEMORY, &enum_obj)))
|
||||
goto cleanup;
|
||||
|
||||
if (FAILED(enum_obj->lpVtbl->GetChildren(enum_obj, &count)))
|
||||
goto cleanup;
|
||||
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
if (FAILED(enum_obj->lpVtbl->GetChild(enum_obj, i, &file_data)))
|
||||
goto cleanup;
|
||||
|
||||
if (SUCCEEDED(file_data->lpVtbl->GetType(file_data, &guid))
|
||||
&& IsEqualGUID(&guid, &TID_D3DRMMesh))
|
||||
{
|
||||
ret = file_data;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_data->lpVtbl->Release(file_data);
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (enum_obj)
|
||||
enum_obj->lpVtbl->Release(enum_obj);
|
||||
file->lpVtbl->Release(file);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void test_load_skin_mesh_from_xof(void)
|
||||
{
|
||||
static const char simple_xfile[] =
|
||||
"xof 0303txt 0032"
|
||||
"Mesh {"
|
||||
"3;"
|
||||
"0.0; 0.0; 0.0;,"
|
||||
"0.0; 1.0; 0.0;,"
|
||||
"1.0; 1.0; 0.0;;"
|
||||
"1;"
|
||||
"3; 0, 1, 2;;"
|
||||
"}";
|
||||
static const D3DVERTEXELEMENT9 expected_declaration[] =
|
||||
{
|
||||
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
|
||||
D3DDECL_END(),
|
||||
};
|
||||
D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE];
|
||||
ID3DXBuffer *adjacency, *materials, *effects;
|
||||
DWORD max_influences[3], count, fvf;
|
||||
D3DPRESENT_PARAMETERS d3dpp;
|
||||
IDirect3DDevice9 *device;
|
||||
ID3DXSkinInfo *skin_info;
|
||||
ID3DXFileData *file_data;
|
||||
const char *bone_name;
|
||||
D3DXMATRIX *matrix;
|
||||
float influence;
|
||||
ID3DXMesh *mesh;
|
||||
IDirect3D9 *d3d;
|
||||
ULONG refcount;
|
||||
HRESULT hr;
|
||||
HWND hwnd;
|
||||
|
||||
if (!(hwnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
|
||||
640, 480, NULL, NULL, NULL, NULL)))
|
||||
{
|
||||
skip("Failed to create application window.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
d3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
if (!d3d)
|
||||
{
|
||||
skip("Failed to create d3d object.\n");
|
||||
DestroyWindow(hwnd);
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&d3dpp, 0, sizeof(d3dpp));
|
||||
d3dpp.Windowed = TRUE;
|
||||
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
|
||||
hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
|
||||
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
|
||||
IDirect3D9_Release(d3d);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
skip("Failed to create device, hr %#x.\n", hr);
|
||||
DestroyWindow(hwnd);
|
||||
return;
|
||||
}
|
||||
|
||||
file_data = get_mesh_data(simple_xfile, sizeof(simple_xfile) - 1);
|
||||
ok(!!file_data, "Failed to load mesh data.\n");
|
||||
|
||||
adjacency = materials = effects = (void *)0xdeadbeef;
|
||||
count = ~0u;
|
||||
skin_info = (void *)0xdeadbeef;
|
||||
mesh = (void *)0xdeadbeef;
|
||||
|
||||
hr = D3DXLoadSkinMeshFromXof(file_data, 0, device, &adjacency, &materials, &effects, &count,
|
||||
&skin_info, &mesh);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!!adjacency, "Got unexpected value %p.\n", adjacency);
|
||||
ok(!materials, "Got unexpected value %p.\n", materials);
|
||||
ok(!effects, "Got unexpected value %p.\n", effects);
|
||||
ok(!count, "Got unexpected value %u.\n", count);
|
||||
ok(!!skin_info, "Got unexpected value %p.\n", skin_info);
|
||||
ok(!!mesh, "Got unexpected value %p.\n", mesh);
|
||||
count = mesh->lpVtbl->GetNumVertices(mesh);
|
||||
ok(count == 3, "Got unexpected value %u.\n", count);
|
||||
count = mesh->lpVtbl->GetNumFaces(mesh);
|
||||
ok(count == 1, "Got unexpected value %u.\n", count);
|
||||
|
||||
hr = skin_info->lpVtbl->GetDeclaration(skin_info, declaration);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
compare_elements(declaration, expected_declaration, __LINE__, 0);
|
||||
|
||||
fvf = skin_info->lpVtbl->GetFVF(skin_info);
|
||||
ok(fvf == D3DFVF_XYZ, "Got unexpected value %u.\n", fvf);
|
||||
|
||||
count = skin_info->lpVtbl->GetNumBones(skin_info);
|
||||
ok(!count, "Got unexpected value %u.\n", count);
|
||||
|
||||
influence = skin_info->lpVtbl->GetMinBoneInfluence(skin_info);
|
||||
ok(!influence, "Got unexpected value %.8e.\n", influence);
|
||||
|
||||
memset(max_influences, 0x55, sizeof(max_influences));
|
||||
hr = skin_info->lpVtbl->GetMaxVertexInfluences(skin_info, max_influences);
|
||||
todo_wine ok(hr == D3D_OK, "Got unexpected value %#x.\n", hr);
|
||||
todo_wine ok(!max_influences[0], "Got unexpected value %u.\n", max_influences[0]);
|
||||
ok(max_influences[1] == 0x55555555, "Got unexpected value %u.\n", max_influences[1]);
|
||||
ok(max_influences[2] == 0x55555555, "Got unexpected value %u.\n", max_influences[2]);
|
||||
|
||||
bone_name = skin_info->lpVtbl->GetBoneName(skin_info, 0);
|
||||
ok(!bone_name, "Got unexpected value %p.\n", bone_name);
|
||||
|
||||
count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 0);
|
||||
ok(!count, "Got unexpected value %u.\n", count);
|
||||
|
||||
count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 1);
|
||||
ok(!count, "Got unexpected value %u.\n", count);
|
||||
|
||||
matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, -1);
|
||||
ok(!matrix, "Got unexpected value %p.\n", matrix);
|
||||
|
||||
matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, 0);
|
||||
ok(!matrix, "Got unexpected value %p.\n", matrix);
|
||||
|
||||
skin_info->lpVtbl->Release(skin_info);
|
||||
mesh->lpVtbl->Release(mesh);
|
||||
adjacency->lpVtbl->Release(adjacency);
|
||||
file_data->lpVtbl->Release(file_data);
|
||||
refcount = IDirect3DDevice9_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
START_TEST(mesh)
|
||||
{
|
||||
D3DXBoundProbeTest();
|
||||
|
@ -11222,4 +11401,5 @@ START_TEST(mesh)
|
|||
test_optimize_faces();
|
||||
test_compute_normals();
|
||||
test_D3DXFrameFind();
|
||||
test_load_skin_mesh_from_xof();
|
||||
}
|
||||
|
|
|
@ -881,8 +881,19 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
|
|||
|
||||
check_release((IUnknown*)surf, 0);
|
||||
|
||||
SetRect(&rect, 1, 1, 2, 2);
|
||||
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 1, 1, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a8b8g8r8,
|
||||
D3DFMT_A8R8G8B8, 8, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY);
|
||||
check_pixel_4bpp(&lockrect, 0, 0, 0x8dc32bf6);
|
||||
IDirect3DSurface9_UnlockRect(surf);
|
||||
check_release((IUnknown *)surf, 0);
|
||||
|
||||
/* test color conversion */
|
||||
SetRect(&rect, 0, 0, 2, 2);
|
||||
/* A8R8G8B8 */
|
||||
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 2, 2, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf, NULL);
|
||||
if(FAILED(hr)) skip("Failed to create a surface (%#x)\n", hr);
|
||||
|
@ -927,17 +938,34 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
|
|||
check_pixel_4bpp(&lockrect, 1, 1, 0xfffe9aff);
|
||||
IDirect3DSurface9_UnlockRect(surf);
|
||||
|
||||
hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a8b8g8r8, D3DFMT_A8B8G8R8, 8, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY);
|
||||
hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a8b8g8r8, D3DFMT_A8B8G8R8,
|
||||
8, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
check_pixel_4bpp(&lockrect, 0, 0, 0xc3f04c39);
|
||||
check_pixel_4bpp(&lockrect, 1, 0, 0x2392e85a);
|
||||
check_pixel_4bpp(&lockrect, 0, 1, 0x09fd97b1);
|
||||
check_pixel_4bpp(&lockrect, 1, 1, 0x8df62bc3);
|
||||
IDirect3DSurface9_UnlockRect(surf);
|
||||
|
||||
hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a2r10g10b10, D3DFMT_A2R10G10B10, 8, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
SetRect(&rect, 0, 0, 1, 1);
|
||||
SetRect(&destrect, 1, 1, 2, 2);
|
||||
hr = D3DXLoadSurfaceFromMemory(surf, NULL, &destrect, pixdata_a8b8g8r8, D3DFMT_A8B8G8R8,
|
||||
8, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY);
|
||||
check_pixel_4bpp(&lockrect, 0, 0, 0xc3f04c39);
|
||||
check_pixel_4bpp(&lockrect, 1, 0, 0x2392e85a);
|
||||
check_pixel_4bpp(&lockrect, 0, 1, 0x09fd97b1);
|
||||
check_pixel_4bpp(&lockrect, 1, 1, 0xc3f04c39);
|
||||
IDirect3DSurface9_UnlockRect(surf);
|
||||
|
||||
SetRect(&rect, 0, 0, 2, 2);
|
||||
|
||||
hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, pixdata_a2r10g10b10, D3DFMT_A2R10G10B10,
|
||||
8, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3DSurface9_LockRect(surf, &lockrect, NULL, D3DLOCK_READONLY);
|
||||
check_pixel_4bpp(&lockrect, 0, 0, 0x555c95bf);
|
||||
check_pixel_4bpp(&lockrect, 1, 0, 0x556d663f);
|
||||
|
@ -1253,16 +1281,30 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
|
|||
|
||||
static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device)
|
||||
{
|
||||
HRESULT hr;
|
||||
RECT rect;
|
||||
ID3DXBuffer *buffer;
|
||||
IDirect3DSurface9 *surface;
|
||||
static const struct
|
||||
{
|
||||
DWORD usage;
|
||||
D3DPOOL pool;
|
||||
}
|
||||
test_access_types[] =
|
||||
{
|
||||
{0, D3DPOOL_MANAGED},
|
||||
{0, D3DPOOL_DEFAULT},
|
||||
{D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT},
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
DWORD magic;
|
||||
struct dds_header header;
|
||||
BYTE *data;
|
||||
} *dds;
|
||||
IDirect3DSurface9 *surface;
|
||||
IDirect3DTexture9 *texture;
|
||||
ID3DXBuffer *buffer;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
RECT rect;
|
||||
|
||||
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 4, 4, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &surface, NULL);
|
||||
if (FAILED(hr)) {
|
||||
|
@ -1317,102 +1359,146 @@ static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device)
|
|||
ID3DXBuffer_Release(buffer);
|
||||
|
||||
IDirect3DSurface9_Release(surface);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(test_access_types); ++i)
|
||||
{
|
||||
hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 0, test_access_types[i].usage,
|
||||
D3DFMT_A8R8G8B8, test_access_types[i].pool, &texture, NULL);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u.\n", hr, i);
|
||||
|
||||
hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u.\n", hr, i);
|
||||
|
||||
hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_DDS, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u.\n", hr, i);
|
||||
ID3DXBuffer_Release(buffer);
|
||||
|
||||
hr = D3DXSaveSurfaceToFileInMemory(&buffer, D3DXIFF_BMP, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u.\n", hr, i);
|
||||
ID3DXBuffer_Release(buffer);
|
||||
|
||||
IDirect3DSurface9_Release(surface);
|
||||
IDirect3DTexture9_Release(texture);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device)
|
||||
{
|
||||
HRESULT hr;
|
||||
IDirect3DSurface9 *surface;
|
||||
RECT rect;
|
||||
D3DLOCKED_RECT lock_rect;
|
||||
D3DXIMAGE_INFO image_info;
|
||||
const BYTE pixels[] = { 0xff, 0x00, 0x00, 0x00, 0xff, 0x00,
|
||||
0x00, 0x00, 0xff, 0x00, 0x00, 0xff };
|
||||
const BYTE pixels[] =
|
||||
{0xff, 0x00, 0x00, 0x00, 0xff, 0x00,
|
||||
0x00, 0x00, 0xff, 0x00, 0x00, 0xff,};
|
||||
DWORD pitch = sizeof(pixels) / 2;
|
||||
IDirect3DSurface9 *surface;
|
||||
D3DXIMAGE_INFO image_info;
|
||||
D3DLOCKED_RECT lock_rect;
|
||||
HRESULT hr;
|
||||
RECT rect;
|
||||
|
||||
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 2, 2, D3DFMT_R8G8B8, D3DPOOL_SCRATCH, &surface, NULL);
|
||||
if (FAILED(hr)) {
|
||||
skip("Couldn't create surface\n");
|
||||
if (FAILED(hr))
|
||||
{
|
||||
skip("Couldn't create surface.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
SetRect(&rect, 0, 0, 2, 2);
|
||||
hr = D3DXLoadSurfaceFromMemory(surface, NULL, NULL, pixels, D3DFMT_R8G8B8, pitch, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
hr = D3DXLoadSurfaceFromMemory(surface, NULL, NULL, pixels, D3DFMT_R8G8B8,
|
||||
pitch, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = D3DXLoadSurfaceFromFileA(surface, NULL, NULL, "saved_surface.bmp", NULL, D3DX_FILTER_NONE, 0, &image_info);
|
||||
ok(hr == D3D_OK, "Couldn't load saved surface %#x\n", hr);
|
||||
if (FAILED(hr)) goto next_tests;
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
ok(image_info.Width == 2, "Wrong width %u\n", image_info.Width);
|
||||
ok(image_info.Height == 2, "Wrong height %u\n", image_info.Height);
|
||||
ok(image_info.Format == D3DFMT_R8G8B8, "Wrong format %#x\n", image_info.Format);
|
||||
ok(image_info.ImageFileFormat == D3DXIFF_BMP, "Wrong file format %u\n", image_info.ImageFileFormat);
|
||||
hr = D3DXLoadSurfaceFromFileA(surface, NULL, NULL, "saved_surface.bmp",
|
||||
NULL, D3DX_FILTER_NONE, 0, &image_info);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DSurface9_LockRect(surface, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Couldn't lock surface %#x\n", hr);
|
||||
if (FAILED(hr)) goto next_tests;
|
||||
ok(image_info.Width == 2, "Wrong width %u.\n", image_info.Width);
|
||||
ok(image_info.Height == 2, "Wrong height %u.\n", image_info.Height);
|
||||
ok(image_info.Format == D3DFMT_R8G8B8, "Wrong format %#x.\n", image_info.Format);
|
||||
ok(image_info.ImageFileFormat == D3DXIFF_BMP, "Wrong file format %u.\n", image_info.ImageFileFormat);
|
||||
|
||||
ok(!memcmp(lock_rect.pBits, pixels, pitch), "Pixel data mismatch in first row\n");
|
||||
ok(!memcmp((BYTE *)lock_rect.pBits + lock_rect.Pitch, pixels + pitch, pitch), "Pixel data mismatch in second row\n");
|
||||
hr = IDirect3DSurface9_LockRect(surface, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
} else skip("Couldn't fill surface\n");
|
||||
ok(!memcmp(lock_rect.pBits, pixels, pitch),
|
||||
"Pixel data mismatch in the first row.\n");
|
||||
ok(!memcmp((BYTE *)lock_rect.pBits + lock_rect.Pitch, pixels + pitch, pitch),
|
||||
"Pixel data mismatch in the second row.\n");
|
||||
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
|
||||
SetRect(&rect, 0, 1, 2, 2);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
SetRect(&rect, 0, 0, 2, 1);
|
||||
hr = D3DXLoadSurfaceFromFileA(surface, NULL, &rect, "saved_surface.bmp", NULL,
|
||||
D3DX_FILTER_NONE, 0, &image_info);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DSurface9_LockRect(surface, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!memcmp(lock_rect.pBits, pixels + pitch, pitch),
|
||||
"Pixel data mismatch in the first row.\n");
|
||||
ok(!memcmp((BYTE *)lock_rect.pBits + lock_rect.Pitch, pixels + pitch, pitch),
|
||||
"Pixel data mismatch in the second row.\n");
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
|
||||
SetRect(&rect, 0, 0, 2, 2);
|
||||
hr = D3DXLoadSurfaceFromMemory(surface, NULL, NULL, pixels, D3DFMT_R8G8B8,
|
||||
pitch, NULL, &rect, D3DX_FILTER_NONE, 0);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
next_tests:
|
||||
hr = D3DXSaveSurfaceToFileA(NULL, D3DXIFF_BMP, surface, NULL, NULL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* PPM and TGA are supported, even though MSDN claims they aren't */
|
||||
todo_wine {
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.ppm", D3DXIFF_PPM, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.tga", D3DXIFF_TGA, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
todo_wine
|
||||
{
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.ppm", D3DXIFF_PPM, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.tga", D3DXIFF_TGA, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
}
|
||||
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.dds", D3DXIFF_DDS, surface, NULL, NULL);
|
||||
ok(hr == D3D_OK, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = D3DXLoadSurfaceFromFileA(surface, NULL, NULL, "saved_surface.dds", NULL, D3DX_FILTER_NONE, 0, &image_info);
|
||||
ok(hr == D3D_OK, "Couldn't load saved surface %#x\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
ok(image_info.Width == 2, "Wrong width %u\n", image_info.Width);
|
||||
ok(image_info.Format == D3DFMT_R8G8B8, "Wrong format %#x\n", image_info.Format);
|
||||
ok(image_info.ImageFileFormat == D3DXIFF_DDS, "Wrong file format %u\n", image_info.ImageFileFormat);
|
||||
hr = D3DXLoadSurfaceFromFileA(surface, NULL, NULL, "saved_surface.dds",
|
||||
NULL, D3DX_FILTER_NONE, 0, &image_info);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirect3DSurface9_LockRect(surface, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Couldn't lock surface %#x\n", hr);
|
||||
if (SUCCEEDED(hr)) {
|
||||
ok(!memcmp(lock_rect.pBits, pixels, pitch), "Pixel data mismatch in first row\n");
|
||||
ok(!memcmp((BYTE *)lock_rect.pBits + lock_rect.Pitch, pixels + pitch, pitch), "Pixel data mismatch in second row\n");
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
}
|
||||
}
|
||||
} else skip("Couldn't save surface\n");
|
||||
ok(image_info.Width == 2, "Wrong width %u.\n", image_info.Width);
|
||||
ok(image_info.Format == D3DFMT_R8G8B8, "Wrong format %#x.\n", image_info.Format);
|
||||
ok(image_info.ImageFileFormat == D3DXIFF_DDS, "Wrong file format %u.\n", image_info.ImageFileFormat);
|
||||
|
||||
hr = IDirect3DSurface9_LockRect(surface, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!memcmp(lock_rect.pBits, pixels, pitch),
|
||||
"Pixel data mismatch in the first row.\n");
|
||||
ok(!memcmp((BYTE *)lock_rect.pBits + lock_rect.Pitch, pixels + pitch, pitch),
|
||||
"Pixel data mismatch in the second row.\n");
|
||||
IDirect3DSurface9_UnlockRect(surface);
|
||||
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface", D3DXIFF_PFM + 1, surface, NULL, NULL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
SetRect(&rect, 0, 0, 4, 4);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
SetRect(&rect, 2, 0, 1, 4);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
SetRect(&rect, 0, 2, 4, 1);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
SetRect(&rect, -1, -1, 2, 2);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
|
||||
SetRectEmpty(&rect);
|
||||
hr = D3DXSaveSurfaceToFileA("saved_surface.bmp", D3DXIFF_BMP, surface, NULL, &rect);
|
||||
/* fails when debug version of d3d9 is used */
|
||||
ok(hr == D3D_OK || broken(hr == D3DERR_INVALIDCALL), "D3DXSaveSurfaceToFileA returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
ok(hr == D3D_OK || broken(hr == D3DERR_INVALIDCALL), "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
DeleteFileA("saved_surface.bmp");
|
||||
DeleteFileA("saved_surface.ppm");
|
||||
|
|
|
@ -1007,59 +1007,103 @@ static void WINAPI fillfunc(D3DXVECTOR4 *value, const D3DXVECTOR2 *texcoord,
|
|||
|
||||
static void test_D3DXFillTexture(IDirect3DDevice9 *device)
|
||||
{
|
||||
static const struct
|
||||
{
|
||||
DWORD usage;
|
||||
D3DPOOL pool;
|
||||
}
|
||||
test_access_types[] =
|
||||
{
|
||||
{0, D3DPOOL_MANAGED},
|
||||
{0, D3DPOOL_DEFAULT},
|
||||
{D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT},
|
||||
};
|
||||
|
||||
IDirect3DTexture9 *tex;
|
||||
HRESULT hr;
|
||||
D3DLOCKED_RECT lock_rect;
|
||||
DWORD x, y, m;
|
||||
DWORD v[4], e[4];
|
||||
DWORD value, expected, size, pitch;
|
||||
unsigned int i;
|
||||
|
||||
size = 4;
|
||||
hr = IDirect3DDevice9_CreateTexture(device, size, size, 0, 0, D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_MANAGED, &tex, NULL);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
for (i = 0; i < ARRAY_SIZE(test_access_types); ++i)
|
||||
{
|
||||
size = 4;
|
||||
hr = IDirect3DDevice9_CreateTexture(device, size, size, 0, test_access_types[i].usage,
|
||||
D3DFMT_A8R8G8B8, test_access_types[i].pool, &tex, NULL);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u.\n", hr, i);
|
||||
|
||||
hr = D3DXFillTexture(tex, fillfunc, NULL);
|
||||
ok(hr == D3D_OK, "D3DXFillTexture returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u.\n", hr, i);
|
||||
|
||||
for (m = 0; m < 3; m++)
|
||||
{
|
||||
hr = IDirect3DTexture9_LockRect(tex, m, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Couldn't lock the texture, error %#x\n", hr);
|
||||
if (SUCCEEDED(hr))
|
||||
IDirect3DSurface9 *src_surface, *temp_surface;
|
||||
|
||||
hr = IDirect3DTexture9_GetSurfaceLevel(tex, m, &src_surface);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u, m %u.\n", hr, i, m);
|
||||
temp_surface = src_surface;
|
||||
|
||||
if (FAILED(hr = IDirect3DSurface9_LockRect(src_surface, &lock_rect, NULL, D3DLOCK_READONLY)))
|
||||
{
|
||||
pitch = lock_rect.Pitch / sizeof(DWORD);
|
||||
for (y = 0; y < size; y++)
|
||||
{
|
||||
for (x = 0; x < size; x++)
|
||||
{
|
||||
value = ((DWORD *)lock_rect.pBits)[y * pitch + x];
|
||||
v[0] = (value >> 24) & 0xff;
|
||||
v[1] = (value >> 16) & 0xff;
|
||||
v[2] = (value >> 8) & 0xff;
|
||||
v[3] = value & 0xff;
|
||||
|
||||
e[0] = 0xff;
|
||||
e[1] = (x + 0.5f) / size * 255.0f + 0.5f;
|
||||
e[2] = (y + 0.5f) / size * 255.0f + 0.5f;
|
||||
e[3] = 255.0f / size + 0.5f;
|
||||
expected = e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3];
|
||||
|
||||
ok(color_match(v, e),
|
||||
"Texel at (%u, %u) doesn't match: %#x, expected %#x\n",
|
||||
x, y, value, expected);
|
||||
}
|
||||
}
|
||||
IDirect3DTexture9_UnlockRect(tex, m);
|
||||
hr = IDirect3DDevice9_CreateRenderTarget(device, size, size,
|
||||
D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &temp_surface, NULL);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u, m %u.\n", hr, i, m);
|
||||
hr = IDirect3DDevice9_StretchRect(device, src_surface, NULL, temp_surface, NULL, D3DTEXF_NONE);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u, m %u.\n", hr, i, m);
|
||||
hr = IDirect3DSurface9_LockRect(temp_surface, &lock_rect, NULL, D3DLOCK_READONLY);
|
||||
ok(hr == D3D_OK, "Unexpected hr %#x, i %u, m %u.\n", hr, i, m);
|
||||
}
|
||||
|
||||
pitch = lock_rect.Pitch / sizeof(DWORD);
|
||||
for (y = 0; y < size; y++)
|
||||
{
|
||||
for (x = 0; x < size; x++)
|
||||
{
|
||||
value = ((DWORD *)lock_rect.pBits)[y * pitch + x];
|
||||
v[0] = (value >> 24) & 0xff;
|
||||
v[1] = (value >> 16) & 0xff;
|
||||
v[2] = (value >> 8) & 0xff;
|
||||
v[3] = value & 0xff;
|
||||
|
||||
e[0] = 0xff;
|
||||
e[1] = (x + 0.5f) / size * 255.0f + 0.5f;
|
||||
e[2] = (y + 0.5f) / size * 255.0f + 0.5f;
|
||||
e[3] = 255.0f / size + 0.5f;
|
||||
expected = e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3];
|
||||
|
||||
ok(color_match(v, e),
|
||||
"Texel at (%u, %u) doesn't match: %#x, expected %#x, i %u, m %u.\n",
|
||||
x, y, value, expected, i, m);
|
||||
}
|
||||
}
|
||||
IDirect3DSurface9_UnlockRect(temp_surface);
|
||||
if (temp_surface != src_surface)
|
||||
IDirect3DSurface9_Release(temp_surface);
|
||||
IDirect3DSurface9_Release(src_surface);
|
||||
size >>= 1;
|
||||
}
|
||||
|
||||
IDirect3DTexture9_Release(tex);
|
||||
}
|
||||
else
|
||||
skip("Failed to create texture\n");
|
||||
|
||||
hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, D3DUSAGE_DEPTHSTENCIL,
|
||||
D3DFMT_D16_LOCKABLE, D3DPOOL_DEFAULT, &tex, NULL);
|
||||
if (hr == D3D_OK)
|
||||
{
|
||||
hr = D3DXFillTexture(tex, fillfunc, NULL);
|
||||
todo_wine ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr);
|
||||
IDirect3DTexture9_Release(tex);
|
||||
}
|
||||
|
||||
hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, D3DUSAGE_DEPTHSTENCIL,
|
||||
D3DFMT_D16, D3DPOOL_DEFAULT, &tex, NULL);
|
||||
if (hr == D3D_OK)
|
||||
{
|
||||
hr = D3DXFillTexture(tex, fillfunc, NULL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
|
||||
IDirect3DTexture9_Release(tex);
|
||||
}
|
||||
|
||||
hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_A1R5G5B5,
|
||||
D3DPOOL_MANAGED, &tex, NULL);
|
||||
|
|
|
@ -1323,6 +1323,7 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
|
|||
|
||||
HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D function, void *funcdata)
|
||||
{
|
||||
IDirect3DSurface9 *surface, *temp_surface;
|
||||
DWORD miplevels;
|
||||
DWORD m, x, y;
|
||||
D3DSURFACE_DESC desc;
|
||||
|
@ -1331,26 +1332,34 @@ HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D f
|
|||
D3DXVECTOR2 coord, size;
|
||||
const struct pixel_format_desc *format;
|
||||
BYTE *data;
|
||||
HRESULT hr;
|
||||
|
||||
if (texture == NULL || function == NULL)
|
||||
TRACE("texture %p, function %p, funcdata %p.\n", texture, function, funcdata);
|
||||
|
||||
if (!texture || !function)
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
miplevels = IDirect3DBaseTexture9_GetLevelCount(texture);
|
||||
|
||||
for (m = 0; m < miplevels; m++)
|
||||
{
|
||||
if (FAILED(IDirect3DTexture9_GetLevelDesc(texture, m, &desc)))
|
||||
return D3DERR_INVALIDCALL;
|
||||
if (FAILED(hr = IDirect3DTexture9_GetLevelDesc(texture, m, &desc)))
|
||||
return hr;
|
||||
|
||||
format = get_format_info(desc.Format);
|
||||
if (format->type != FORMAT_ARGB && format->type != FORMAT_ARGBF16 && format->type != FORMAT_ARGBF)
|
||||
{
|
||||
FIXME("Unsupported texture format %#x\n", desc.Format);
|
||||
FIXME("Unsupported texture format %#x.\n", desc.Format);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (FAILED(IDirect3DTexture9_LockRect(texture, m, &lock_rect, NULL, D3DLOCK_DISCARD)))
|
||||
return D3DERR_INVALIDCALL;
|
||||
if (FAILED(hr = IDirect3DTexture9_GetSurfaceLevel(texture, m, &surface)))
|
||||
return hr;
|
||||
if (FAILED(hr = lock_surface(surface, NULL, &lock_rect, &temp_surface, TRUE)))
|
||||
{
|
||||
IDirect3DSurface9_Release(surface);
|
||||
return hr;
|
||||
}
|
||||
|
||||
size.x = 1.0f / desc.Width;
|
||||
size.y = 1.0f / desc.Height;
|
||||
|
@ -1372,7 +1381,12 @@ HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D f
|
|||
fill_texture(format, data + y * lock_rect.Pitch + x * format->bytes_per_pixel, &value);
|
||||
}
|
||||
}
|
||||
IDirect3DTexture9_UnlockRect(texture, m);
|
||||
if (FAILED(hr = unlock_surface(surface, NULL, &lock_rect, temp_surface, TRUE)))
|
||||
{
|
||||
IDirect3DSurface9_Release(surface);
|
||||
return hr;
|
||||
}
|
||||
IDirect3DSurface9_Release(surface);
|
||||
}
|
||||
|
||||
return D3D_OK;
|
||||
|
|
|
@ -517,6 +517,7 @@ struct d3d_viewport *unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface
|
|||
|
||||
/* Helper functions */
|
||||
void viewport_activate(struct d3d_viewport *viewport, BOOL ignore_lights) DECLSPEC_HIDDEN;
|
||||
void viewport_deactivate(struct d3d_viewport *viewport) DECLSPEC_HIDDEN;
|
||||
void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -819,7 +819,9 @@ static HRESULT WINAPI d3d_device3_DeleteViewport(IDirect3DDevice3 *iface, IDirec
|
|||
|
||||
if (device->current_viewport == vp)
|
||||
{
|
||||
TRACE("Deleting current viewport, unsetting and releasing\n");
|
||||
TRACE("Deleting current viewport, unsetting and releasing.\n");
|
||||
|
||||
viewport_deactivate(vp);
|
||||
IDirect3DViewport3_Release(viewport);
|
||||
device->current_viewport = NULL;
|
||||
}
|
||||
|
@ -1689,48 +1691,42 @@ static HRESULT WINAPI d3d_device1_GetDirect3D(IDirect3DDevice *iface, IDirect3D
|
|||
* (Is a NULL viewport valid?)
|
||||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT WINAPI d3d_device3_SetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Direct3DViewport3)
|
||||
static HRESULT WINAPI d3d_device3_SetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
|
||||
{
|
||||
struct d3d_device *This = impl_from_IDirect3DDevice3(iface);
|
||||
struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport3(Direct3DViewport3);
|
||||
struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport3(viewport);
|
||||
struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
|
||||
|
||||
TRACE("iface %p, viewport %p.\n", iface, Direct3DViewport3);
|
||||
TRACE("iface %p, viewport %p, current_viewport %p.\n", iface, viewport, device->current_viewport);
|
||||
|
||||
if (!vp)
|
||||
{
|
||||
WARN("Direct3DViewport3 is NULL, returning DDERR_INVALIDPARAMS\n");
|
||||
WARN("Direct3DViewport3 is NULL.\n");
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
/* Do nothing if the specified viewport is the same as the current one */
|
||||
if (This->current_viewport == vp)
|
||||
if (device->current_viewport == vp)
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
if (vp->active_device != This)
|
||||
if (vp->active_device != device)
|
||||
{
|
||||
WARN("Viewport %p active device is %p.\n", vp, vp->active_device);
|
||||
WARN("Viewport %p, active device %p.\n", vp, vp->active_device);
|
||||
wined3d_mutex_unlock();
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
/* Release previous viewport and AddRef the new one */
|
||||
if (This->current_viewport)
|
||||
IDirect3DViewport3_AddRef(viewport);
|
||||
if (device->current_viewport)
|
||||
{
|
||||
TRACE("ViewportImpl is at %p, interface is at %p\n", This->current_viewport,
|
||||
&This->current_viewport->IDirect3DViewport3_iface);
|
||||
IDirect3DViewport3_Release(&This->current_viewport->IDirect3DViewport3_iface);
|
||||
viewport_deactivate(device->current_viewport);
|
||||
IDirect3DViewport3_Release(&device->current_viewport->IDirect3DViewport3_iface);
|
||||
}
|
||||
IDirect3DViewport3_AddRef(Direct3DViewport3);
|
||||
|
||||
/* Set this viewport as the current viewport */
|
||||
This->current_viewport = vp;
|
||||
|
||||
/* Activate this viewport */
|
||||
viewport_activate(This->current_viewport, FALSE);
|
||||
device->current_viewport = vp;
|
||||
viewport_activate(device->current_viewport, FALSE);
|
||||
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
@ -3919,7 +3915,20 @@ static HRESULT WINAPI d3d_device2_SetClipStatus(IDirect3DDevice2 *iface, D3DCLIP
|
|||
*****************************************************************************/
|
||||
static HRESULT WINAPI d3d_device7_GetClipStatus(IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
|
||||
{
|
||||
FIXME("iface %p, clip_status %p stub!\n", iface, clip_status);
|
||||
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
|
||||
struct wined3d_viewport vp;
|
||||
|
||||
FIXME("iface %p, clip_status %p stub.\n", iface, clip_status);
|
||||
|
||||
wined3d_device_get_viewports(device->wined3d_device, NULL, &vp);
|
||||
clip_status->minx = vp.x;
|
||||
clip_status->maxx = vp.x + vp.width;
|
||||
clip_status->miny = vp.y;
|
||||
clip_status->maxy = vp.y + vp.height;
|
||||
clip_status->minz = 0.0f;
|
||||
clip_status->maxz = 0.0f;
|
||||
clip_status->dwFlags = D3DCLIPSTATUS_EXTENTS2;
|
||||
clip_status->dwStatus = 0;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
@ -4410,6 +4419,8 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
|
|||
{
|
||||
TRACE("Drawing from D3DVBCAPS_SYSTEMMEMORY vertex buffer, forwarding to DrawIndexedPrimitive().\n");
|
||||
wined3d_mutex_lock();
|
||||
wined3d_box.left = start_vertex * stride;
|
||||
wined3d_box.right = wined3d_box.left + vertex_count * stride;
|
||||
wined3d_resource = wined3d_buffer_get_resource(vb_impl->wined3d_buffer);
|
||||
if (FAILED(hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc,
|
||||
&wined3d_box, WINED3D_MAP_READ)))
|
||||
|
@ -4417,8 +4428,8 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
|
|||
wined3d_mutex_unlock();
|
||||
return D3DERR_VERTEXBUFFERLOCKED;
|
||||
}
|
||||
hr = d3d_device7_DrawIndexedPrimitive(iface, primitive_type, vb_impl->fvf, wined3d_map_desc.data,
|
||||
start_vertex + vertex_count, indices, index_count, flags);
|
||||
hr = d3d_device7_DrawIndexedPrimitive(iface, primitive_type, vb_impl->fvf,
|
||||
wined3d_map_desc.data, vertex_count, indices, index_count, flags);
|
||||
wined3d_resource_unmap(wined3d_resource, 0);
|
||||
wined3d_mutex_unlock();
|
||||
return hr;
|
||||
|
@ -4506,19 +4517,24 @@ static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(IDirect3DDe
|
|||
}
|
||||
|
||||
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB(IDirect3DDevice3 *iface,
|
||||
D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, WORD *Indices,
|
||||
DWORD IndexCount, DWORD Flags)
|
||||
D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer *vertex_buffer,
|
||||
WORD *indices, DWORD index_count, DWORD flags)
|
||||
{
|
||||
struct d3d_vertex_buffer *vb =
|
||||
unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)vertex_buffer);
|
||||
struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
|
||||
struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf);
|
||||
DWORD stride;
|
||||
|
||||
TRACE("iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.\n",
|
||||
iface, PrimitiveType, D3DVertexBuf, Indices, IndexCount, Flags);
|
||||
iface, primitive_type, vertex_buffer, indices, index_count, flags);
|
||||
|
||||
setup_lighting(device, vb->fvf, Flags);
|
||||
setup_lighting(device, vb->fvf, flags);
|
||||
|
||||
return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, PrimitiveType,
|
||||
&vb->IDirect3DVertexBuffer7_iface, 0, IndexCount, Indices, IndexCount, Flags);
|
||||
if (!(stride = get_flexible_vertex_size(vb->fvf)))
|
||||
return D3D_OK;
|
||||
|
||||
return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, primitive_type,
|
||||
&vb->IDirect3DVertexBuffer7_iface, 0, vb->size / stride, indices, index_count, flags);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -121,7 +121,6 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer,
|
|||
}
|
||||
|
||||
index_count = count * primitive_size;
|
||||
|
||||
if (buffer->index_size < index_count)
|
||||
{
|
||||
unsigned int new_size = max(buffer->index_size * 2, index_count);
|
||||
|
@ -317,22 +316,12 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer,
|
|||
case D3DPROCESSVERTICES_TRANSFORMLIGHT:
|
||||
case D3DPROCESSVERTICES_TRANSFORM:
|
||||
wined3d_device_set_stream_source(device->wined3d_device, 0,
|
||||
buffer->src_vertex_buffer, buffer->src_vertex_pos, sizeof(D3DVERTEX));
|
||||
if (op == D3DPROCESSVERTICES_TRANSFORMLIGHT)
|
||||
{
|
||||
wined3d_device_set_vertex_declaration(device->wined3d_device,
|
||||
ddraw_find_decl(device->ddraw, D3DFVF_VERTEX));
|
||||
wined3d_device_set_render_state(device->wined3d_device,
|
||||
WINED3D_RS_LIGHTING, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
wined3d_device_set_vertex_declaration(device->wined3d_device,
|
||||
ddraw_find_decl(device->ddraw, D3DFVF_LVERTEX));
|
||||
wined3d_device_set_render_state(device->wined3d_device,
|
||||
WINED3D_RS_LIGHTING, FALSE);
|
||||
}
|
||||
|
||||
buffer->src_vertex_buffer, buffer->src_vertex_pos * sizeof(D3DVERTEX), sizeof(D3DVERTEX));
|
||||
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_LIGHTING,
|
||||
op == D3DPROCESSVERTICES_TRANSFORMLIGHT && !!device->material);
|
||||
wined3d_device_set_vertex_declaration(device->wined3d_device,
|
||||
ddraw_find_decl(device->ddraw, op == D3DPROCESSVERTICES_TRANSFORMLIGHT
|
||||
? D3DFVF_VERTEX : D3DFVF_LVERTEX));
|
||||
wined3d_device_process_vertices(device->wined3d_device, ci->wStart, ci->wDest,
|
||||
ci->dwCount, buffer->dst_vertex_buffer, NULL, 0, D3DFVF_TLVERTEX);
|
||||
break;
|
||||
|
|
|
@ -54,15 +54,14 @@ void light_activate(struct d3d_light *light)
|
|||
|
||||
TRACE("light %p.\n", light);
|
||||
|
||||
if (!light->active_viewport || !light->active_viewport->active_device) return;
|
||||
if (!light->active_viewport || !light->active_viewport->active_device
|
||||
|| light->active_viewport->active_device->current_viewport != light->active_viewport)
|
||||
return;
|
||||
device = light->active_viewport->active_device;
|
||||
|
||||
light_update(light);
|
||||
if (!(light->light.dwFlags & D3DLIGHT_ACTIVE))
|
||||
{
|
||||
if (light->light.dwFlags & D3DLIGHT_ACTIVE)
|
||||
IDirect3DDevice7_LightEnable(&device->IDirect3DDevice7_iface, light->dwLightIndex, TRUE);
|
||||
light->light.dwFlags |= D3DLIGHT_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -78,14 +77,13 @@ void light_deactivate(struct d3d_light *light)
|
|||
|
||||
TRACE("light %p.\n", light);
|
||||
|
||||
if (!light->active_viewport || !light->active_viewport->active_device) return;
|
||||
device = light->active_viewport->active_device;
|
||||
if (!light->active_viewport || !light->active_viewport->active_device
|
||||
|| light->active_viewport->active_device->current_viewport != light->active_viewport)
|
||||
return;
|
||||
|
||||
device = light->active_viewport->active_device;
|
||||
if (light->light.dwFlags & D3DLIGHT_ACTIVE)
|
||||
{
|
||||
IDirect3DDevice7_LightEnable(&device->IDirect3DDevice7_iface, light->dwLightIndex, FALSE);
|
||||
light->light.dwFlags &= ~D3DLIGHT_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
static inline struct d3d_light *impl_from_IDirect3DLight(IDirect3DLight *iface)
|
||||
|
@ -195,13 +193,12 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
|
|||
|
||||
wined3d_mutex_lock();
|
||||
memcpy(&light->light, data, sizeof(*data));
|
||||
if (!(light->light.dwFlags & D3DLIGHT_ACTIVE) && flags & D3DLIGHT_ACTIVE)
|
||||
light_activate(light);
|
||||
else if (light->light.dwFlags & D3DLIGHT_ACTIVE && !(flags & D3DLIGHT_ACTIVE))
|
||||
|
||||
if (!(flags & D3DLIGHT_ACTIVE))
|
||||
light_deactivate(light);
|
||||
else if (flags & D3DLIGHT_ACTIVE)
|
||||
light_update(light);
|
||||
|
||||
light->light.dwFlags = flags;
|
||||
light_activate(light);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return D3D_OK;
|
||||
|
|
|
@ -760,38 +760,47 @@ static ULONG WINAPI d3d_texture1_Release(IDirect3DTexture *iface)
|
|||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *iface,
|
||||
DDSCAPS2 *Caps, IDirectDrawSurface7 **Surface)
|
||||
DDSCAPS2 *caps, IDirectDrawSurface7 **surface)
|
||||
{
|
||||
struct ddraw_surface *This = impl_from_IDirectDrawSurface7(iface);
|
||||
struct ddraw_surface *head_surface = impl_from_IDirectDrawSurface7(iface);
|
||||
struct ddraw_surface *surf;
|
||||
DDSCAPS2 our_caps;
|
||||
int i;
|
||||
|
||||
TRACE("iface %p, caps %p, attachment %p.\n", iface, Caps, Surface);
|
||||
TRACE("iface %p, caps %p, attachment %p.\n", iface, caps, surface);
|
||||
|
||||
if (IDirectDrawSurface7_IsLost(&head_surface->IDirectDrawSurface7_iface) != DD_OK)
|
||||
{
|
||||
WARN("Surface %p is lost.\n", head_surface);
|
||||
|
||||
*surface = NULL;
|
||||
return DDERR_SURFACELOST;
|
||||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
if(This->version < 7)
|
||||
if(head_surface->version < 7)
|
||||
{
|
||||
/* Earlier dx apps put garbage into these members, clear them */
|
||||
our_caps.dwCaps = Caps->dwCaps;
|
||||
our_caps.dwCaps = caps->dwCaps;
|
||||
our_caps.dwCaps2 = 0;
|
||||
our_caps.dwCaps3 = 0;
|
||||
our_caps.u1.dwCaps4 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
our_caps = *Caps;
|
||||
our_caps = *caps;
|
||||
}
|
||||
|
||||
TRACE("(%p): Looking for caps: %x,%x,%x,%x\n", This, our_caps.dwCaps, our_caps.dwCaps2, our_caps.dwCaps3, our_caps.u1.dwCaps4); /* FIXME: Better debugging */
|
||||
TRACE("head_surface %p, looking for caps %#x, %#x, %#x, %#x.\n", head_surface, our_caps.dwCaps,
|
||||
our_caps.dwCaps2, our_caps.dwCaps3, our_caps.u1.dwCaps4); /* FIXME: Better debugging */
|
||||
|
||||
for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
|
||||
{
|
||||
surf = This->complex_array[i];
|
||||
surf = head_surface->complex_array[i];
|
||||
if(!surf) break;
|
||||
|
||||
TRACE("Surface: (%p) caps: %#x, %#x, %#x, %#x.\n", surf,
|
||||
TRACE("Surface %p, caps %#x, %#x, %#x, %#x.\n", surf,
|
||||
surf->surface_desc.ddsCaps.dwCaps,
|
||||
surf->surface_desc.ddsCaps.dwCaps2,
|
||||
surf->surface_desc.ddsCaps.dwCaps3,
|
||||
|
@ -806,9 +815,9 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
|
|||
* Not sure how to test this.
|
||||
*/
|
||||
|
||||
TRACE("(%p): Returning surface %p\n", This, surf);
|
||||
*Surface = &surf->IDirectDrawSurface7_iface;
|
||||
ddraw_surface7_AddRef(*Surface);
|
||||
TRACE("head_surface %p, returning surface %p.\n", head_surface, surf);
|
||||
*surface = &surf->IDirectDrawSurface7_iface;
|
||||
ddraw_surface7_AddRef(*surface);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return DD_OK;
|
||||
|
@ -816,11 +825,11 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
|
|||
}
|
||||
|
||||
/* Next, look at the attachment chain */
|
||||
surf = This;
|
||||
surf = head_surface;
|
||||
|
||||
while( (surf = surf->next_attached) )
|
||||
{
|
||||
TRACE("Surface: (%p) caps: %#x, %#x, %#x, %#x.\n", surf,
|
||||
TRACE("Surface %p, caps %#x, %#x, %#x, %#x.\n", surf,
|
||||
surf->surface_desc.ddsCaps.dwCaps,
|
||||
surf->surface_desc.ddsCaps.dwCaps2,
|
||||
surf->surface_desc.ddsCaps.dwCaps3,
|
||||
|
@ -829,19 +838,19 @@ static HRESULT WINAPI ddraw_surface7_GetAttachedSurface(IDirectDrawSurface7 *ifa
|
|||
if (((surf->surface_desc.ddsCaps.dwCaps & our_caps.dwCaps) == our_caps.dwCaps) &&
|
||||
((surf->surface_desc.ddsCaps.dwCaps2 & our_caps.dwCaps2) == our_caps.dwCaps2)) {
|
||||
|
||||
TRACE("(%p): Returning surface %p\n", This, surf);
|
||||
*Surface = &surf->IDirectDrawSurface7_iface;
|
||||
ddraw_surface7_AddRef(*Surface);
|
||||
TRACE("head_surface %p, returning surface %p.\n", head_surface, surf);
|
||||
*surface = &surf->IDirectDrawSurface7_iface;
|
||||
ddraw_surface7_AddRef(*surface);
|
||||
wined3d_mutex_unlock();
|
||||
return DD_OK;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("(%p) Didn't find a valid surface\n", This);
|
||||
TRACE("head_surface %p, didn't find a valid surface.\n", head_surface);
|
||||
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
*Surface = NULL;
|
||||
*surface = NULL;
|
||||
return DDERR_NOTFOUND;
|
||||
}
|
||||
|
||||
|
@ -3720,6 +3729,7 @@ static HRESULT WINAPI ddraw_surface1_IsLost(IDirectDrawSurface *iface)
|
|||
static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface)
|
||||
{
|
||||
struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface);
|
||||
unsigned int i;
|
||||
|
||||
TRACE("iface %p.\n", iface);
|
||||
|
||||
|
@ -3760,6 +3770,12 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface)
|
|||
ddraw_update_lost_surfaces(surface->ddraw);
|
||||
surface->is_lost = FALSE;
|
||||
|
||||
for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
|
||||
{
|
||||
if (surface->complex_array[i])
|
||||
surface->complex_array[i]->is_lost = FALSE;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
@ -6339,6 +6355,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
|||
{
|
||||
mip = wined3d_texture_get_sub_resource_parent(wined3d_texture, i * levels + j);
|
||||
mip_desc = &mip->surface_desc;
|
||||
if (desc->ddsCaps.dwCaps & DDSCAPS_MIPMAP)
|
||||
mip_desc->u2.dwMipMapCount = levels - j;
|
||||
|
||||
if (j)
|
||||
{
|
||||
|
|
|
@ -5396,10 +5396,10 @@ static void test_create_surface_pitch(void)
|
|||
|
||||
static void test_mipmap(void)
|
||||
{
|
||||
IDirectDrawSurface *surface, *surface2;
|
||||
IDirectDrawSurface *surface, *surface_base, *surface_mip;
|
||||
unsigned int i, mipmap_count;
|
||||
DDSURFACEDESC surface_desc;
|
||||
IDirectDraw *ddraw;
|
||||
unsigned int i;
|
||||
ULONG refcount;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
|
@ -5468,24 +5468,45 @@ static void test_mipmap(void)
|
|||
ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out,
|
||||
"Test %u: Got unexpected mipmap count %u.\n", i, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
if (U2(surface_desc).dwMipMapCount > 1)
|
||||
surface_base = surface;
|
||||
IDirectDrawSurface2_AddRef(surface_base);
|
||||
mipmap_count = U2(surface_desc).dwMipMapCount;
|
||||
while (mipmap_count > 1)
|
||||
{
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to get attached surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface_base, &caps, &surface_mip);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get attached surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface_GetSurfaceDesc(surface_base, &surface_desc);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
|
||||
"Test %u, %u: Got unexpected flags %#x.\n", i, mipmap_count, surface_desc.dwFlags);
|
||||
ok(U2(surface_desc).dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: Got unexpected mipmap count %u.\n",
|
||||
i, mipmap_count, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface_Lock(surface2, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
IDirectDrawSurface_Unlock(surface2, NULL);
|
||||
IDirectDrawSurface_Unlock(surface, NULL);
|
||||
hr = IDirectDrawSurface_Lock(surface_base, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: unexpected change of mipmap count %u.\n",
|
||||
i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface_Lock(surface_mip, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count - 1,
|
||||
"Test %u, %u: Child mipmap count unexpected %u\n", i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
IDirectDrawSurface_Unlock(surface_mip, NULL);
|
||||
IDirectDrawSurface_Unlock(surface_base, NULL);
|
||||
|
||||
IDirectDrawSurface_Release(surface2);
|
||||
IDirectDrawSurface_Release(surface_base);
|
||||
surface_base = surface_mip;
|
||||
--mipmap_count;
|
||||
}
|
||||
IDirectDrawSurface_Release(surface_base);
|
||||
|
||||
IDirectDrawSurface_Release(surface);
|
||||
}
|
||||
|
@ -6714,11 +6735,12 @@ static void test_palette_alpha(void)
|
|||
|
||||
static void test_lost_device(void)
|
||||
{
|
||||
IDirectDrawSurface *surface;
|
||||
IDirectDrawSurface *surface, *back_buffer;
|
||||
DDSURFACEDESC surface_desc;
|
||||
HWND window1, window2;
|
||||
IDirectDraw *ddraw;
|
||||
ULONG refcount;
|
||||
DDSCAPS caps;
|
||||
HRESULT hr;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -6856,6 +6878,19 @@ static void test_lost_device(void)
|
|||
hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.dwCaps = DDSCAPS_FLIP;
|
||||
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface_Restore(surface);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface_IsLost(back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirectDrawSurface_Release(back_buffer);
|
||||
|
||||
IDirectDrawSurface_Release(surface);
|
||||
refcount = IDirectDraw_Release(ddraw);
|
||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||
|
|
|
@ -6422,10 +6422,10 @@ static void test_create_surface_pitch(void)
|
|||
static void test_mipmap(void)
|
||||
{
|
||||
IDirectDrawSurface *surface1;
|
||||
IDirectDrawSurface2 *surface, *surface2;
|
||||
IDirectDrawSurface2 *surface, *surface_base, *surface_mip;
|
||||
unsigned int i, mipmap_count;
|
||||
DDSURFACEDESC surface_desc;
|
||||
IDirectDraw2 *ddraw;
|
||||
unsigned int i;
|
||||
ULONG refcount;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
|
@ -6498,24 +6498,45 @@ static void test_mipmap(void)
|
|||
ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out,
|
||||
"Test %u: Got unexpected mipmap count %u.\n", i, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
if (U2(surface_desc).dwMipMapCount > 1)
|
||||
surface_base = surface;
|
||||
IDirectDrawSurface2_AddRef(surface_base);
|
||||
mipmap_count = U2(surface_desc).dwMipMapCount;
|
||||
while (mipmap_count > 1)
|
||||
{
|
||||
hr = IDirectDrawSurface2_GetAttachedSurface(surface, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to get attached surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface2_GetAttachedSurface(surface_base, &caps, &surface_mip);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get attached surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface2_Lock(surface, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface2_GetSurfaceDesc(surface_base, &surface_desc);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
|
||||
"Test %u, %u: Got unexpected flags %#x.\n", i, mipmap_count, surface_desc.dwFlags);
|
||||
ok(U2(surface_desc).dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: Got unexpected mipmap count %u.\n",
|
||||
i, mipmap_count, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface2_Lock(surface2, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
IDirectDrawSurface2_Unlock(surface2, NULL);
|
||||
IDirectDrawSurface2_Unlock(surface, NULL);
|
||||
hr = IDirectDrawSurface2_Lock(surface_base, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: unexpected change of mipmap count %u.\n",
|
||||
i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface2_Lock(surface_mip, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count - 1,
|
||||
"Test %u, %u: Child mipmap count unexpected %u\n", i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
IDirectDrawSurface2_Unlock(surface_mip, NULL);
|
||||
IDirectDrawSurface2_Unlock(surface_base, NULL);
|
||||
|
||||
IDirectDrawSurface2_Release(surface2);
|
||||
IDirectDrawSurface2_Release(surface_base);
|
||||
surface_base = surface_mip;
|
||||
--mipmap_count;
|
||||
}
|
||||
IDirectDrawSurface2_Release(surface_base);
|
||||
|
||||
IDirectDrawSurface2_Release(surface);
|
||||
}
|
||||
|
@ -7984,11 +8005,12 @@ static void test_palette_alpha(void)
|
|||
|
||||
static void test_lost_device(void)
|
||||
{
|
||||
IDirectDrawSurface *surface;
|
||||
IDirectDrawSurface *surface, *back_buffer;
|
||||
DDSURFACEDESC surface_desc;
|
||||
HWND window1, window2;
|
||||
IDirectDraw2 *ddraw;
|
||||
ULONG refcount;
|
||||
DDSCAPS caps;
|
||||
HRESULT hr;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -8126,6 +8148,19 @@ static void test_lost_device(void)
|
|||
hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.dwCaps = DDSCAPS_FLIP;
|
||||
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface_Restore(surface);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface_IsLost(back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirectDrawSurface_Release(back_buffer);
|
||||
|
||||
IDirectDrawSurface_Release(surface);
|
||||
refcount = IDirectDraw2_Release(ddraw);
|
||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||
|
|
|
@ -4051,21 +4051,21 @@ static void test_lighting(void)
|
|||
{&mat_nonaffine, translatedquad, 0x000000ff, "Lit quad with non-affine matrix"},
|
||||
};
|
||||
|
||||
HWND window;
|
||||
IDirect3D3 *d3d;
|
||||
DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL;
|
||||
IDirect3DViewport3 *viewport, *viewport2;
|
||||
DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE;
|
||||
IDirect3DMaterial3 *material;
|
||||
D3DMATERIALHANDLE mat_handle;
|
||||
IDirect3DDevice3 *device;
|
||||
IDirectDrawSurface4 *rt;
|
||||
IDirect3DViewport3 *viewport;
|
||||
IDirect3DMaterial3 *material;
|
||||
IDirect3DLight *light;
|
||||
D3DMATERIALHANDLE mat_handle;
|
||||
D3DLIGHT2 light_desc;
|
||||
HRESULT hr;
|
||||
DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE;
|
||||
DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL;
|
||||
IDirect3D3 *d3d;
|
||||
D3DCOLOR color;
|
||||
ULONG refcount;
|
||||
unsigned int i;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
|
||||
window = create_window();
|
||||
if (!(device = create_device(window, DDSCL_NORMAL)))
|
||||
|
@ -4160,9 +4160,16 @@ static void test_lighting(void)
|
|||
U4(light_desc.dcvColor).a = 1.0f;
|
||||
U3(light_desc.dvDirection).z = 1.0f;
|
||||
hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc);
|
||||
ok(SUCCEEDED(hr), "Failed to set light, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DViewport3_AddLight(viewport, light);
|
||||
ok(SUCCEEDED(hr), "Failed to add a light to the viewport, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DViewport3_AddLight(viewport, light);
|
||||
ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
viewport2 = create_viewport(device, 0, 0, 640, 480);
|
||||
hr = IDirect3DViewport3_AddLight(viewport2, light);
|
||||
ok(hr == D3DERR_LIGHTHASVIEWPORT, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3DViewport3_Release(viewport2);
|
||||
|
||||
hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0);
|
||||
ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr);
|
||||
|
@ -4182,7 +4189,16 @@ static void test_lighting(void)
|
|||
|
||||
light_desc.dwFlags = D3DLIGHT_ACTIVE;
|
||||
hr = IDirect3DLight_SetLight(light, (D3DLIGHT *)&light_desc);
|
||||
ok(SUCCEEDED(hr), "Failed to set light, hr %#x.\n", hr);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DViewport3_DeleteLight(viewport, light);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
light_desc.dwFlags = 0;
|
||||
hr = IDirect3DLight_GetLight(light, (D3DLIGHT *)&light_desc);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(light_desc.dwFlags == D3DLIGHT_ACTIVE, "Got unexpected flags %#x.\n", light_desc.dwFlags);
|
||||
|
||||
hr = IDirect3DViewport3_AddLight(viewport, light);
|
||||
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tests); ++i)
|
||||
{
|
||||
|
@ -7954,10 +7970,10 @@ static void test_create_surface_pitch(void)
|
|||
|
||||
static void test_mipmap(void)
|
||||
{
|
||||
IDirectDrawSurface4 *surface, *surface2;
|
||||
IDirectDrawSurface4 *surface, *surface_base, *surface_mip;
|
||||
unsigned int i, mipmap_count;
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
IDirectDraw4 *ddraw;
|
||||
unsigned int i;
|
||||
ULONG refcount;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
|
@ -8026,24 +8042,45 @@ static void test_mipmap(void)
|
|||
ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out,
|
||||
"Test %u: Got unexpected mipmap count %u.\n", i, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
if (U2(surface_desc).dwMipMapCount > 1)
|
||||
surface_base = surface;
|
||||
IDirectDrawSurface4_AddRef(surface_base);
|
||||
mipmap_count = U2(surface_desc).dwMipMapCount;
|
||||
while (mipmap_count > 1)
|
||||
{
|
||||
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to get attached surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface4_GetAttachedSurface(surface_base, &caps, &surface_mip);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get attached surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface4_Lock(surface, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface4_GetSurfaceDesc(surface_base, &surface_desc);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
|
||||
"Test %u, %u: Got unexpected flags %#x.\n", i, mipmap_count, surface_desc.dwFlags);
|
||||
ok(U2(surface_desc).dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: Got unexpected mipmap count %u.\n",
|
||||
i, mipmap_count, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface4_Lock(surface2, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
IDirectDrawSurface4_Unlock(surface2, NULL);
|
||||
IDirectDrawSurface4_Unlock(surface, NULL);
|
||||
hr = IDirectDrawSurface4_Lock(surface_base, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: unexpected change of mipmap count %u.\n",
|
||||
i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface4_Lock(surface_mip, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count - 1,
|
||||
"Test %u, %u: Child mipmap count unexpected %u\n", i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
IDirectDrawSurface4_Unlock(surface_mip, NULL);
|
||||
IDirectDrawSurface4_Unlock(surface_base, NULL);
|
||||
|
||||
IDirectDrawSurface4_Release(surface2);
|
||||
IDirectDrawSurface4_Release(surface_base);
|
||||
surface_base = surface_mip;
|
||||
--mipmap_count;
|
||||
}
|
||||
IDirectDrawSurface4_Release(surface_base);
|
||||
|
||||
IDirectDrawSurface4_Release(surface);
|
||||
}
|
||||
|
@ -9001,11 +9038,12 @@ static void test_vb_writeonly(void)
|
|||
|
||||
static void test_lost_device(void)
|
||||
{
|
||||
IDirectDrawSurface4 *surface;
|
||||
IDirectDrawSurface4 *surface, *back_buffer;
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
HWND window1, window2;
|
||||
IDirectDraw4 *ddraw;
|
||||
ULONG refcount;
|
||||
DDSCAPS2 caps;
|
||||
HRESULT hr;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -9172,9 +9210,23 @@ static void test_lost_device(void)
|
|||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface4_IsLost(surface);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.dwCaps = DDSCAPS_FLIP;
|
||||
|
||||
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface4_Restore(surface);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface4_IsLost(back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirectDrawSurface4_Release(back_buffer);
|
||||
|
||||
IDirectDrawSurface4_Release(surface);
|
||||
refcount = IDirectDraw4_Release(ddraw);
|
||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||
|
@ -15442,12 +15494,16 @@ static void test_sysmem_draw(void)
|
|||
}
|
||||
quad[] =
|
||||
{
|
||||
{{ 0.0f, 0.0f, 0.0f}, 0x00000000},
|
||||
{{ 0.0f, 0.0f, 0.0f}, 0x00000000},
|
||||
{{ 0.0f, 0.0f, 0.0f}, 0x00000000},
|
||||
{{ 0.0f, 0.0f, 0.0f}, 0x00000000},
|
||||
{{-1.0f, -1.0f, 0.0f}, 0xffff0000},
|
||||
{{-1.0f, 1.0f, 0.0f}, 0xff00ff00},
|
||||
{{ 1.0f, -1.0f, 0.0f}, 0xff0000ff},
|
||||
{{ 1.0f, 1.0f, 0.0f}, 0xffffffff},
|
||||
};
|
||||
static WORD indices[] = {0, 1, 2, 3};
|
||||
static WORD indices[] = {4, 5, 6, 7};
|
||||
|
||||
window = create_window();
|
||||
ok(!!window, "Failed to create a window.\n");
|
||||
|
@ -15474,7 +15530,7 @@ static void test_sysmem_draw(void)
|
|||
vb_desc.dwSize = sizeof(vb_desc);
|
||||
vb_desc.dwCaps = D3DVBCAPS_SYSTEMMEMORY;
|
||||
vb_desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;
|
||||
vb_desc.dwNumVertices = 4;
|
||||
vb_desc.dwNumVertices = ARRAY_SIZE(quad);
|
||||
hr = IDirect3D3_CreateVertexBuffer(d3d, &vb_desc, &vb, 0, NULL);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
|
@ -15489,7 +15545,7 @@ static void test_sysmem_draw(void)
|
|||
|
||||
hr = IDirect3DDevice3_BeginScene(device);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0);
|
||||
hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 4, 4, 0);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice3_EndScene(device);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
|
|
@ -996,6 +996,7 @@ static void test_coop_level_d3d_state(void)
|
|||
IDirectDraw7 *ddraw;
|
||||
IDirect3D7 *d3d;
|
||||
D3DCOLOR color;
|
||||
DDSCAPS2 caps;
|
||||
DWORD value;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
|
@ -1009,44 +1010,63 @@ static void test_coop_level_d3d_state(void)
|
|||
}
|
||||
|
||||
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
|
||||
ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_ZENABLE, &value);
|
||||
ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!!value, "Got unexpected z-enable state %#x.\n", value);
|
||||
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
|
||||
ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!value, "Got unexpected alpha blend enable state %#x.\n", value);
|
||||
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
|
||||
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0);
|
||||
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = get_surface_color(rt, 320, 240);
|
||||
ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
|
||||
hr = IDirect3DDevice7_GetDirect3D(device, &d3d);
|
||||
ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw);
|
||||
ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirect3D7_Release(d3d);
|
||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface7_IsLost(rt);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.dwCaps = DDSCAPS_ZBUFFER;
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
caps.dwCaps = DDSCAPS_FLIP;
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IDirectDraw7_RestoreAllSurfaces(ddraw);
|
||||
ok(SUCCEEDED(hr), "Failed to restore surfaces, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
caps.dwCaps = DDSCAPS_ZBUFFER;
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirectDrawSurface7_Release(surface);
|
||||
|
||||
caps.dwCaps = DDSCAPS_FLIP;
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(rt, &caps, &surface);
|
||||
ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
IDirectDraw7_Release(ddraw);
|
||||
|
||||
hr = IDirect3DDevice7_GetRenderTarget(device, &surface);
|
||||
ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(surface == rt, "Got unexpected surface %p.\n", surface);
|
||||
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_ZENABLE, &value);
|
||||
ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!!value, "Got unexpected z-enable state %#x.\n", value);
|
||||
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
|
||||
ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(!!value, "Got unexpected alpha blend enable state %#x.\n", value);
|
||||
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0);
|
||||
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
color = get_surface_color(rt, 320, 240);
|
||||
ok(compare_color(color, 0x0000ff00, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
|
||||
|
@ -7788,10 +7808,10 @@ static void test_create_surface_pitch(void)
|
|||
|
||||
static void test_mipmap(void)
|
||||
{
|
||||
IDirectDrawSurface7 *surface, *surface2;
|
||||
IDirectDrawSurface7 *surface, *surface_base, *surface_mip;
|
||||
unsigned int i, mipmap_count;
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
IDirectDraw7 *ddraw;
|
||||
unsigned int i;
|
||||
ULONG refcount;
|
||||
HWND window;
|
||||
HRESULT hr;
|
||||
|
@ -7861,24 +7881,45 @@ static void test_mipmap(void)
|
|||
ok(U2(surface_desc).dwMipMapCount == tests[i].mipmap_count_out,
|
||||
"Test %u: Got unexpected mipmap count %u.\n", i, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
if (U2(surface_desc).dwMipMapCount > 1)
|
||||
surface_base = surface;
|
||||
IDirectDrawSurface7_AddRef(surface_base);
|
||||
mipmap_count = U2(surface_desc).dwMipMapCount;
|
||||
while (mipmap_count > 1)
|
||||
{
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &surface2);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to get attached surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(surface_base, &caps, &surface_mip);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get attached surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface7_Lock(surface, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
hr = IDirectDrawSurface7_GetSurfaceDesc(surface_base, &surface_desc);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to get surface desc, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwFlags & DDSD_MIPMAPCOUNT,
|
||||
"Test %u, %u: Got unexpected flags %#x.\n", i, mipmap_count, surface_desc.dwFlags);
|
||||
ok(U2(surface_desc).dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: Got unexpected mipmap count %u.\n",
|
||||
i, mipmap_count, U2(surface_desc).dwMipMapCount);
|
||||
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface7_Lock(surface2, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u: Failed to lock surface, hr %#x.\n", i, hr);
|
||||
IDirectDrawSurface7_Unlock(surface2, NULL);
|
||||
IDirectDrawSurface7_Unlock(surface, NULL);
|
||||
hr = IDirectDrawSurface7_Lock(surface_base, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count,
|
||||
"Test %u, %u: unexpected change of mipmap count %u.\n",
|
||||
i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
hr = IDirectDrawSurface7_Lock(surface_mip, NULL, &surface_desc, 0, NULL);
|
||||
ok(SUCCEEDED(hr), "Test %u, %u: Failed to lock surface, hr %#x.\n", i, mipmap_count, hr);
|
||||
ok(surface_desc.dwMipMapCount == mipmap_count - 1,
|
||||
"Test %u, %u: Child mipmap count unexpected %u\n", i, mipmap_count, surface_desc.dwMipMapCount);
|
||||
IDirectDrawSurface7_Unlock(surface_mip, NULL);
|
||||
IDirectDrawSurface7_Unlock(surface_base, NULL);
|
||||
|
||||
IDirectDrawSurface7_Release(surface2);
|
||||
IDirectDrawSurface7_Release(surface_base);
|
||||
surface_base = surface_mip;
|
||||
--mipmap_count;
|
||||
}
|
||||
IDirectDrawSurface7_Release(surface_base);
|
||||
|
||||
IDirectDrawSurface7_Release(surface);
|
||||
}
|
||||
|
@ -8736,11 +8777,12 @@ static void test_vb_writeonly(void)
|
|||
|
||||
static void test_lost_device(void)
|
||||
{
|
||||
IDirectDrawSurface7 *surface;
|
||||
IDirectDrawSurface7 *surface, *back_buffer;
|
||||
DDSURFACEDESC2 surface_desc;
|
||||
HWND window1, window2;
|
||||
IDirectDraw7 *ddraw;
|
||||
ULONG refcount;
|
||||
DDSCAPS2 caps;
|
||||
HRESULT hr;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -8910,6 +8952,19 @@ static void test_lost_device(void)
|
|||
hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.dwCaps = DDSCAPS_FLIP;
|
||||
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface7_Restore(surface);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = IDirectDrawSurface7_IsLost(back_buffer);
|
||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
IDirectDrawSurface7_Release(back_buffer);
|
||||
|
||||
IDirectDrawSurface7_Release(surface);
|
||||
refcount = IDirectDraw7_Release(ddraw);
|
||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||
|
|
|
@ -112,6 +112,16 @@ void viewport_activate(struct d3d_viewport *This, BOOL ignore_lights)
|
|||
IDirect3DDevice7_SetViewport(&This->active_device->IDirect3DDevice7_iface, &vp);
|
||||
}
|
||||
|
||||
void viewport_deactivate(struct d3d_viewport *viewport)
|
||||
{
|
||||
struct d3d_light *light;
|
||||
|
||||
LIST_FOR_EACH_ENTRY(light, &viewport->light_list, struct d3d_light, entry)
|
||||
{
|
||||
light_deactivate(light);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* _dump_D3DVIEWPORT, _dump_D3DVIEWPORT2
|
||||
*
|
||||
|
@ -760,6 +770,13 @@ static HRESULT WINAPI d3d_viewport_AddLight(IDirect3DViewport3 *iface, IDirect3D
|
|||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
if (light_impl->active_viewport)
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
WARN("Light %p is active in viewport %p.\n", light_impl, light_impl->active_viewport);
|
||||
return D3DERR_LIGHTHASVIEWPORT;
|
||||
}
|
||||
|
||||
/* Find a light number and update both light and viewports objects accordingly */
|
||||
while (map & 1)
|
||||
{
|
||||
|
@ -776,14 +793,7 @@ static HRESULT WINAPI d3d_viewport_AddLight(IDirect3DViewport3 *iface, IDirect3D
|
|||
|
||||
/* Attach the light to the viewport */
|
||||
light_impl->active_viewport = This;
|
||||
|
||||
/* If active, activate the light */
|
||||
if (This->active_device && light_impl->light.dwFlags & D3DLIGHT_ACTIVE)
|
||||
{
|
||||
/* Disable the flag so that light_activate actually does its job. */
|
||||
light_impl->light.dwFlags &= ~D3DLIGHT_ACTIVE;
|
||||
light_activate(light_impl);
|
||||
}
|
||||
light_activate(light_impl);
|
||||
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
|
|
@ -862,7 +862,23 @@ static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
|
|||
else if (IsEqualGUID(class, &CLSID_VideoInputDeviceCategory))
|
||||
register_avicap_devices();
|
||||
|
||||
return create_EnumMoniker(class, out);
|
||||
if (SUCCEEDED(hr = create_EnumMoniker(class, out)))
|
||||
{
|
||||
IMoniker *mon;
|
||||
hr = IEnumMoniker_Next(*out, 1, &mon, NULL);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
IMoniker_Release(mon);
|
||||
IEnumMoniker_Reset(*out);
|
||||
}
|
||||
else
|
||||
{
|
||||
IEnumMoniker_Release(*out);
|
||||
*out = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -68,6 +68,7 @@ static void test_devenum(IBindCtx *bind_ctx)
|
|||
WCHAR *displayname;
|
||||
VARIANT var;
|
||||
HRESULT hr;
|
||||
int count;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
|
||||
&IID_ICreateDevEnum, (LPVOID*)&create_devenum);
|
||||
|
@ -104,6 +105,8 @@ static void test_devenum(IBindCtx *bind_ctx)
|
|||
|
||||
if (hr == S_OK)
|
||||
{
|
||||
count = 0;
|
||||
|
||||
while (IEnumMoniker_Next(enum_moniker, 1, &moniker, NULL) == S_OK)
|
||||
{
|
||||
hr = IMoniker_GetDisplayName(moniker, NULL, NULL, &displayname);
|
||||
|
@ -134,8 +137,11 @@ static void test_devenum(IBindCtx *bind_ctx)
|
|||
CoTaskMemFree(displayname);
|
||||
IPropertyBag_Release(prop_bag);
|
||||
IMoniker_Release(moniker);
|
||||
count++;
|
||||
}
|
||||
IEnumMoniker_Release(enum_moniker);
|
||||
|
||||
ok(count > 0, "CreateClassEnumerator() returned S_OK but no devices were enumerated.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -298,10 +298,11 @@ static void assign_action(HWND dialog)
|
|||
int obj = lv_get_cur_item(dialog);
|
||||
int old_action = lv_get_item_data(dialog, obj);
|
||||
int used_obj;
|
||||
|
||||
DIDEVICEOBJECTINSTANCEW ddo = device->ddo[obj];
|
||||
DWORD type;
|
||||
|
||||
if (old_action == action) return;
|
||||
if (obj < 0) return;
|
||||
type = device->ddo[obj].dwType;
|
||||
|
||||
/* Clear old action */
|
||||
if (old_action != -1)
|
||||
|
@ -320,7 +321,7 @@ static void assign_action(HWND dialog)
|
|||
lv_set_action(dialog, used_obj, -1, lpdiaf);
|
||||
|
||||
/* Set new action */
|
||||
lpdiaf->rgoAction[action].dwObjID = ddo.dwType;
|
||||
lpdiaf->rgoAction[action].dwObjID = type;
|
||||
lpdiaf->rgoAction[action].guidInstance = device->ddi.guidInstance;
|
||||
lpdiaf->rgoAction[action].dwHow = DIAH_USERCONFIG;
|
||||
|
||||
|
@ -374,9 +375,15 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
|
|||
SendDlgItemMessageW(dialog, IDC_CONTROLLERCOMBO, CB_SETCURSEL, 0, 0);
|
||||
fill_device_object_list(dialog);
|
||||
|
||||
ShowCursor(TRUE);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_DESTROY:
|
||||
ShowCursor(FALSE);
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
|
||||
switch (((LPNMHDR)lParam)->code)
|
||||
|
|
|
@ -994,9 +994,9 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
|
|||
EnterCriticalSection(&This->crit);
|
||||
res = This->acquired ? S_FALSE : DI_OK;
|
||||
This->acquired = 1;
|
||||
if (res == DI_OK)
|
||||
check_dinput_hooks(iface);
|
||||
LeaveCriticalSection(&This->crit);
|
||||
if (res == DI_OK)
|
||||
check_dinput_hooks(iface, TRUE);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -1022,9 +1022,9 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
|
|||
EnterCriticalSection(&This->crit);
|
||||
res = !This->acquired ? DI_NOEFFECT : DI_OK;
|
||||
This->acquired = 0;
|
||||
if (res == DI_OK)
|
||||
check_dinput_hooks(iface);
|
||||
LeaveCriticalSection(&This->crit);
|
||||
if (res == DI_OK)
|
||||
check_dinput_hooks(iface, FALSE);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface,
|
|||
|
||||
if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
|
||||
|
||||
pd->dwData = This->queue_len;
|
||||
pd->dwData = This->buffersize;
|
||||
TRACE("buffersize = %d\n", pd->dwData);
|
||||
break;
|
||||
}
|
||||
|
@ -1394,12 +1394,14 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty(
|
|||
TRACE("buffersize = %d\n", pd->dwData);
|
||||
|
||||
EnterCriticalSection(&This->crit);
|
||||
|
||||
This->buffersize = pd->dwData;
|
||||
This->queue_len = min(This->buffersize, 1024);
|
||||
HeapFree(GetProcessHeap(), 0, This->data_queue);
|
||||
|
||||
This->data_queue = !pd->dwData ? NULL : HeapAlloc(GetProcessHeap(), 0,
|
||||
pd->dwData * sizeof(DIDEVICEOBJECTDATA));
|
||||
This->data_queue = !This->queue_len ? NULL : HeapAlloc(GetProcessHeap(), 0,
|
||||
This->queue_len * sizeof(DIDEVICEOBJECTDATA));
|
||||
This->queue_head = This->queue_tail = This->overflow = 0;
|
||||
This->queue_len = pd->dwData;
|
||||
|
||||
LeaveCriticalSection(&This->crit);
|
||||
break;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue