1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

Compare commits

...

996 commits

Author SHA1 Message Date
Alexandre Julliard
4f8958eb56 widl: Use the correct type for non-encapsulated union discriminants. 2024-04-02 23:30:10 +02:00
Alexandre Julliard
66bec19434 widl: Output more correct /robust flags. 2024-04-02 23:30:10 +02:00
Alexandre Julliard
4d8ee6bb18 widl: Add /robust flags in correlation descriptors. 2024-04-02 23:30:10 +02:00
Alexandre Julliard
896b4f05ea widl: Always use new-style format strings in interpreted mode. 2024-04-02 23:30:03 +02:00
Louis Lenders
7cd0f395ca wbemprox: Add property 'Status' to Win32_BIOS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56361
2024-04-02 12:17:26 +02:00
Nikolay Sivov
f38a32e64c d2d1/tests: Add a test for a custom effect using a pixel shader.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-01 20:23:14 +02:00
Nikolay Sivov
51b675ef7f d2d1/effect: Use a helper internally instead of IsShaderLoaded().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-01 20:23:13 +02:00
Nikolay Sivov
43ce2bf5da d2d1/effect: Use effect property types identifier directly in initializers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-01 20:23:11 +02:00
Jacek Caban
aa2aa2033c ntdll: Use __ASM_GLOBAL_IMPORT for RtlUnwind.
Avoids importing locally defined symbols on ARM and ARM64, where we call it from winecrt0.
2024-04-01 20:22:52 +02:00
Rémi Bernon
593dcb1b5c mf/session: Avoid leaking samples in transform_node_deliver_samples. 2024-04-01 20:22:46 +02:00
Alexandre Julliard
43fb0ecd07 msi/tests: Delete the temp .msi file in all failure cases. 2024-04-01 09:12:07 +02:00
Eric Pouech
7f60584a90 cmd: Fix substring expansion for 'magic' variables.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56498
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-04-01 09:08:56 +02:00
Eric Pouech
b868d82391 cmd: Add test for substring handling in 'magic' variable expansion.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-04-01 09:08:49 +02:00
Aurimas Fišeras
29c0826e6d po: Update Lithuanian translation. 2024-04-01 09:07:57 +02:00
Dmitry Timoshkov
8568848ba8 windowscodecs: Silence fixme for IID_CMetaBitmapRenderTarget.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-29 22:45:36 +01:00
Nikolay Sivov
87ebccc37d d2d1/tests: Get rid of test shader blobs.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-29 22:45:36 +01:00
Louis Lenders
5a8bb41cad wmic: Support interactive mode and piped commands.
Make piped commands work like for example "echo os get version|wmic"
or "type file.txt | wmic" where file.txt contains some commands.
Also support interactive mode.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56361
2024-03-29 22:45:36 +01:00
Zebediah Figura
c9b72d2d2f wined3d: Remove the OffscreenRenderingMode setting.
FBOs are required now.
2024-03-29 22:45:36 +01:00
Zebediah Figura
437eb42ad2 wined3d: Require EXT_framebuffer_object. 2024-03-29 22:45:36 +01:00
Zebediah Figura
b9d2885148 wined3d: Use dynamic state for patch vertex count if possible. 2024-03-29 22:45:36 +01:00
Zebediah Figura
6f6ef6cd04 wined3d: Use dynamic state for primitive type if possible. 2024-03-29 22:45:36 +01:00
Zebediah Figura
48d68e0c50 wined3d: Enable EXT_extended_dynamic_state2. 2024-03-29 22:45:36 +01:00
Alexandre Julliard
8bac669056 rpcrt4: Make sure that the stack is set when catching an exception.
Fixes a test crash in interpreted mode.
2024-03-29 22:45:34 +01:00
Alexandre Julliard
2d801c46c7 rpcrt4: Return the correct failure for a NULL binding handle.
Fixes a test crash in interpreted mode.
2024-03-29 22:45:14 +01:00
Paul Gofman
a2c20d0e93 avifil32: Update lCurrentFrame in IGetFrame_fnGetFrame(). 2024-03-28 20:00:13 +01:00
Brendan Shanks
6ea3bc56ec server: Clarify that registry files are always in the current directory, and simplify save_branch(). 2024-03-28 19:57:01 +01:00
Brendan Shanks
9b4e3718ed server: Replace sprintf with snprintf to avoid deprecation warnings on macOS. 2024-03-28 19:51:35 +01:00
Brendan Shanks
4e04b2d528 server: Replace some malloc/sprintf/strcpy calls with asprintf. 2024-03-28 19:51:35 +01:00
Rémi Bernon
d7cf25dcd4 winegstreamer: Fallback to input caps only when no parser was found. 2024-03-28 19:50:00 +01:00
Rémi Bernon
3668a46675 winegstreamer: Create the transform parsed caps from wg_format. 2024-03-28 19:50:00 +01:00
Nikolay Sivov
850660ada0 d3d10/tests: Add a test for effect compilation containing empty buffers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-28 19:49:37 +01:00
Nikolay Sivov
36a4e5c9bb d3d10: Use older compiler for D3D10CompileEffectFromMemory().
Compilation output from D3D10CompileEffectFromMemory() always
contains $Globals buffer, even if it's empty. That matches
behaviour of 33-39 compilers.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-28 19:49:35 +01:00
Rémi Bernon
69b049d1b6 winevulkan: Remove now unnecessary vkDestroyInstance driver entry. 2024-03-28 19:48:52 +01:00
Rémi Bernon
a875c18552 winevulkan: Remove now unnecessary vkCreateInstance driver entry. 2024-03-28 19:48:49 +01:00
Rémi Bernon
c7da2450c9 winevulkan: Introduce a new get_host_surface_extension driver entry. 2024-03-28 19:48:48 +01:00
Rémi Bernon
5db24dbb32 winevulkan: Remove now unnecessary vkEnumerateInstanceExtensionProperties driver entry. 2024-03-28 19:48:46 +01:00
Rémi Bernon
e4e0ce2bc6 winevulkan: Strip surface extensions in vkEnumerateInstanceExtensionProperties. 2024-03-28 19:48:42 +01:00
Paul Gofman
1194995050 ddraw: Don't demand WINED3D_BIND_SHADER_RESOURCE for making surface in vidmem. 2024-03-28 19:48:08 +01:00
Rémi Bernon
c635a25f21 win32u: Rename struct adapter to struct source.
To match the D3DKMT terminology and avoid confusion between the GPUs,
which are called adapter there.
2024-03-28 19:47:38 +01:00
Rémi Bernon
fecfb44240 win32u: Use named adapters instead of struct gdi_adapter. 2024-03-28 19:47:38 +01:00
Rémi Bernon
00a0c97879 win32u: Use a symlink for the logically indexed adapter config key.
Linking it to what will be a physically identified adapter config key.
2024-03-28 19:47:34 +01:00
Rémi Bernon
c6e328c2d0 win32u: Split writing adapter to registry to a separate helper. 2024-03-28 19:47:34 +01:00
Piotr Caban
2546468b4c gdi32: Implicitly call StartPage in ExtEscape on printer DC. 2024-03-28 19:47:27 +01:00
Alexandre Julliard
dd68561c4a widl: Fix method number for call_as functions. 2024-03-28 15:44:46 +01:00
Alexandre Julliard
53bb4117ac widl: Don't output the explicit handle argument. 2024-03-28 14:30:47 +01:00
Alexandre Julliard
7ff6c6316e widl: Merge interpreted stubs header and parameters output into a single function. 2024-03-28 14:30:42 +01:00
Alistair Leslie-Hughes
e01cb2b915 ntoskrnl/tests: Add FltBuildDefaultSecurityDescriptor test.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
2024-03-27 22:44:57 +01:00
Alistair Leslie-Hughes
351d36b0da fltmgr.sys: Create import library.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
2024-03-27 22:44:57 +01:00
Alistair Leslie-Hughes
ac49899e32 fltmgr.sys: Implement FltBuildDefaultSecurityDescriptor.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
2024-03-27 22:44:57 +01:00
Aida Jonikienė
f2f453c454 sapi: Only print GetStatus() FIXME once.
The Speedtest app calls this function excessively.
2024-03-27 22:38:26 +01:00
Brendan Shanks
617b29c402 server: Simplify creation of the server directory. 2024-03-27 22:19:25 +01:00
Brendan Shanks
abcbd85b7c ntdll: Simplify creation of the server directory. 2024-03-27 22:19:24 +01:00
Brendan Shanks
d86627a27a mmdevapi: Make IMMDeviceCollection immutable after creation. 2024-03-27 22:19:24 +01:00
Aida Jonikienė
7a529fc94f wbemprox: Stub most of the Win32_VideoController properties.
Tomato Jones II queries most of these properties and errors out
if any of them aren't found.
2024-03-27 22:19:24 +01:00
Esme Povirk
60059bf744 user32/tests: Revert test updates for win11. 2024-03-27 22:19:24 +01:00
Rémi Bernon
8f58b9e1e1 winegstreamer: Set GST_DEBUG if not set, based on WINEDEBUG channels. 2024-03-27 22:19:24 +01:00
Alexandre Julliard
35cb600c43 idl: Use IPSFactoryBuffer instead of a non-existent IFactoryBuffer.
Caught by midl.
2024-03-27 22:19:24 +01:00
Alexandre Julliard
5e1da85068 include: Fix a parameter type in the IEnumTfUIElements interface.
Caught by midl.
2024-03-27 22:08:56 +01:00
Alexandre Julliard
69849bd2ee widl: Don't skip a pointer level for pointers to pointers to strings. 2024-03-27 11:26:10 +01:00
Rémi Bernon
4573910acc win32u: Move D3DKMT vulkan implementation out of winex11. 2024-03-26 22:46:05 +01:00
Rémi Bernon
dc9229e6fa winex11: Introduce a new find_adapter_from_handle helper. 2024-03-26 22:45:20 +01:00
Rémi Bernon
3686a04cdd winex11: Introduce a new get_vulkan_physical_device helper. 2024-03-26 22:45:18 +01:00
Rémi Bernon
3f5d18b3b6 winex11: Initialize D3DKMT vulkan instance only once.
Creating an instance is an expensive operation and we should avoid
constantly re-creating one when opening then closing a D3DKMT adapter.
2024-03-26 22:44:31 +01:00
Rémi Bernon
eb38f7418a win32u: Open adapters in NtGdiDdDDIEnumAdapters2 outside of the display devices lock. 2024-03-26 22:44:31 +01:00
Alexandre Julliard
47e4907c0d wshom.ocx: Don't show a message box on ShellExecute error. 2024-03-26 22:26:51 +01:00
Paul Gofman
568e90ad11 win32u: Avoid leaking previous buffer in get_buffer_space(). 2024-03-26 22:26:51 +01:00
Paul Gofman
054a95a817 win32u: Avoid writing past allocated memory in peek_message(). 2024-03-26 22:26:51 +01:00
Paul Gofman
8b7ac24752 ddraw/tests: Add tests for multiple devices. 2024-03-26 22:26:51 +01:00
Paul Gofman
9d95bd5f4b ddraw: Support multiple devices per ddraw object. 2024-03-26 22:26:51 +01:00
Paul Gofman
6fe8e64c1a ddraw: Sync wined3d render target in d3d_device_sync_rendertarget(). 2024-03-26 22:26:51 +01:00
Paul Gofman
aa8487a4b3 ddraw: Store wined3d state in d3d_device. 2024-03-26 22:26:51 +01:00
Paul Gofman
9492a10f44 wined3d: Factor out wined3d_texture_set_lod() function. 2024-03-26 22:26:51 +01:00
Paul Gofman
2e088045b5 ddraw: Don't apply state in ddraw_surface_blt(). 2024-03-26 22:26:51 +01:00
Paul Gofman
4e81f66127 ddraw: Store matrix handle in the global table. 2024-03-26 22:26:51 +01:00
Paul Gofman
5a7ff3b45c ddraw: Store surface handles in the global table. 2024-03-26 22:26:51 +01:00
Paul Gofman
b9eb9a7453 ddraw: Store material handles in the global table. 2024-03-26 22:26:51 +01:00
Paul Gofman
2799c95dd2 wintypes: Report some API contracts as present in api_information_statics_IsApiContractPresentByMajor(). 2024-03-26 22:26:51 +01:00
Hans Leidekker
ce2ae79f9d bcrypt: Add support for RSA OAEP padding.
Needs GnuTLS 3.8.4.
2024-03-26 22:26:51 +01:00
Eric Pouech
1304bf7fb9 evr: Fix YUY2 image copy in evr_copy_sample_buffer().
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-26 22:26:51 +01:00
Eric Pouech
d950e1b61f evr: Remove useless code.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-26 22:26:51 +01:00
Tuomas Räsänen
ef58b8c770 winebus: Ignore udev events of devices which do not have devnodes.
Udev monitor monitors the whole input subsystem, but not all devices
in the input subsystem have devnodes associated to them.

This commit makes the event processing ignore such devices.

All device handling assumes devices have devnodes, so here we just
simply ignore all devices which do not have one.

Previously, udev bus thread aborted when an event for a device without
a devnode was processed:

  10111.330:0068:0084:trace:hid:process_monitor_event Received action "remove" for udev device (null)
  10111.330:0068:0084:warn:hid:bus_main_thread L"UDEV" bus wait returned status 0xc0000005

Just plugging in and out a normal mouse was enough cause this.

This was because root input devices (which do not have devnodes) were
handled too and find_device_from_devnode() choked on NULL argument.
2024-03-26 22:26:51 +01:00
Zebediah Figura
37d71415ed wined3d: Skip bindless samplers with no uniform location.
This can happen legitimately if the sampler access was optimized out.
2024-03-26 22:26:51 +01:00
Zebediah Figura
58c680bace wined3d: Recreate buffer textures when renaming the existing buffer storage.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56438
2024-03-26 22:26:51 +01:00
Zebediah Figura
4e13c72f70 d3d11/tests: Test discarding a buffer in test_high_resource_count(). 2024-03-26 22:26:50 +01:00
Paul Gofman
ddff863355 windows.perception.stub: Add stub IHolographicSpaceInterop interface. 2024-03-26 18:22:24 +01:00
Paul Gofman
bb47eb9f72 ntdll/tests: Add more tests for xstate. 2024-03-26 18:21:06 +01:00
Paul Gofman
29c73ee173 ntdll: Support more xstate features. 2024-03-26 18:20:56 +01:00
Paul Gofman
3dea242677 ntdll: Mind generic xstate masks in server context conversion. 2024-03-26 18:20:56 +01:00
Paul Gofman
a9d77d0989 ntdll: Factor out context_to_server() function. 2024-03-26 18:20:56 +01:00
Paul Gofman
25e0a25807 ntdll: Factor out xstate_from_server() function. 2024-03-26 18:20:56 +01:00
Paul Gofman
6bc2c09232 ntdll: Support generic xstate in Unix-side manipulation functions. 2024-03-26 18:20:55 +01:00
Paul Gofman
a10da8a42a ntdll: Preserve untouched parts of xstate in NtSetContextThread(). 2024-03-26 18:20:55 +01:00
Paul Gofman
7ae23ad775 ntdll: Only save AVX xstate in wine_syscall_dispatcher. 2024-03-26 18:20:53 +01:00
Alexandre Julliard
cf08bbaa0f ntdll: Use a common wrapper to call unwind handlers on x86-64. 2024-03-25 18:05:39 +01:00
Alexandre Julliard
24e9fcac08 ntdll: Use a common wrapper to call exception handlers on x86-64. 2024-03-25 18:05:25 +01:00
Alexandre Julliard
47f94fcf5f ntdll: Copy the context contents instead of the pointer on collided unwind.
Similar to how it's done on ARM platforms.
2024-03-25 18:04:56 +01:00
Nikolay Sivov
8dec8cc96c gdi32/emf: Zero-initialize handles array (Valgrind).
It's checked in emr_reset(), and reallocation already zero-initializes new slots.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-25 18:04:09 +01:00
Zhiyi Zhang
de89f77727 mfmediaengine/tests: Test IMFMediaEngineEx::SetCurrentTime/Ex(). 2024-03-25 18:04:01 +01:00
Zhiyi Zhang
283d4bab22 mfmediaengine: Implement IMFMediaEngineEx::SetCurrentTimeEx(). 2024-03-25 18:04:01 +01:00
Zhiyi Zhang
2bcc87b303 mfmediaengine: Implement IMFMediaEngineEx::SetCurrentTime(). 2024-03-25 18:04:01 +01:00
Rémi Bernon
b1cca5b52a evr/mixer: Respect input media type MF_MT_GEOMETRIC_APERTURE. 2024-03-25 18:03:43 +01:00
Rémi Bernon
d304e58789 evr/tests: Add more video mixer input media type aperture tests. 2024-03-25 18:03:43 +01:00
Rémi Bernon
c5f0039223 evr/tests: Split check_presenter_output to a separate helper. 2024-03-25 18:03:43 +01:00
Rémi Bernon
1f589f6304 evr/tests: Split create_d3d_sample to a separate helper. 2024-03-25 18:03:43 +01:00
Rémi Bernon
da2c20a2e6 mf/tests: Check that pan scan and geometric apertures are set. 2024-03-25 18:03:43 +01:00
Santino Mazza
624e87a725 crypt32: Fix CryptBinaryToString not adding a separator. 2024-03-25 18:03:37 +01:00
Nikolay Sivov
df97793045 d2d1: Fix a double free on error path (Valgrind).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-25 12:57:04 +01:00
Nikolay Sivov
967f3a5074 dwrite/shape: Fully initialize shaping context when getting glyph positions (Valgrind).
Actual issue is uninitialized has_gpos_attachment flag, it might be harmless in practice
but it's better to avoid.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-25 12:56:52 +01:00
Rémi Bernon
5ce5dc1f1e configure: Quote ac_cv_lib_soname_MoltenVK when setting SONAME_LIBVULKAN. 2024-03-25 12:56:52 +01:00
Alexandre Julliard
7c5b9304a6 Release 9.5. 2024-03-22 22:28:01 +01:00
Esme Povirk
81e8513ef2 user32/tests: Further updates for win11 TrackPopupMenu failures. 2024-03-22 21:50:46 +01:00
Paul Gofman
2745228b14 ntdll: Don't use debug info presence to detect critical section global status. 2024-03-22 21:50:46 +01:00
Nikolay Sivov
e1606d698f include: Remove XMLSchemaCache60 from msxml2.idl.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-22 21:00:22 +01:00
Nikolay Sivov
19b7f33a6e msxml/tests: Move version-specific schema tests to corresponding modules.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-22 21:00:22 +01:00
Nikolay Sivov
91f3d8b0be msxml/tests: Move some of the validation tests to their modules.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-22 21:00:21 +01:00
Jinoh Kang
0b0259c476 gitlab: Output collapsible section markers in test stage script. 2024-03-22 17:09:26 +01:00
Rémi Bernon
26876b4a6e mfplat: Append MFVIDEOFORMAT user data after the structure padding.
Instead of using the last palette entry, which might be misaligned.
2024-03-22 17:05:40 +01:00
Rémi Bernon
c11f9a8bc9 win32u: Move vkGet(Device|Instance)ProcAddr helpers inline. 2024-03-22 17:05:31 +01:00
Rémi Bernon
a75dde2c1f winevulkan: Stop generating the wine/vulkan_driver.h header. 2024-03-22 17:05:31 +01:00
Rémi Bernon
9ee2adba14 win32u: Move vkGet(Instance|Device)ProcAddr out the drivers. 2024-03-22 17:05:31 +01:00
Rémi Bernon
28873ce8c4 win32u: Move vulkan loading and init guard out of the drivers. 2024-03-22 17:05:31 +01:00
Rémi Bernon
1ddaa1d385 winemac: Use SONAME_LIBVULKAN as an alias for MoltenVK. 2024-03-22 17:05:31 +01:00
Rémi Bernon
737e4411d9 user32/tests: Add some LoadKeyboardLayoutEx tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28170
2024-03-22 17:02:32 +01:00
Rémi Bernon
be62646098 user32/tests: Add missing winetest_pop_context. 2024-03-22 17:02:32 +01:00
Vijay Kiran Kamuju
a71223eed9 user32: Add LoadKeyboardLayoutEx stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28170
2024-03-22 17:02:31 +01:00
Alexandre Julliard
84d5614b11 server: Add a helper to trace uint64 arrays. 2024-03-22 16:54:09 +01:00
Alexandre Julliard
117fefa274 wow64: Use setjmp/longjmp from ntdll. 2024-03-22 13:09:57 +01:00
Alexandre Julliard
567b31d7f3 wow64cpu: Save non-volatile registers before switching to 32-bit code.
To make it possible to unwind the stack.
2024-03-22 13:06:40 +01:00
Alexandre Julliard
d91f16a24a wow64: Use a .seh handler for system calls. 2024-03-22 13:05:25 +01:00
Rémi Bernon
b053e924e8 server: Process internal messages when checking queue status. 2024-03-21 22:19:58 +01:00
Rémi Bernon
a84517418e server: Check for internal hardware messages before others. 2024-03-21 22:19:58 +01:00
Rémi Bernon
8405fe85d4 win32u: Use a structure to pass peek_message arguments. 2024-03-21 22:19:58 +01:00
Rémi Bernon
994021da99 server: Send WM_WINE_SETCURSOR message only when necessary. 2024-03-21 22:19:58 +01:00
Rémi Bernon
1604d8a202 server: Send WM_WINE_CLIPCURSOR message only when necessary. 2024-03-21 22:19:58 +01:00
Rémi Bernon
f1dca8914c winex11: Accept key and mouse events with QS_RAWINPUT. 2024-03-21 22:19:58 +01:00
David Heidelberg
5d8e8804d4 mailmap: Add a mailmap entry for myself with the proper name.
Signed-off-by: David Heidelberg <david@ixit.cz>
2024-03-21 22:19:58 +01:00
David Heidelberg
a63af560dd d3d9/tests: Replace LPDWORD cast with float_to_int function.
Borrowed from dlls/wined3d/wined3d_private.h

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-03-21 22:19:58 +01:00
Pavel Ondračka
d0e37372cf d3d9/tests: Define enums outside of struct.
Co-authored-by: David Heidelberg <david@ixit.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
2024-03-21 22:19:58 +01:00
Zebediah Figura
c38df594f5 wined3d: Avoid leaking string buffers in shader_glsl_load_bindless_samplers().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56445
2024-03-21 22:19:58 +01:00
Jacek Caban
3b12583db0 widl: Always close parsed input file.
Fixes a regression from 9d537999e3, which removed closing the file.
This causes Windows widl build to be to remove the temporary file on exit.
2024-03-21 22:19:58 +01:00
Akihiro Sagawa
6ce8a31b0b dsound: Initialize MTA in IDirectSound::Initialize().
RE:D Cherish! (Trial ver) depends on this behavior.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53613
2024-03-21 22:19:58 +01:00
Akihiro Sagawa
67153fa0c3 dsound/tests: Add tests for implicit MTA creation in IDirectSound::Initialize().
On recent Windows, at least Windows 7, a multithread apartment (MTA) is
initialized within IDirectSound::Initialize().
2024-03-21 22:19:58 +01:00
Jinoh Kang
4b0b489f6f kernelbase: Open object with DELETE access for NtMakeTemporaryObject().
Fixes: a4ef56e1d9
2024-03-21 22:19:58 +01:00
Eric Pouech
a7ad588ec5 winedbg: Don't reload a minidump for a different machine.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
70d11a59c6 winedbg: Update the CPU information displayed when reloading a minidump.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
97e584b695 winedbg: Flush expr buffer upon internal exception.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
2e46d81c64 winedbg: Extend 'attach' command to load minidump files.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
8a65cdd13d winedbg: Add ability to set executable name.
Either from command line option, or as a command.
Mostly handy for scripting.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Rémi Bernon
5d91ab65fa server: Avoid removing thread twice from its desktop thread list. 2024-03-21 22:19:58 +01:00
Piotr Caban
b13477deb4 advapi32/tests: Remove all files created by RegLoadAppKey tests. 2024-03-21 22:19:58 +01:00
Piotr Caban
cc62cdc1fd advapi32/tests: Test if modifications are saved in RegUnLoadKey. 2024-03-21 22:19:58 +01:00
Piotr Caban
98bd248778 advapi32/tests: Remove all files created by RegLoadKey tests. 2024-03-21 22:19:58 +01:00
Piotr Caban
cdc842f60d advapi32/tests: Merge RegLoadKey and RegUnLoadKey tests. 2024-03-21 22:19:58 +01:00
Piotr Caban
d7aaf51459 winedump: Fix REG_DWORD dumping with no data. 2024-03-21 22:19:58 +01:00
Alexandre Julliard
753875e80b wow64: Access the BTCpuSimulate backend function pointer directly. 2024-03-21 22:19:58 +01:00
Alexandre Julliard
d09501691e wow64: Always use a .seh handler in cpu_simulate(). 2024-03-21 22:19:58 +01:00
Alexandre Julliard
d2c0efe163 wow64: Use a .seh handler in raise_exception(). 2024-03-21 22:19:58 +01:00
Alexandre Julliard
e317eafe8f configure: Don't build wow64 support in non-PE builds. 2024-03-21 22:19:58 +01:00
Rémi Bernon
f67b4f6bf4 ntoskrnl.exe: Open symbolic link with DELETE before making them temporary. 2024-03-21 22:19:58 +01:00
Rémi Bernon
552cec9477 mfplat/mediatype: Use MFCreateWaveFormatExFromMFMediaType in init_am_media_type_audio_format. 2024-03-21 22:19:58 +01:00
Rémi Bernon
1e053810f3 mfplat/mediatype: Implement MFCreateMediaTypeFromRepresentation. 2024-03-21 22:19:57 +01:00
Rémi Bernon
a4fb357c89 mfplat/mediatype: Force WAVEFORMATEXTENSIBLE in MFCreateWaveFormatExFromMFMediaType in some cases. 2024-03-21 22:19:57 +01:00
Rémi Bernon
689868cd50 mfplat/mediatype: Support audio major type in MFInitMediaTypeFromAMMediaType. 2024-03-21 22:19:57 +01:00
Rémi Bernon
45d4aa9f60 mfplat/mediatype: Check format pointers and sizes in MFInitMediaTypeFromAMMediaType. 2024-03-21 22:19:57 +01:00
Rémi Bernon
9ee0720d98 mfplat/tests: Check how AAC attributes are copied from user data. 2024-03-21 22:19:57 +01:00
Rémi Bernon
3593ce002f mfplat/tests: Test initializing mediatype from AAC WAVEFORMATEXTENSIBLE. 2024-03-21 22:19:57 +01:00
Rémi Bernon
2734b266de mfplat/tests: Add some broken results for Win7. 2024-03-21 22:19:57 +01:00
Dmitry Timoshkov
0bffa32226 widl: Add initial implementation of SLTG typelib generator.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-21 22:19:57 +01:00
Yuxuan Shui
85d029e3b0 shell32: Rely solely on SHELL_FindExecutable for ShellExecute.
This does two things:

1. ShellExecute no longer searches in the directory where the current executable is in.
2. We always CreateProcess with a fully qualified path, so we CreateProcess won't do its own path
   resolution.

Serendipitously this also fixes some existing todos in tests.
2024-03-21 10:51:00 +01:00
Yuxuan Shui
1bc7db2e7d shell32: Fix FindExecutable search path.
It should look in the currect working directory, instead of the directory where the current
executable is in.
2024-03-21 10:50:59 +01:00
Yuxuan Shui
a1d0e21b0a shell32: PathResolve should remove trailing dot. 2024-03-21 10:50:59 +01:00
Yuxuan Shui
f59947bc10 shell32: PathResolve should be able to find files that already have extensions.
Setting dwWhich to 0xff forces extensions to be appended, even when the file name already includes
an extension. This causes PathResolve to fail in some cases where the file does exist.
2024-03-21 10:50:58 +01:00
Yuxuan Shui
5426e597bb shell32: Make sure PathResolve can find files in the current directory.
Previously looking for file that does exist in current directory will fail because of the early
`!PathFileExists(path)` check, even when the current directory is specified in `dirs`.
2024-03-21 10:50:56 +01:00
Yuxuan Shui
520b7c6d83 shell32: PathResolve(file, NULL, ...) should not look in the current directory.
Unless it's explicitly specified.
2024-03-21 10:50:55 +01:00
Yuxuan Shui
c6fa51a949 shell32/tests: Check ShellExecute is looking in the correct current directory. 2024-03-21 10:50:55 +01:00
Yuxuan Shui
ae70b66dce shell32/tests: Check FindExecutable is looking in the correct current directory.
FindExecutable should look in the current working directory, not relative to the current executable
image (which is what SearchPathW(NULL, ...) does).
2024-03-21 10:50:54 +01:00
Rémi Bernon
7c7e55892e winegstreamer: Append an optional parser before decoders. 2024-03-21 10:50:32 +01:00
Rémi Bernon
8ae8063743 winegstreamer: Release sink caps in the error path. 2024-03-21 10:50:32 +01:00
Jinoh Kang
a4ef56e1d9 server: Check for DELETE access in NtMakeTemporaryObject(). 2024-03-20 23:16:24 +01:00
Esme Povirk
0b472874af user32/tests: Accept WM_ACTIVATE in TrackPopupMenu. 2024-03-20 23:15:40 +01:00
Esme Povirk
290dd95dd4 gdiplus: Calculate region bounding box without generating HRGN. 2024-03-20 23:07:34 +01:00
Esme Povirk
423ba9cb23 gdiplus/tests: Region bounds aren't rounded. 2024-03-20 23:05:27 +01:00
Rémi Bernon
9f3f61283d win32u: Avoid a crash when cleaning up a monitor without an adapter. 2024-03-20 23:05:06 +01:00
Giovanni Mascellani
a78cea20d1 d2d1: Compile the pixel shader with D3DCompile(). 2024-03-20 23:04:48 +01:00
Jinoh Kang
25ffa32beb Revert "ntdll/tests: Load NtMakeTemporaryObject() dynamically."
This reverts commit 4fdb45f23f.

NtMakeTemporaryObject() has existed since at least Windows NT 3.10.
2024-03-20 19:00:14 +01:00
Vijay Kiran Kamuju
3719aed1f9 d3dcompiler: Add D3DCreateLinker stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52622
2024-03-20 09:15:18 +01:00
Paul Gofman
86557b9e0b strmbase: Fallback to InitializeCriticalSection() if RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO is unsupported. 2024-03-19 23:02:11 +01:00
Zebediah Figura
525ef1bf77 quartz/tests: Add some tests for VMR7 renderless mode. 2024-03-19 23:02:11 +01:00
Zebediah Figura
668c959f5a quartz: Return S_OK from IVMRSurfaceAllocator_PrepareSurface(). 2024-03-19 23:02:11 +01:00
Zebediah Figura
442ef40665 quartz: Implement IVMRSurfaceAllocatorNotify::AdviseSurfaceAllocator(). 2024-03-19 23:02:11 +01:00
Zebediah Figura
4c40aeb90b quartz: Reimplement the VMR7 using the VMR7 presenter. 2024-03-19 23:02:11 +01:00
Zebediah Figura
e428afe4ae quartz: Implement SetVideoClippingWindow() and PresentImage() in the VMR7 presenter. 2024-03-19 23:02:11 +01:00
Rémi Bernon
69f8118883 winevulkan: Allow only one vulkan surface at a time for an HWND.
Fixes bb872831de which lost this from the
winex11 driver. This might be something we want to relax at some point
to allow multiple APIs to draw to the same HWND, but it was done like
that before and it is technically a regression.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56380
2024-03-19 23:02:11 +01:00
Vijay Kiran Kamuju
2fd582e165 urlmon: Add stub for ordinal 414.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53635
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52352
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48085
2024-03-19 23:02:11 +01:00
Jinoh Kang
fa7c837f91 ntdll/tests: Don't import kernel32.RtlPcToFileHeader.
kernel32.RtlPcToFileHeader is an export forwarder to
ntdll.RtlPcToFileHeader and does not exist on Windows 8 or earlier.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56458
2024-03-19 23:02:11 +01:00
Rémi Bernon
de265dfa0b winebus: Remove devices that are ignored wrt hidraw preferences.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56450
2024-03-19 23:02:11 +01:00
Rémi Bernon
8b41c2cfdd winebus: Prefer hidraw for everything that is not a game controller.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56450
2024-03-19 23:02:11 +01:00
Rémi Bernon
ebfe2653ea winebus: Read hidraw device usages from their report descriptors.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56450
2024-03-19 23:02:11 +01:00
Rémi Bernon
d48e250835 winebus: Add HID usages in the device descriptor when possible.
As a hint for the frontend to decide whether to use hidraw.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56450
2024-03-19 23:02:11 +01:00
Rémi Bernon
eac5ad2a26 mfplat/mediatype: Implement MFInitMediaTypeFromMFVideoFormat. 2024-03-19 23:02:11 +01:00
Rémi Bernon
899abeafe4 mfplat/tests: Add tests for MFInitMediaTypeFromMFVideoFormat. 2024-03-19 23:02:11 +01:00
Rémi Bernon
a712d7ec87 mfplat/mediatype: Stub MFInitMediaTypeFromMFVideoFormat. 2024-03-19 23:02:11 +01:00
Rémi Bernon
fe0c129e0b mfplat/tests: Check the conditions for the MFVideoFlag_BottomUpLinearRep flags. 2024-03-19 23:02:11 +01:00
Rémi Bernon
b1d7c03514 mfplat/mediatype: Append user data in MFCreateMFVideoFormatFromMFMediaType. 2024-03-19 23:02:11 +01:00
Rémi Bernon
75a5263c60 mfplat/tests: Test that MFCreateMFVideoFormatFromMFMediaType appends user data. 2024-03-19 23:02:11 +01:00
Rémi Bernon
7598556b64 mfplat/tests: Test that aperture is dropped with VIDEOINFOHEADER2.
But preserved with MFVIDEOFORMAT.
2024-03-19 23:02:11 +01:00
Hans Leidekker
4fdb45f23f ntdll/tests: Load NtMakeTemporaryObject() dynamically. 2024-03-19 23:02:11 +01:00
Zhenbo Li
b4a5775ffb shell32: Create nonexistent destination directories in FO_MOVE.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=25207
2024-03-19 23:02:11 +01:00
Zebediah Figura
19627b13e4 shell32/tests: Remove obsolete workarounds from test_move(). 2024-03-19 23:02:11 +01:00
Alexandre Julliard
1bb011f815 ntdll/tests: Update the KiUserExceptionDispatcher test for ARM64EC. 2024-03-19 23:02:11 +01:00
Alexandre Julliard
2c22295233 ntdll/tests: Fix exception address checks in child process on ARM64EC. 2024-03-19 22:26:07 +01:00
Alexandre Julliard
d70dd61030 msvcrt: Use floating point comparison builtins also in MSVC mode. 2024-03-19 11:06:03 +01:00
Alexandre Julliard
5cf558935d netprofm: Use the correct symbols for error codes. 2024-03-19 10:05:57 +01:00
Mark Jansen
9e639ff1f6 kernel32/tests: Add tests for job object accounting.
Signed-off-by: Mark Jansen <mark.jansen@reactos.org>
2024-03-18 23:21:37 +01:00
Santino Mazza
b37d3f232b mf/topoloader: Preserve input topology id. 2024-03-18 23:21:37 +01:00
Santino Mazza
4da091eddd mf/test: Check the topologies id's in topo loader. 2024-03-18 23:21:37 +01:00
Rémi Bernon
fc97535ccb mfplat/mediatype: Implement some VIDEOINFOHEADER2 dwInterlaceFlags conversion. 2024-03-18 23:21:37 +01:00
Rémi Bernon
76abdf3403 mfplat/mediatype: Implement VIDEOINFOHEADER2 dwControlFlags conversion. 2024-03-18 23:21:37 +01:00
Rémi Bernon
5a34601606 mfplat/mediatype: Implement MF_MT_FRAME_RATE from VIDEOINFOHEADER2.
Native seems to also treat some frame rate specially, matching a wide
range of time per frame into the same predefined frame rates.
2024-03-18 23:21:37 +01:00
Rémi Bernon
aa385765a1 mfplat: Support flexible frame time in MFAverageTimePerFrameToFrameRate. 2024-03-18 23:21:37 +01:00
Rémi Bernon
578d104cf6 mfplat/tests: Add more MFAverageTimePerFrameToFrameRate tests. 2024-03-18 23:21:37 +01:00
Rémi Bernon
c94c464920 mfplat/mediatype: Set rcSource and rcTarget if stride differs from width. 2024-03-18 23:21:37 +01:00
Rémi Bernon
d0c996b2b4 mfplat/mediatype: Map rcSource to MF_MT_(PAN_SCAN|MINIMUM_DISPLAY)_APERTURE. 2024-03-18 23:21:37 +01:00
Rémi Bernon
66ea15f13a mfplat/mediatype: Set MF_MT_SAMPLE_SIZE from bmiHeader.biSizeImage. 2024-03-18 23:21:37 +01:00
Rémi Bernon
08cafe23d5 mfplat/mediatype: Support FORMAT_VideoInfo2 in MFInitMediaTypeFromAMMediaType. 2024-03-18 23:21:37 +01:00
Rémi Bernon
6413303e60 mfplat/tests: Test aperture to VIDEOINFOHEADER fields mapping. 2024-03-18 23:21:37 +01:00
Nikolay Sivov
30140b7d7e msxml6/tests: Add some tests for MXWriter60.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:21:37 +01:00
Alexandre Julliard
bd5ab1c6cd jscript: Use the correct facility for JScript errors. 2024-03-18 11:00:41 +01:00
Esme Povirk
552cc456d1 user32/tests: Add another missing message for TrackPopupMenu. 2024-03-15 23:49:00 +01:00
Paul Gofman
4d56a33ab0 server: Ignore some ICMP-originated socket errors for connectionless sockets. 2024-03-15 23:48:52 +01:00
Nikolay Sivov
9d3e458c55 wshom/network: Implement UserDomain property.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56434
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-15 23:48:17 +01:00
Alexandros Frantzis
e63da6ea68 win32u: Cancel previous key auto-repeat when starting a new one.
The previous auto-repeat may be associated with a different HWND,
so we cannot rely on the new timer replacing the old timer, and
we don't want simultaneous repeats on different windows in the
same thread.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56307
2024-03-15 17:55:30 +01:00
Alexandros Frantzis
7a25bd885e win32u: Cancel auto-repeat only if the repeat key is released.
This fixes the behavior to match other systems, where releasing
an unrelated key does not affect the repeating key.
2024-03-15 17:55:28 +01:00
Eric Pouech
819d8692c6 dbghelp: No longer embed unwind information in minidump (x86_64).
This can generate very long time when saving the minidump, but
also when reloading it.
Unwind information is expected to be gotten from an image matching
the modules listed in the minidump for Normal mode.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55798
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Eric Pouech
6b9c1682b1 winedbg: Reload module without virtual flag.
So that we can get to debug info.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Eric Pouech
aabf6334f3 winedbg: Fallback to PE image when reading memory (minidump).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Eric Pouech
ca95533e8a dbghelp: Add support for V2 unwind info (x86_64).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Rémi Bernon
8dd24ad2a4 mfplat/mediatype: Implement MFInitAMMediaTypeFromMFMediaType for FORMAT_VideoInfo2. 2024-03-15 15:06:38 +01:00
Rémi Bernon
d307cfede9 mfplat/tests: Add tests for MFInitMediaTypeFromVideoInfoHeader2. 2024-03-15 15:06:38 +01:00
Rémi Bernon
4319ada736 mfplat/mediatype: Implement MFInitMediaTypeFromVideoInfoHeader2. 2024-03-15 15:06:38 +01:00
Rémi Bernon
e497f0e88d mfplat/mediatype: Implement implicit MFInitMediaTypeFromVideoInfoHeader subtype. 2024-03-15 15:06:38 +01:00
Rémi Bernon
2692cd8b04 mfplat/tests: Test each VIDEOINFOHEADER field conversion separately. 2024-03-15 15:06:38 +01:00
Hans Leidekker
498b632899 ntdll/tests: Fix a test failure. 2024-03-15 15:06:37 +01:00
Kyrylo Babikov
b16b366327 dbghelp: Fix PDB processing using the FPO stream instead of FPOEXT. 2024-03-15 15:06:37 +01:00
Robin Kertels
f166b298ec d3d9/tests: Skip desktop window tests if device creation fails.
Signed-off-by: Robin Kertels <robin.kertels@gmail.com>
2024-03-15 15:06:37 +01:00
Henri Verbeet
47be32f3d1 wined3d: Do not check the input signature element count for sm4+ shaders in shader_spirv_compile_arguments_init().
Shader model 4 fragment shaders can have more than 12 input varyings. That's
fine though, because we don't need to build a varying map for them in the
first place. Note that in principle the ERR in question could still be
triggered by e.g. attempting to use a shader model 4 fragment shader with a
shader model 3 vertex shader.
2024-03-15 15:06:37 +01:00
Zhiyi Zhang
d6ac41a9f4 win32u: Don't enumerate mirrored monitor clones when unnecessary.
These functions don't need to enumerate mirrored monitor clones.
2024-03-15 15:06:37 +01:00
Zhiyi Zhang
793e4640e4 win32u: Don't enumerate mirrored monitor clones for GetSystemMetrics(SM_CMONITORS).
Only one monitor in a mirrored monitor set contributes to the result of GetSystemMetrics(SM_CMONITORS).
Tested manually on Win7 and Win10.
2024-03-15 15:06:37 +01:00
Zhiyi Zhang
6505403e58 win32u: Fix a possible condition that makes EnumDisplayMonitors() not reporting any monitors.
When there are two monitors and they are mirrored, both of them are considered primary. When the
first primary monitor happens to be a clone, EnumDisplayMonitors() ends up not reporting any
monitors because should_enumerate_monitor() returns FALSE and we break out the loop to enumerate
primary monitors after that.

This is a regression from b59619d and my review comments. My indent was to break out of the loop
after finding the *master* primary monitor, not cloned primary monitors, to avoid unnecessary
iterations. However, the primary monitor count is small and it's cleaner this way so let's break
when should_enumerate_monitor() returns TRUE.
2024-03-15 15:06:37 +01:00
Andrew Nguyen
1600f2e6bd ddraw: Release only valid texture parents on ddraw_texture_init failure.
When ddraw_texture_init needs to clean up on failure, it will call the
wined3d_texture_get_sub_resource_parent function on draw_texture in
order to retrieve its parent for a IDirectDrawSurface release call.
However, if draw_texture is NULL, then the function call will crash
due to a null pointer dereference.

Therefore, on failure cleanup, the release operation on the texture
parent should only be performed if draw_texture is not NULL.

This fixes a crash in the Virtual Insanity game demo.
2024-03-15 15:06:37 +01:00
Alexandre Julliard
72fd6e9251 ntdll: Add mappings for more status codes. 2024-03-15 15:06:37 +01:00
Alexandre Julliard
08f46b8de0 include: Add some new status codes.
And sort everything consistently.
2024-03-15 15:06:37 +01:00
Alexandre Julliard
98b7095a21 include: Add some new error codes.
And sort everything consistently.
2024-03-15 15:06:37 +01:00
Jinoh Kang
ce41edab3f ntdll: Implement NtMakePermanentObject. 2024-03-15 15:06:37 +01:00
Jinoh Kang
e368515eef server: Generalize server request make_temporary to set_object_permanence.
Required for implementing NtMakePermanentObject().
2024-03-15 15:06:33 +01:00
Jinoh Kang
d282208ac3 ntdll/tests: Add tests for NtMakeTemporaryObject. 2024-03-15 08:37:42 +01:00
Jinoh Kang
a4ad64dda3 ntdll/tests: Add tests for OBJ_PERMANENT object attribute. 2024-03-15 08:37:39 +01:00
Rémi Bernon
65864f92f2 winevulkan: Get rid of the wine_vk_instance_free helper. 2024-03-14 20:52:33 +01:00
Rémi Bernon
c814cf0d35 winevulkan: Add handle mappings on creation success only. 2024-03-14 20:52:33 +01:00
Rémi Bernon
81ed2e5465 winevulkan: Simplify wine_vk_instance_free helper. 2024-03-14 20:52:33 +01:00
Rémi Bernon
04981ad759 winevulkan: Get rid of the wine_vk_device_free helper. 2024-03-14 20:52:33 +01:00
Rémi Bernon
aaeb221f52 winevulkan: Use a single allocation for instance and physical devices. 2024-03-14 20:52:33 +01:00
Rémi Bernon
bda48ed85e winevulkan: Rename wine_vk_physical_device_alloc parameters and variables. 2024-03-14 20:52:33 +01:00
Rémi Bernon
3b39027655 winevulkan: Pass VkDeviceQueueCreateInfo to wine_vk_device_init_queues. 2024-03-14 20:52:33 +01:00
Rémi Bernon
5ef47e916a winevulkan: Use a single allocation for device and queues. 2024-03-14 20:52:33 +01:00
Rémi Bernon
5bde3f4c97 winevulkan: Use an rb_tree and allocate entries for handle mappings. 2024-03-14 20:52:33 +01:00
Paul Gofman
8b3944e134 ntdll: Only allocate debug info in critical sections with RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO. 2024-03-14 20:52:33 +01:00
Paul Gofman
9115dc0aba explorer: Force debug info in critical sections. 2024-03-14 20:52:33 +01:00
Paul Gofman
95b0e65b07 services: Force debug info in critical sections. 2024-03-14 20:52:33 +01:00
Paul Gofman
90ee219c44 qasf: Force debug info in critical sections. 2024-03-14 20:52:33 +01:00
Paul Gofman
c4ab638083 dsdmo: Force debug info in critical sections. 2024-03-14 20:52:33 +01:00
Paul Gofman
63ff75cf12 diasymreader: Force debug info in critical sections. 2024-03-14 20:52:33 +01:00
Paul Gofman
8d933bf187 cryptowinrt: Force debug info in critical sections. 2024-03-14 20:52:33 +01:00
Zhiyi Zhang
2f094cbfe6 win32u: Support HiDPI for the non-client close button in WS_EX_TOOLWINDOW windows. 2024-03-14 18:41:42 +01:00
Nikolay Sivov
a5a0bc10f9 d3d10_1/tests: Remove todo from now passing test.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-14 18:41:42 +01:00
Nikolay Sivov
e91243a94e d3dx10/tests: Remove todo's from now passing tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-14 18:41:42 +01:00
Nikolay Sivov
866cb1ca63 wshom/network: Check pointer argument in get_UserName().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-14 18:41:42 +01:00
Nikolay Sivov
30e5111dd5 wshom/network: Implement ComputerName() property.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56434
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-14 18:41:42 +01:00
Nikolay Sivov
2c325f8bd3 wshom/network: Implement GetTypeInfo().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-14 18:41:42 +01:00
Nikolay Sivov
fcce392066 wshom/network: Use TRACE() for implemented method.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-14 18:41:42 +01:00
Dmitry Timoshkov
ee3b9be8e2 comctl32: Implement IImageList2::Initialize().
... by moving ImageList_Create() implementation.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-14 18:41:42 +01:00
Dmitry Timoshkov
fedcd4bb0e comctl32/tests: Add more tests for IImageList2 interface.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-14 18:41:42 +01:00
Rémi Bernon
3944b36b98 win32u: Fix incorrect ascii key name in get_config_key.
Fixes 6b8b35f950 which incorrectly
replaced it with string literal, leading to the default setting being
used all the time.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56435
2024-03-14 18:41:42 +01:00
Noah Berner
898892d5f0 advapi32/tests: Add todo_wine to tests that are currently failing. 2024-03-14 18:41:42 +01:00
Rémi Bernon
14743b0ffb mfreadwrite/reader: Handle MF_E_TRANSFORM_STREAM_CHANGE results. 2024-03-14 18:41:42 +01:00
Eric Pouech
7f10145a91 dbghelp: Simplify thread info generation in minidump.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-14 18:41:42 +01:00
Eric Pouech
f799bf025b dbghelp: Don't write minidump from running thread.
In case a minidump is written from current process, create
a dedicated thread to write the minidump (and hide that thread
from the minidump).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-14 18:41:42 +01:00
Eric Pouech
56193155a0 dbghelp: Use an intermediate buffer in SymFunctionTableAccess (x86_64).
This mainly allows to release internal resources bound to image.
Also follow chained RUNTIME_FUNCTION entries (if any).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-14 18:41:42 +01:00
Eric Pouech
da22ef6c0d dbghelp/tests: Add tests for function table lookup.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-14 18:41:42 +01:00
Rémi Bernon
b59619d2e4 win32u: Enumerate monitors from their device keys. 2024-03-14 18:41:42 +01:00
Rémi Bernon
b4e4921cb6 win32u: Get rid of the monitor flags. 2024-03-14 18:41:42 +01:00
Rémi Bernon
d77d36b1f4 win32u: Get rid of the adapter display_device. 2024-03-14 18:41:42 +01:00
Rémi Bernon
e6a8fc2448 win32u: Get rid of the monitor state_flags. 2024-03-14 18:41:42 +01:00
Rémi Bernon
caf9585c3c win32u: Get rid of the monitor display_device. 2024-03-14 18:41:42 +01:00
Rémi Bernon
3bcd6f1aab win32u: Split writing monitor to registry to a separate helper. 2024-03-14 18:41:42 +01:00
Rémi Bernon
737e9d7ffc win32u: Add an adapter struct to the device manager context. 2024-03-14 18:41:42 +01:00
Alexandre Julliard
866907ee3d kernelbase: Remove no longer needed DllMainCRTStartup function. 2024-03-14 18:41:42 +01:00
Alexandre Julliard
180bd1044b ntdll: Implement RtlGetCallersAddress. 2024-03-14 18:02:29 +01:00
Alexandre Julliard
92d20c1120 ntdll/tests: Fix a few more test failures on ARM64EC. 2024-03-14 18:02:17 +01:00
Alexandre Julliard
3036dddca4 ntdll/tests: Fix debug register tests on ARM64EC. 2024-03-14 17:19:02 +01:00
Alexandre Julliard
97f07ae211 ntdll/tests: Skip segment register tests on ARM64EC. 2024-03-14 17:19:01 +01:00
Andrew Wesie
f6a1844dbe wined3d: Use bindless textures for GLSL shaders if possible.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44514
Signed-off-by: Andrew Wesie <awesie@gmail.com>
2024-03-14 10:16:34 +01:00
Zebediah Figura
6e619d98a3 wined3d: Move checking shader_update_mask to shader_glsl_apply_compute_state(). 2024-03-14 10:16:34 +01:00
Zebediah Figura
8e77d28165 wined3d: Rename the shader_select_compute method to shader_apply_compute_state.
Following shader_apply_draw_state.
2024-03-14 10:16:32 +01:00
Zebediah Figura
a81bcbe0a9 d3d11/tests: Add a test for using a large number of SRV resources. 2024-03-14 10:16:32 +01:00
Zebediah Figura
fc18e54e63 d3d9/tests: Remove a no longer accurate comment.
Fixes: 7641980a9e
2024-03-14 10:16:30 +01:00
Daniel Lehman
c1f5f98f79 oleaut32: Return success from GetSizeMax if not dirty. 2024-03-14 10:16:13 +01:00
Daniel Lehman
148db6a6c5 oleaut32/tests: Add tests for GetSizeMax after dirty flag cleared. 2024-03-14 10:16:13 +01:00
Louis Lenders
4edfe426e4 shell32: Try appending .exe when looking up an App Paths key.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51957
2024-03-14 10:16:06 +01:00
Andrew Nguyen
50a1c5bc92 oleaut32: Bump version resource to Windows 10.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55876
2024-03-14 10:11:10 +01:00
Eric Pouech
0d616f9eb0 dbghelp/tests: Test exception information in minidump.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-13 21:04:34 +01:00
Eric Pouech
504d0caae5 dbghelp/tests: Add tests about minidump's callback.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-13 21:04:34 +01:00
Eric Pouech
3316f59041 dbghelp/tests: Add tests about generated memory chunks.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-13 21:04:34 +01:00
Eric Pouech
9620340b6b dbghelp/tests: Add tests for minidumps.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-13 21:04:34 +01:00
Eric Pouech
abac4b879e include: Update minidumpapiset.h.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-13 21:04:34 +01:00
Alexandros Frantzis
5f76872e17 winewayland.drv: Implement wgl(Get)SwapIntervalEXT. 2024-03-13 20:59:56 +01:00
Alexandros Frantzis
065cbb460b winewayland.drv: Implement wglShareLists.
EGL works similarly to GLX, in that it only allows sharing on context
creation, so we adapt the approach used by winex11.
2024-03-13 20:59:54 +01:00
Alexandros Frantzis
ac32f0a81d winewayland.drv: Implement wglCreateContextAttribsARB. 2024-03-13 20:59:52 +01:00
Zebediah Figura
3042c7100c ntdll: Assign a primary token in elevate_token().
This fixes Quicken 2020 installation.
2024-03-13 20:59:42 +01:00
Vijay Kiran Kamuju
929732034c include: Add Windows.UI.ViewManagement.UIViewSettings definitions. 2024-03-13 19:10:58 +01:00
Rémi Bernon
00a541d6a0 win32u: Move D3DKMT VidPn* functions out of winex11. 2024-03-13 18:28:49 +01:00
Rémi Bernon
7299d3728a win32u: Move D3DKMT functions to a new d3dkmt.c source. 2024-03-13 18:28:49 +01:00
Alexandre Julliard
8c1f96f7ab ntdll: Always use SEH support on ARM64. 2024-03-13 11:26:39 +01:00
Alexandre Julliard
c47d6ef1f7 ntdll: Implement __C_specific_handler on ARM64EC. 2024-03-13 11:03:01 +01:00
Alexandre Julliard
7b5267cf63 ntdll: Move __C_specific_handler implementation to unwind.c. 2024-03-13 11:02:44 +01:00
Alexandre Julliard
83949ee269 ntdll: Implement RtlUnwindEx on ARM64EC. 2024-03-13 09:55:32 +01:00
Piotr Caban
174bb7776d ntdll: Workaround sendmsg bug on macOS.
There's a race on macOS when sending socket fd with sendmsg. The fd may get
broken if it's closed before recvmsg is called.
2024-03-12 22:36:12 +01:00
David Gow
e2b1de523e evr/dshow: Support NV12 in evr_render.
Add support for NV12 to evr_render(), as otherwise no video is rendered
at all in games like Age of Empires II DE.

In the process, the evr_copy_sample_buffer() function has been
refactored to move the MFCopyImage() call into format-specific code (to
better handle multi-planar formats cleanly).

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-03-12 22:36:12 +01:00
Hans Leidekker
1482e2f960 dnsapi/tests: Skip tests if no CNAME records are returned. 2024-03-12 22:36:12 +01:00
Dmitry Timoshkov
7c7702f91d kerberos: Allocate memory for the output token if requested.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-12 22:36:12 +01:00
Andrew Nguyen
2c8d4f5abd ddraw: Reserve extra space in the reference device description buffer.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56367
2024-03-12 22:36:12 +01:00
Dmitry Timoshkov
e42afe7daf wineps.drv: Return default resolution if PPD doesn't provide the list of supported resolutions.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-12 22:36:12 +01:00
Alexandre Julliard
f42316c86d ntdll: Port the RtlRestoreContext test to ARM. 2024-03-12 22:36:12 +01:00
Alexandre Julliard
74d1dbb95a ntdll: Port the RtlRestoreContext test to ARM64. 2024-03-12 22:36:12 +01:00
Alexandre Julliard
5286ed3b0a ntdll: Add test for non-volatile regs in consolidated unwinds. 2024-03-12 22:36:12 +01:00
Alexandre Julliard
ffade87df1 ntdll/tests: Fix a backtrace test failure on Windows ARM64. 2024-03-12 20:58:19 +01:00
Alexandre Julliard
99aee076e5 ntdll/tests: Directly link to setjmp(). 2024-03-12 20:49:21 +01:00
Alexandre Julliard
fd865a8386 include: Define setjmpex prototype even when it's a builtin. 2024-03-12 20:49:21 +01:00
Alexandre Julliard
66f940a2ec ws2_32/tests: Fix a couple of failures on Windows. 2024-03-12 20:49:21 +01:00
Marcus Meissner
084c8cc9c0 ntdll/tests: Fix size passed to GetModuleFileNameW. 2024-03-12 20:49:21 +01:00
Dmitry Timoshkov
354ddcb382 d2d1: Make some strings const.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-03-12 13:43:41 +01:00
Brendan McGrath
bbdc50c532 comdlg32: Don't treat cmb1 as the printer list unless in PRINT_SETUP.
This changes WMCommandW to match WMCommandA.
2024-03-12 13:43:41 +01:00
Brendan McGrath
39bd338a62 comdlg32: Use ANSI functions in ANSI WMCommandA. 2024-03-12 13:43:41 +01:00
Brendan McGrath
91207991f2 comdlg32: Populate printer name on the print dialogs.
This will display the name of the selected printer on the Print dialog
and the default printer on the Print Setup dialog
2024-03-12 13:43:41 +01:00
Brendan McGrath
8b7d1a65d0 comdlg32: Add resolutions to PRINTDLG_ChangePrinterW.
This was done in PRINTDLG_ChangePrinterA, but missing from
PRINTDLG_ChangePrinterW
2024-03-12 13:43:41 +01:00
Brendan McGrath
4ec559743d comdlg32: Use values from DeviceCapabilities in combobox.
dpiX,dpiY are the default printer values from the GetDeviceCaps calls.
This causes the item data to be the same for every option in the
combobox.

The item data should reflect the selected values.
2024-03-12 13:43:41 +01:00
Gabriel Ivăncescu
a9b3fdd3ae shell32: Construct the proper path target for UnixFolder.
Worse than just no unix integration is that it can actually crash if you
parse e.g. "/".

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-03-12 08:32:18 +01:00
Nikolay Sivov
40afa8d937 d3d10/tests: Add a small effect compilation test.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 08:31:51 +01:00
Nikolay Sivov
a44681e19b d3dcompiler: Wrap fx_4_x output in a dxbc container.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 08:31:51 +01:00
Nikolay Sivov
d01ae1512f d3dcompiler: Set correct compilation target for effects profiles.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 08:31:51 +01:00
Zhiyi Zhang
e21244f7a3 mfreadwrite: Fix a memory leak (Coverity). 2024-03-12 08:31:36 +01:00
Brendan Shanks
4860fbe7b5 secur32: Replace sprintf with snprintf to avoid deprecation warnings on macOS. 2024-03-11 22:19:49 +01:00
Brendan Shanks
5851ba8686 opengl32: Replace sprintf with snprintf/asprintf to avoid deprecation warnings on macOS. 2024-03-11 21:22:41 +01:00
Brendan Shanks
3af1e7df21 mountmgr: Replace some malloc/sprintf/strcpy calls with asprintf. 2024-03-11 21:22:08 +01:00
Brendan Shanks
a5b8e68422 mountmgr: Replace sprintf with snprintf to avoid deprecation warnings on macOS. 2024-03-11 21:22:08 +01:00
Jacek Caban
81111326ff configure: Don't explicitly enable -Wenum-conversion on Clang.
Clang enables -Wenum-conversion by default anyway, we add it to CFLAGS to enable them on GCC.
When explicitly enabled, Clang also enables additional warnings. Some of those warnings, like
-Wenum-enum-conversion, are too strict to be practical with win32, so avoid enabling them.
2024-03-11 20:11:18 +01:00
Jinoh Kang
b527b232cf tools/gitlab: Run make_specfiles before building.
Since wine commit 401288a78d (make_specfiles: Generate a list of
syscalls from the corresponding spec files., 2023-11-16), spec files
are used to auto-generate the following files:

- dlls/ntdll/ntsyscalls.h (from dlls/ntdll/ntdll.spec)
- dlls/win32u/win32syscalls.h (from dlls/win32u/win32u.spec)
2024-03-11 18:46:09 +01:00
Brendan Shanks
befd7abe10 server: Remove support for msg_accrights FD passing. 2024-03-11 18:12:03 +01:00
Brendan Shanks
af2c686628 ntdll: Remove support for msg_accrights FD passing. 2024-03-11 18:12:03 +01:00
Nikolay Sivov
f2e6fc695a include: Add ID2D1DeviceContext6 definition.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-11 18:12:03 +01:00
Nikolay Sivov
94f5cd1d30 include: Add ID2D1Factory7 definition.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-11 18:12:03 +01:00
Paul Gofman
d71fb7229f imm32: Set lengths to 0 for NULL strings in ImmSetCompositionString(). 2024-03-11 18:12:03 +01:00
Alexandre Julliard
834a88fc3f secur32/tests: Update count for new winehq.org certificate. 2024-03-11 18:12:03 +01:00
Alexandre Julliard
38fb2f41ad ntdll: Share RtlCaptureStackBackTrace implementation across platforms. 2024-03-11 17:31:38 +01:00
Alexandre Julliard
2bf209bb4f ntdll: Export RtlVirtualUnwind2 and RtlWalkFrameChain. 2024-03-11 17:29:44 +01:00
Alexandre Julliard
3418bf6ccd ntdll: Implement RtlWalkFrameChain on ARM64EC. 2024-03-11 17:29:44 +01:00
Alexandre Julliard
6184f74ef5 ntdll: Implement RtlWalkFrameChain on ARM64. 2024-03-11 17:29:44 +01:00
Alexandre Julliard
3938478aab ntdll: Implement RtlWalkFrameChain on ARM. 2024-03-11 17:29:44 +01:00
Alexandre Julliard
37ded7380e ntdll: Implement RtlWalkFrameChain on i386. 2024-03-11 17:29:44 +01:00
Alexandre Julliard
f127448d00 ntdll: Implement RtlWalkFrameChain on x86-64. 2024-03-11 17:29:44 +01:00
Alexandre Julliard
6d8b4e661f ntdll: Implement RtlRestoreContext on ARM64EC. 2024-03-11 16:43:44 +01:00
Alexandre Julliard
2ab736e292 configure: Check the correct variable for the Wayland EGL library.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56411
2024-03-11 15:19:20 +01:00
Esme Povirk
47e9980bb1 gdiplus: Check bounding box in GdipIsVisibleRegionPoint. 2024-03-11 12:18:49 +01:00
Esme Povirk
14f69583aa user32/tests: Accept HCBT_ACTIVATE in TrackPopupMenu. 2024-03-11 12:18:49 +01:00
Alexandre Julliard
1719aef8cb Release 9.4. 2024-03-08 23:35:07 +01:00
Rémi Bernon
28c52d4ac3 server: Remove desktop from their winstation list before looking for another input desktop. 2024-03-08 17:40:03 +01:00
Zhiyi Zhang
818d9a1210 win32u: Only send mouse input in ReleaseCapture() when a window is captured.
Fix a regression from "bb496ea8 - server: Always queue mouse messages delivered to another window."

Fix ETHER VAPOR Remaster (214570) launches to black screen when the cursor is in the game window.

The game calls ReleaseCapture() when handling WM_MOUSEMOVE. After bb496ea8, WM_MOUSEMOVE is always
queued because the message window is NULL. So ReleaseCapture() ends up queuing another WM_MOUSEMOVE.
So the game ends up handling infinite WM_MOUSEMOVE messages at startup and is not able to do anything.
2024-03-08 17:37:08 +01:00
Zhiyi Zhang
d47b13c45a user32/tests: Add some ReleaseCapture() tests. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
c51c257b06 msvcrt: Import longjmp from ntdll for PE builds. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
d538432d79 msvcrt: Import setjmp/setjmpex from ntdll. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
1d168222fd include: Always use _setjmpex on non-i386 platforms. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
5c26513278 winedump: Dump the __os_arm64x_helper functions. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
4a026f4230 ntdll: Support the __os_arm64x_helper functions in the loader. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
fd5b56b96d ntdll: Remove a misleading WARN. 2024-03-08 17:37:08 +01:00
Alexandre Julliard
8dc2cc24d7 ntdll: Don't copy a missing context in get_thread_context().
Fixes a test failure on ARM64EC.
2024-03-08 09:51:56 +01:00
Zebediah Figura
e92ba2de43 server: Create processes using a limited administrator token by default.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40613
2024-03-08 09:49:52 +01:00
Zebediah Figura
897bcd5d5c ntdll: Elevate processes if requested in the manifest.
Rufus 3.13 Portable requires administrator privileges, and uses a manifest to
elevate itself.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51000
2024-03-08 09:49:52 +01:00
Zebediah Figura
95a91bd816 ntdll: Implement NtSetInformationProcess(ProcessAccessToken). 2024-03-08 09:49:52 +01:00
Zebediah Figura
3103adb6a6 winetest: Elevate test processes on Wine. 2024-03-08 09:49:40 +01:00
Aida Jonikienė
4860be4747 msvcrt: Handle wide specifiers option in __stdio_common_vfscanf().
This prevents log spam in one game.
2024-03-08 09:48:43 +01:00
Esme Povirk
934cfb86b5 mscoree: Implement CLRRuntimeHost_Start. 2024-03-07 23:00:47 +01:00
Paul Gofman
d30dafa14d windows.media.speech: Force debug info in critical sections. 2024-03-07 22:56:13 +01:00
Paul Gofman
84cb31556a windows.gaming.input: Force debug info in critical sections. 2024-03-07 22:56:13 +01:00
Paul Gofman
5152e73779 wmiutil: Force debug info in critical sections. 2024-03-07 22:56:13 +01:00
Paul Gofman
3fd83279c0 winegstreamer: Force debug info in critical sections. 2024-03-07 22:56:12 +01:00
Paul Gofman
8857df969c urlmon: Force debug info in critical sections. 2024-03-07 22:56:12 +01:00
Paul Gofman
ec66697005 quartz: Force debug info in critical sections. 2024-03-07 22:56:12 +01:00
Gabriel Ivăncescu
b1a61e74a3 winex11: Set the correct visual even if alpha matches.
8a71a4a304 caused us to set a different visual
but with the correct alpha prior to actually setting it to the systray's
visual. In this case, the alpha would match and not set it to the systray's
visual. This caused the Ubuntu 23.10.1 default WM to crash.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-03-07 22:56:12 +01:00
Zebediah Figura
a0c390de8d shell32: Fix a test failure in test_DataObject().
Fixes: b6128bbb51
2024-03-07 22:56:12 +01:00
Connor McAdams
ec44170322 d3dx9: Preserve the contents of unaligned compressed destination surfaces.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
2024-03-07 22:56:12 +01:00
Connor McAdams
a1381fbedb d3dx9: Split off image decompression into a helper function.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
2024-03-07 22:56:12 +01:00
Connor McAdams
7ff4e5672d d3dx9: Split D3DXLoadSurfaceFromMemory functionality into a separate function.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
2024-03-07 22:56:12 +01:00
Connor McAdams
20b50c0096 d3dx9: Use base image pointer when decompressing source image.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
2024-03-07 22:56:12 +01:00
Connor McAdams
b5cd4c471a d3dx9/tests: Add more tests for misaligned compressed surface loading.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
2024-03-07 22:56:12 +01:00
Eric Pouech
d094bde414 dbghelp: Fixed module information when unmatched pdb file is loaded.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-07 22:56:12 +01:00
Eric Pouech
6ab88cafaa dbghelp: Don't fail in SymAddSymbol for modules without debug information.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-07 22:56:12 +01:00
Eric Pouech
61f9f5a05f dbghelp: Support SLMFLAG_NO_SYMBOLS in SymLoadModuleEx*().
Also correctly handling ImageName (the passed image name
in SymLoadModule) and LoadedImageName, which is only set when
debug info have been loaded (and is always an absolute path,
contrary to ImageName which can be relative).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-07 22:56:12 +01:00
Eric Pouech
51a0aaeff4 dbghelp/tests: Extend the tests for SymLoadModule().
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-07 22:56:12 +01:00
David McFarland
1496ce1614 mmdevapi: Add stub for IDeviceTopology. 2024-03-07 22:56:12 +01:00
David McFarland
ec2db2ff75 mmdevapi/tests: Add test for IDeviceTopology. 2024-03-07 22:56:12 +01:00
David McFarland
a30a617212 mmdevapi: Implement IAudioClient3_GetSharedModeEnginePeriod.
For now min/max/default are all hard-coded to ~10ms.
2024-03-07 22:56:12 +01:00
David McFarland
73a6f764d0 mmdevapi: Implement IAudioClient3_InitializeSharedAudioStream. 2024-03-07 22:56:12 +01:00
David McFarland
eef4a25d0c mmdevapi/tests: Add test for AudioClient3_InitializeSharedAudioStream. 2024-03-07 22:56:12 +01:00
Rémi Bernon
0d8bdf392f win32u: Keep the vulkan GUID on the gpu structure. 2024-03-07 22:56:12 +01:00
Rémi Bernon
c8d2955cdc win32u: Split read / write of gpu to registry to separate helpers. 2024-03-07 22:56:12 +01:00
Rémi Bernon
c67726b3d0 win32u: Enumerate devices with a dedicated helper.
Which will allow us to enumerate monitor devices later as well.
2024-03-07 22:56:12 +01:00
Rémi Bernon
788ba75432 win32u: Lookup adapter gpus from their device paths. 2024-03-07 22:56:12 +01:00
Rémi Bernon
955ddc6ea6 win32u: Load gpus from registry before adapters. 2024-03-07 22:56:12 +01:00
Rémi Bernon
c179b269ab win32u: Keep a reference on the adapters gpu. 2024-03-07 22:56:12 +01:00
Zebediah Figura
e5afb283cf shell32: Respect the drop effect in do_paste().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=34322
2024-03-07 22:56:12 +01:00
Zebediah Figura
a415874f59 shell32: Set the drop effect from the context menu. 2024-03-07 22:56:12 +01:00
Zebediah Figura
0c35d5cc29 shell32: Remove the no longer used ISFHelper::CopyItems() helper. 2024-03-07 22:56:12 +01:00
Zebediah Figura
a277ab8e42 shell32: Reimplement pasting from a CIDA without ISFHelper. 2024-03-07 22:56:12 +01:00
Alexandre Julliard
1c95001f8f d3dx9/tests: Mark failing tests as todo.
Triggered by the vkd3d 1.11 import.
2024-03-07 22:56:12 +01:00
Alexandre Julliard
27b22fedde d3d10_1/tests: Mark a failing test as todo.
Triggered by the vkd3d 1.11 import.
2024-03-07 22:56:12 +01:00
Alexandre Julliard
1edd53f00f ntdll: Implement _setjmpex on ARM64EC. 2024-03-07 22:56:12 +01:00
Alexandre Julliard
e1d624a06f ntdll: Export longjmp. 2024-03-07 12:38:05 +01:00
Alexandre Julliard
8ec8a7f11c ntdll: Export _setjmpex. 2024-03-07 12:31:09 +01:00
Alexandre Julliard
7a156cbd7f ntdll: Use jump buffer definitions from setjmp.h. 2024-03-07 10:23:15 +01:00
Brendan Shanks
542e11fcd9 quartz: Set the name of internal threads. 2024-03-07 08:58:49 +01:00
Eric Pouech
83476e3d4a dbghelp: Fix some corner case of virtual module loading.
Seen when debugging some game, one can load a virtual module with
a NULL image name.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-06 22:05:51 +01:00
Eric Pouech
4f80a599b6 dbghelp: Mimic native behavior for module name.
Module names appear in three spots in dbghelp:
  A) SymGetModuleInfo() .ModuleName
  B) module enumeration (as parameter in callback)
  C) in symbol/type research in module!name form

Tests show that:
- A) and B) always use only the derivation of the image
  name, whatever the passed module name in SymLoadModule().
- C) can use either the form derived from image name
  {as A) and B)}, but also the passed module name in
  SymLoadModule().

Note: B) is limited to 64 characters, while A) is limited to 32
characters (not tested here).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-06 22:05:49 +01:00
Eric Pouech
d6d22677da dbghelp: Change order when trying to load modules.
Change from: dll.so   > PE image > ELF/Mach-O images
into         PE image > dll.so   > ELF/Mach-O images

Main goal is in SymLoadModule*(), to not resynchronize the system
modules list when requesting loading of a PE image.
This can gain quite some time in some situations.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-06 22:05:47 +01:00
Eric Pouech
0e3dba2a7a dbghelp: Relax failure conditions.
dbghelp tests build PDB files, without hash table in TPI stream,
but also no types. Native is able to load these PDB files.
So, don't fail when loading a PDB without a TPI hash table and
without any types.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-06 22:05:34 +01:00
Eric Pouech
d05b7c8e19 dbghelp: Search subdirectories in element path.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-06 22:05:34 +01:00
Yuxuan Shui
28b94c4d42 dmime: Handle MIDI control events in MIDI files.
Adding them to the seqtrack, and also implementing playing them from the seqtrack.
2024-03-06 22:04:20 +01:00
Yuxuan Shui
5ff94358a0 dmime: Parse note on/off events and generate a seqtrack. 2024-03-06 22:04:20 +01:00
Yuxuan Shui
1df0e34293 dmime/tests: Call the correct QueryInterface function for DirectMusic track. 2024-03-06 22:04:20 +01:00
Rémi Bernon
24ad74ee26 server: Send emulated mouse messages on primary pointer updates. 2024-03-06 19:20:09 +01:00
Rémi Bernon
40b65e28a7 server: Continuously send pointer update messages while it's down. 2024-03-06 19:20:09 +01:00
Rémi Bernon
d8b8ac85eb server: Generate WM_POINTERENTER / WM_POINTERLEAVE messages. 2024-03-06 19:20:09 +01:00
Rémi Bernon
5b833c83be server: Stop waiting on LL-hooks for non-injected input. 2024-03-06 19:19:47 +01:00
Alexandros Frantzis
4bba16fd18 winewayland.drv: Handle resizing of OpenGL content.
Wayland surfaces don't have an inherent native size that the EGL
implementation can track, so we need to explicitly tell EGL about changes
in the native size with wl_egl_window_resize.

Since the resize can be triggered outside the GL render thread, and
wl_egl_window_resize is not thread safe (with respect to other EGL/GL
calls), we cannot call it directly at will. Instead we mark the
wayland_gl_drawable as resized, and actually call the
wl_egl_window_resize function from the thread in which the respective
drawable is current.

Note that the first EGL/GL operation that requires a new backbuffer
latches whatever native size we have reported, until the next
eglSwapBuffers. In order to ensure the current native size is applied as
soon as possible (to avoid glitches), we check for and apply resizes at
a few extra points where a new backbuffer may be required (e.g.,
glClear, eglMakeCurrent).
2024-03-06 19:12:18 +01:00
Alexandros Frantzis
aed0c822f1 winewayland.drv: Implement wglSwapBuffers. 2024-03-06 19:12:16 +01:00
Alexandros Frantzis
075a0e2623 winewayland.drv: Implement wglMakeCurrent and wglMakeContextCurrentARB. 2024-03-06 19:12:14 +01:00
Alexandros Frantzis
e8f7660c75 winewayland.drv: Implement OpenGL context creation.
Each WGL context is backed by a config-less EGL context. We require the
EGL_KHR_no_config_context extension.
2024-03-06 19:12:12 +01:00
Alexandros Frantzis
e7ccb1480a winewayland.drv: Implement wglSetPixelFormat(WINE).
Introduce the internal wayland_gl_drawable object, which associates a
window (and its backing Wayland surface) with an EGL surface.
2024-03-06 19:12:08 +01:00
Alexandros Frantzis
825ec8c597 winewayland.drv: Implement wglDescribePixelFormat.
Create an array of supported EGLConfigs, and use this information to
populate the PIXELFORMATDESCRIPTOR.
2024-03-06 19:12:07 +01:00
Alexandros Frantzis
d47220a23c winewayland.drv: Implement wglGetProcAddress. 2024-03-06 19:12:05 +01:00
Alexandros Frantzis
e5d995d826 winewayland.drv: Implement wglGetExtensionsString{ARB,EXT}. 2024-03-06 19:12:03 +01:00
Alexandros Frantzis
ea522c6135 winewayland.drv: Initialize core GL functions. 2024-03-06 19:12:01 +01:00
Alexandros Frantzis
aaaac72fdb winewayland.drv: Add skeleton OpenGL driver.
The driver performs basic EGL initialization.
2024-03-06 19:11:56 +01:00
Rémi Bernon
c0d0468da9 winex11: Select XI_Touch* input and translate it to WM_POINTER*. 2024-03-06 19:03:26 +01:00
Rémi Bernon
0f1322d2df winex11: Support XInput2 events on individual windows. 2024-03-06 19:03:26 +01:00
Hans Leidekker
e7ff2688c8 wbemprox: Use separate critical sections for tables and table list. 2024-03-06 19:03:11 +01:00
Ziqing Hui
ff0cd457b4 winegstreamer: Set AvgTimePerFrame in GetOutputType() for WMV decoder.
Krkr2 game engine need AvgTimePerFrame to calculate video frame time.
2024-03-06 19:01:38 +01:00
Ziqing Hui
732ed62819 mf/tests: Test AvgTimePerFrame for WMV decoder DMO. 2024-03-06 19:01:38 +01:00
Zebediah Figura
f8ddba3ad0 shell32: Implement IDataObject::SetData(). 2024-03-06 19:01:28 +01:00
Zebediah Figura
4f02c8ba2d shell32: Reimplement the data object to store a generic array of HGLOBALs. 2024-03-06 19:01:28 +01:00
Zebediah Figura
0344f3aa85 shell32: Do not interpret the direction in IDataObject::EnumFormatEtc(). 2024-03-06 19:01:28 +01:00
Zebediah Figura
b6128bbb51 shell32/tests: Add more tests for IDataObject. 2024-03-06 19:01:28 +01:00
Rémi Bernon
e614610aaf win32u: Introduce and use new reg_(open|create)_ascii_key helpers. 2024-03-06 18:59:34 +01:00
Rémi Bernon
6b8b35f950 win32u: Use set_reg_ascii_value whenever possible. 2024-03-06 18:59:34 +01:00
Rémi Bernon
3909a93bc2 win32u: Remove unnecessary class_guidW double check. 2024-03-06 18:59:34 +01:00
Rémi Bernon
eaed90d9b4 win32u: Use REG_SZ instead of REG_BINARY for some adapter keys. 2024-03-06 18:59:34 +01:00
Rémi Bernon
20a09a3071 win32u: Remove unused wine_devpropkey_monitor_adapternameW property. 2024-03-06 18:59:34 +01:00
Rémi Bernon
ab5d9bb67b win32u: Simplify adapter key path creation from gpu_guid. 2024-03-06 18:59:34 +01:00
Rémi Bernon
8fcc3c4efe win32u: Use char array for the device manager context gpuid. 2024-03-06 18:59:34 +01:00
Zebediah Figura
910bd392f6 mciwave: Abort the playback thread regardless of state when stopping. 2024-03-06 18:57:12 +01:00
Alexandre Julliard
5bb80251b1 vkd3d: Import upstream release 1.11. 2024-03-06 12:45:47 +01:00
Alexandre Julliard
ec2e266c76 ntdll: Implement KiUserExceptionDispatcher on ARM64EC. 2024-03-06 12:32:18 +01:00
Alexandre Julliard
e6ce5d5df7 ntdll: Implement exception dispatching on ARM64EC. 2024-03-06 12:24:15 +01:00
Alexandre Julliard
daea0b9b57 ntdll: Allocate the data structure and stack for the ARM64EC emulator. 2024-03-06 12:24:15 +01:00
Nikolay Sivov
5eb46419b4 d3d10_1/tests: Add an effect compilation test using 10.1 features.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-05 22:32:17 +01:00
Nikolay Sivov
0a9ad614e6 d3d10_1/tests: Add a basic test for returned preferred profiles.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-05 22:32:17 +01:00
Henri Verbeet
37bb8c14e0 wined3d: Slightly adjust an ERR in shader_spirv_compile_shader().
We're not necessarily compiling DXBC shaders here after commit
1474f5cc47.
2024-03-05 20:52:48 +01:00
Daniel Lehman
91e5d21cdf ole32/tests: Remove todo from lock tests. 2024-03-05 20:52:41 +01:00
Daniel Lehman
2fc073591b ole32: Do not lock storage in read-only deny-write mode. 2024-03-05 20:52:41 +01:00
Zebediah Figura
6fa1458378 wined3d/nvrc: Remove now redundant WINED3D_TSS_RESULT_ARG handlers.
nvrc_update_color_op() takes care of this. Redirect WINED3D_TSS_RESULT_ARG to nvrc_colorop() so that the shader is invalidated.
2024-03-05 20:50:40 +01:00
Zebediah Figura
c3840b6c49 wined3d/nvrc: Move alpha op application to nvrc_apply_draw_state(). 2024-03-05 20:50:39 +01:00
Zebediah Figura
115d690731 wined3d/nvrc: Remove now redundant STATE_SAMPLER handlers.
nvrc_update_color_op() takes care of this. Redirect STATE_SAMPLER to nvrc_colorop() so that the shader is invalidated.
2024-03-05 20:50:38 +01:00
Zebediah Figura
1c03b29f7b wined3d/nvrc: Move color ops from nvrc_colorop() to nvrc_apply_draw_state(). 2024-03-05 20:50:37 +01:00
Zebediah Figura
e65679f455 wined3d/nvrc: Move FFP bumpenv constant loading to nvrc_apply_draw_state(). 2024-03-05 20:50:35 +01:00
Zebediah Figura
8f2586cfb5 wined3d/nvrc: Move TEXTUREFACTOR constant loading to nvrc_apply_draw_state(). 2024-03-05 20:50:34 +01:00
Martin Storsjö
aa78b46e9c arm64: Expose information about more modern CPU extensions.
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-03-05 20:50:23 +01:00
Rémi Bernon
c9ffab4602 win32u: Add support for sending and receiving WM_POINTER* messages. 2024-03-05 20:50:07 +01:00
Rémi Bernon
61d1c18957 server: Add support for sending and receiving WM_POINTER* messages. 2024-03-05 20:50:07 +01:00
Rémi Bernon
48f8db6c30 mouhid.sys: Send WM_POINTER* messages on contact updates. 2024-03-05 20:50:07 +01:00
Rémi Bernon
13f908b9b5 dinput/tests: Test the WM_POINTER* message parameter values. 2024-03-05 20:50:07 +01:00
Rémi Bernon
bb5f0e122f win32u: Use a custom struct hid_input for NtUserSendHardwareInput. 2024-03-05 20:50:06 +01:00
Rémi Bernon
66baee8b99 win32u: Use NtUserCallHwndParam interface for __wine_send_input. 2024-03-05 20:50:06 +01:00
Eric Pouech
ad921b3c56 dbghelp: Return matched information for path_find_symbol_file.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-05 20:46:36 +01:00
Eric Pouech
f824a72c7f dbghelp: Get rid of struct pdb_lookup.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-05 20:46:36 +01:00
Eric Pouech
feee77f84d dbghelp: Rework loading of PDB string table.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-05 20:46:36 +01:00
Eric Pouech
f014745676 dbghelp: Always use SymGetSrvIndexFileInfo() for files lookup.
This will help separate debug info files lookup from their actual
loading once found and correctly matched.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-05 20:46:34 +01:00
Eric Pouech
ec099b8ea3 dbghelp/tests: Add more tests for SymLoadModule*.
- SymLoadModules flags (SLMFLAG_VIRTUAL and SLMFLAG_NO_SYMBOLS),
- handling of load details (SymType, ImageName vs LoadedImageName,
  various instances of module name).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-05 20:46:26 +01:00
Alexandre Julliard
a9428fe390 ntdll: Use a common wrapper to call unwind handlers on ARM. 2024-03-05 14:34:52 +01:00
Alexandre Julliard
5f890e3ce9 ntdll: Use a common wrapper to call unwind handlers on ARM64. 2024-03-05 14:34:52 +01:00
Alexandre Julliard
d6285af1fc ntdll: Use a common wrapper to call exception handlers on ARM. 2024-03-05 10:30:26 +01:00
Alexandre Julliard
8d8c10fe92 ntdll: Use a common wrapper to call exception handlers on ARM64. 2024-03-05 10:30:17 +01:00
Alexandre Julliard
5c98412929 ntdll: Also copy non-volatile regs on collided unwind.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56401
2024-03-05 10:14:18 +01:00
Paul Gofman
6f55a13169 ntdll: Respect red zone in usr1_handler() on x64.
Fixes a regression introduced by
efd3d31082.
2024-03-05 09:03:48 +01:00
Eric Pouech
c1b8db0c28 dbghelp: Don't search the passed path in SymFindFileInPath.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-04 22:52:13 +01:00
Eric Pouech
1648569fad dbghelp: Don't fail on loading 64bit modules on 32bit applications.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-04 22:52:13 +01:00
Eric Pouech
0ca1350a03 dbghelp/tests: Add tests about SymLoadModule and finding pdb files.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-04 22:52:13 +01:00
Eric Pouech
a56b018713 dbghelp/tests: Add tests for SymFindFileInPath for pdb files.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-04 22:52:13 +01:00
Eric Pouech
2abbee9540 dbghelp/tests: Add tests for image files lookup.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-04 22:52:13 +01:00
Zhiyi Zhang
058bfeed1d advapi32/tests: Test creating registry keys with a NULL return key pointer. 2024-03-04 22:50:27 +01:00
Zhiyi Zhang
d2045611b6 advapi32: Check NULL return key pointers when creating registry keys.
Fix Warlords Battlecry III (433280) crashes at launch.
2024-03-04 22:50:25 +01:00
Florian Will
8dc5242e29 ws2_32: Implement TCP_KEEP{ALIVE,CNT,INTVL} options. 2024-03-04 22:39:57 +01:00
Florian Will
26136fda8d ws2_32/tests: Test TCP_KEEP{ALIVE,CNT,INTVL} options. 2024-03-04 22:39:57 +01:00
Florian Will
6d2a900487 include: Add TCP_KEEPCNT and TCP_KEEPINTVL definitions. 2024-03-04 22:39:57 +01:00
Connor McAdams
eb06945b5b webservices/tests: Fix -Warray-bounds warning on gcc 13.2.0.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
2024-03-04 16:54:54 +01:00
Nikolay Sivov
2c9f67938f d3dcompiler: Enable semantic names mapping in compatibility mode.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-04 16:54:54 +01:00
Zebediah Figura
af7f11bb2a shell32: Implement Paste in the item menu.
Based on a patch by Michael Müller.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=34319
2024-03-04 15:39:06 +01:00
Zebediah Figura
5744ef64a4 shell32: Respect the parent PIDL when pasting from CFSTR_SHELLIDLIST. 2024-03-04 15:39:06 +01:00
Zebediah Figura
c4b38894cd shell32: Reimplement pasting from CF_DROP directly.
Don't convert the source to PIDLs just to convert it back to paths.
2024-03-04 15:39:06 +01:00
Zebediah Figura
48bcf74678 shell32: Add a get_data_format() helper.
Make the logic in do_paste() a bit more idiomatic.
2024-03-04 15:39:06 +01:00
Zebediah Figura
35f5997075 shell32: Move DoPaste() up.
And simplify the control flow a bit while we're at it.
2024-03-04 15:39:06 +01:00
Zebediah Figura
0bc47920d3 shell32: Remove useless and commented out code. 2024-03-04 15:39:06 +01:00
Zebediah Figura
08219c02b3 shell32/tests: Add tests for context menu copy/paste. 2024-03-04 15:39:06 +01:00
Zebediah Figura
366398cc53 msi: Create the custom action server as an elevated process.
Dragon Naturally Speaking 12.5 manually validates that the custom action server
is elevated.

One might imagine that the right approach here is to add a manifest to msiexec;
however, msiexec does not always trigger a UAC prompt on Windows.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51143
2024-03-04 15:39:06 +01:00
Zebediah Figura
b381f9d095 wine.inf: Set the EnableLUA value to 1.
This signifies that UAC is active.

Foobar2000 checks this value, and won't even try to elevate itself otherwise.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50727
2024-03-04 15:39:06 +01:00
Zebediah Figura
8cc22a60c3 shell32: Elevate the child process for the "runas" verb.
Like all other verbs, the actual command line template is specified in the
registry. The elevation seems to be hardcoded into shell32 for this specific
verb.

The Foobar2000 installer requires administrator privileges, and elevates itself
in this way.

Based on a patch by Michael Müller.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50727
2024-03-04 15:39:06 +01:00
Philip Rebohle
ec6879b78e winevulkan: Update to VK spec version 1.3.279.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2024-03-04 15:39:06 +01:00
Hans Leidekker
90f31fbd0a netprofm/tests: Mark a test result as broken on Windows 11. 2024-03-04 15:39:06 +01:00
Shaun Ren
43220a6063 sapi: Implement ISpeechVoice::{get/putref}_Voice. 2024-03-04 15:39:06 +01:00
Shaun Ren
7c384f361a sapi: Implement ISpeechVoice::{get/put}_Volume. 2024-03-04 15:39:06 +01:00
Rémi Bernon
bf800b5e76 mfreadwrite/reader: Adjust min_buffer_size to be 1s of audio data. 2024-03-04 15:39:06 +01:00
Zhiyi Zhang
7865026f53 rtworkq: Avoid possible scenarios that an async callback could be called twice.
Consider a thread A running waiting_item_cancelable_callback() and a thread B running queue_cancel_item(),
which is the scenario from canceling a work item right after it gets submitted by RtwqPutWaitingWorkItem().
When the invoke_async_callback() call in queue_cancel_item() for item key with WAIT_ITEM_KEY_MASK in
thread B runs before the queue_release_pending_item() in waiting_item_cancelable_callback() in thread
A, the async callback is called the first time in queue_cancel_item() with RTWQ_E_OPERATION_CANCELLED,
then a second time in waiting_item_cancelable_callback(). We should check in queue_release_pending_item()
whether an item is already removed by queue_cancel_item() before calling async callbacks.

A different scenario could happen for scheduled_item_cancelable_callback() with the function ends
up calling its async callback even after it has been canceled by queue_cancel_item().
2024-03-04 15:39:06 +01:00
Zhiyi Zhang
f3bab6c5b7 rtworkq: Avoid closing a thread pool object while its callbacks are running.
Consider a thread A running scheduled_item_cancelable_callback() and a thread B running queue_cancel_item(),
which is the scenario from canceling a work item right after it gets submitted by RtwqScheduleWorkItem().
When the CloseThreadpoolTimer() call in queue_cancel_item() in thread B runs before the queue_release_pending_item()
in scheduled_item_cancelable_callback() in thread A, scheduled_item_cancelable_callback() ends up
calling work_item_Release() and CloseThreadpoolTimer() is called again for the same timer object. So
the thread pool timer object end up getting released while the scheduled_item_cancelable_callback()
is running, triggering the '!object->num_running_callbacks' assertion in tp_object_release(). This
is actually a double free but the assertion happens before the second free could happen. The same
thing could happen for thread pool wait objects as well.

Fix mf and mfmediaengine tests sometimes trigger the '!object->num_running_callbacks' assertion.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55724
2024-03-04 15:39:06 +01:00
Tim Clem
c5f9d9188a winebus.sys: Only attempt to open joysticks and gamepads in the IOHID backend.
An extension of 3985b7c5. Opening the device for the Touch Bar on
older MacBooks also triggers a permission prompt, so for now it makes
sense to restrict the devices we open.
2024-03-04 15:39:06 +01:00
Zebediah Figura
4a227c62a5 msi: Multiply by 512 in dialog_vcl_add_drives().
The main motivation here is to avoid overflow, and multiplying in one place seems simpler.
2024-03-04 15:39:06 +01:00
Zebediah Figura
d7bbe884ef msi: Store component cost in 512-byte units.
This avoids overflow when component costs exceed 4 GB.
2024-03-04 15:39:06 +01:00
Zebediah Figura
9725a2286a msi: Round costs up to 4096 bytes instead of clamping. 2024-03-04 15:39:05 +01:00
Zebediah Figura
674efeb1f7 msi/tests: Expand costing tests. 2024-03-04 15:39:05 +01:00
Alexandre Julliard
0c35e9adce ntdll: Use the correct structure for non-volatile registers on ARM. 2024-03-04 14:07:28 +01:00
Alexandre Julliard
42cebcca3c ntdll: Use the correct structure for non-volatile registers on ARM64. 2024-03-04 14:07:28 +01:00
Alexandre Julliard
a9671befc1 ntdll: Always use SEH support on ARM. 2024-03-03 23:10:35 +01:00
Alexandre Julliard
40bda46795 ntdll: Port the RtlRaiseException test to ARM. 2024-03-03 23:10:13 +01:00
Alexandre Julliard
077252f13b ntdll: Port the RtlRaiseException test to ARM64. 2024-03-03 23:10:13 +01:00
Tim Clem
0fb7c99c33 win32u: Don't mask keyboard scan codes when processing them for IME.
Fixes missed key up events on older macOS versions, which could
result in out-of-order input.

Fix via Rémi Bernon <rbernon@codeweavers.com>.
2024-03-01 23:14:22 +01:00
Tim Clem
93bc97e54f winemac.drv: Exclude the emoji Touch Bar when looking for input methods.
Fixes weird keyboard behavior on MacBooks with the Touch Bar.
2024-03-01 23:14:22 +01:00
Esme Povirk
55f71fd846 gdiplus: Implement font linking in GdipAddPathString. 2024-03-01 23:14:22 +01:00
Esme Povirk
3ca8204837 gdiplus: Fix use after free in GdipAddPathString. 2024-03-01 23:14:22 +01:00
Paul Gofman
02b68a0ac1 qcap: Force debug info in critical sections. 2024-03-01 23:14:22 +01:00
Paul Gofman
6e1e52cbc3 ole32: Force debug info in critical sections. 2024-03-01 23:14:22 +01:00
Paul Gofman
e02b3379eb mcicda: Force debug info in critical sections. 2024-03-01 23:14:22 +01:00
Paul Gofman
a7d3d574c0 comctl32: Force debug info in critical sections. 2024-03-01 23:14:22 +01:00
Paul Gofman
7c387c0b0e winexinput.sys: Force debug info in critical sections. 2024-03-01 23:14:22 +01:00
Michael Müller
cfab11e16a wine.inf: Register the New menu as a directory background context menu handler.
CDBurnerXP expects the ContextMenuHandlers key to exist, and apparently
enumerates it until it receives ERROR_NO_MORE_ITEMS. If it fails to open the
key, it will spin forever trying to call RegEnumKeyExW(NULL) and getting
ERROR_INVALID_HANDLE.

We could simply create an empty ContextMenuHandlers key here, but this will
allow the New menu to work in the builtin explorer view once shellex handlers
are implemented.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=29523
2024-03-01 23:14:22 +01:00
Yuxuan Shui
f0fc4a0d89 dmime: Parse MIDI Set Tempo meta events and generate a tempotrack. 2024-03-01 23:14:22 +01:00
Yuxuan Shui
1b1f216278 dmime: Implement setting TempoParam for tempotracks.
And add some tests.
2024-03-01 23:14:22 +01:00
Yuxuan Shui
6a3f067eca dmime: Use linked list for tempotrack.
Preparation for supporting setting TempoParam on tempotracks.
2024-03-01 23:14:22 +01:00
Henri Verbeet
9e79b9ffd9 wined3d: Pass "shader->function" as source to vkd3d_shader_scan() in shader_spirv_scan_shader().
Much like we do in shader_spirv_find_graphics_program_variant_vk() for
shader_spirv_compile_shader(). When compiling an Aon9 shader,
"shader->byte_code" points to the DXBC container, while
"shader->function" points to the contained d3dbc shader.
2024-03-01 23:14:22 +01:00
Rémi Bernon
440edde5e1 mfreadwrite/reader: Implement IMFSourceReaderEx_GetTransformForStream. 2024-03-01 23:14:22 +01:00
Rémi Bernon
ea4b9bafb2 mfreadwrite/reader: Create and append a converter transform.
This enables advanced color conversion in all cases, and thus allows
NV12 -> RGB32 conversion even when MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING
is not set. This should be harmless and makes the code simpler as we
can simply append a VideoProcessor transform in all cases.

The tests todos is tweaked to reflect cases where a single processor
is used, which outputs slightly different attributes to when it is
connected to an upstream decoder. Ultimately we could try to match
native here, but it shouldn't matter too much in the meantime.
2024-03-01 23:14:22 +01:00
Rémi Bernon
d6c9ac94d2 mfreadwrite/reader: Keep the stream transforms in a list. 2024-03-01 23:14:22 +01:00
Rémi Bernon
48cb5297e7 mfreadwrite/reader: Call SetOutputType directly on the decoder transform. 2024-03-01 23:14:22 +01:00
Rémi Bernon
ba3799527c mf/topology_loader: Only propagate some media type attributes. 2024-03-01 23:14:22 +01:00
Rémi Bernon
7325dd4a5a mfreadwrite/reader: Split source_reader_create_decoder_for_stream helper. 2024-03-01 23:14:22 +01:00
Alexandre Julliard
f9dd0fca4c qwave/tests: Remove todo from a succeeding test. 2024-03-01 23:14:22 +01:00
Alexandre Julliard
577c327a44 kernelbase: Implement RaiseException on ARM64EC. 2024-03-01 19:12:10 +01:00
Alexandre Julliard
f35e2d513d ntdll: Implement RtlRaiseException on ARM64EC. 2024-03-01 19:12:10 +01:00
Alexandre Julliard
462b27d87f ntdll/tests: Use a proper handler in the RtlRaiseException test on x86-64. 2024-03-01 19:12:10 +01:00
Alexandre Julliard
ca5984059c ntdll: Implement RtlVirtualUnwind2. 2024-03-01 11:16:54 +01:00
Alexandre Julliard
9ac8d63e22 include: Move unwinding functions definitions to rtlsupportapi.h. 2024-03-01 10:21:48 +01:00
Rémi Bernon
630d79439c winewayland: Remove unnecessary vkDestroySurfaceKHR NULL checks. 2024-03-01 10:21:32 +01:00
Rémi Bernon
a3adb19bef winemac: Remove unnecessary vkDestroySurfaceKHR NULL checks. 2024-03-01 10:21:32 +01:00
Rémi Bernon
e3e628247d winex11: Remove unnecessary vkDestroySurfaceKHR NULL checks. 2024-03-01 10:21:32 +01:00
Rémi Bernon
0dd1502f57 winemac: Remove unnecessary macdrv_get_vk_* helper. 2024-03-01 10:21:29 +01:00
Rémi Bernon
77f4d2207a winex11: Remove unnecessary X11DRV_get_vk_* helpers. 2024-03-01 10:21:29 +01:00
Rémi Bernon
6f122f48d3 winewayland: Remove now unnecessary vulkan function name mapping. 2024-03-01 10:21:29 +01:00
Rémi Bernon
684d51cebb winemac: Remove now unnecessary vulkan function name mapping. 2024-03-01 10:21:29 +01:00
Rémi Bernon
2b25f51e0d winex11: Remove now unnecessary vulkan function name mapping. 2024-03-01 10:21:29 +01:00
Rémi Bernon
f3d3b86668 winevulkan: Succeed VK_KHR_win32_surface procs queries when enabled. 2024-03-01 10:21:29 +01:00
Daniel Lehman
f4a91bcb8a oleaut32: Implement GetSizeMax for BMPs. 2024-03-01 10:12:38 +01:00
Aurimas Fišeras
e5085327ff po: Update Lithuanian translation. 2024-03-01 10:09:05 +01:00
Paul Gofman
1d3b312f22 amstream: Force debug info in critical sections. 2024-02-29 21:22:28 +01:00
Paul Gofman
ce2457d5a9 amstream: Avoid leaking critical section debug info in filter_Release(). 2024-02-29 21:22:27 +01:00
Paul Gofman
c064fdeb8d windows.security.credentials.ui.userconsentverifier: Force debug info in critical sections. 2024-02-29 21:22:26 +01:00
Paul Gofman
ee5828da6a winebus.sys: Force debug info in critical sections. 2024-02-29 21:22:24 +01:00
Paul Gofman
b466a40ffb winmm: Force debug info in critical sections. 2024-02-29 21:22:24 +01:00
Paul Gofman
497992c4ea mciavi32: Force debug info in critical sections. 2024-02-29 21:22:24 +01:00
Jacek Caban
1999e4f3f5 winevulkan: Use VK_EXT_map_memory_placed for memory mapping on wow64. 2024-02-29 21:22:18 +01:00
Jacek Caban
d8e0c8adea winevulkan: Refactor extra extensions handling in wine_vk_device_convert_create_info. 2024-02-29 21:22:18 +01:00
Jacek Caban
64914849ac winevulkan: Use handle map for memory objects. 2024-02-29 21:22:18 +01:00
Jacek Caban
84e4620706 winevulkan: Rename wine_device_memory mapping to vm_map.
To avoid conflict with handle mapping macros.
2024-02-29 21:22:16 +01:00
Jacek Caban
7995f3813c winevulkan: Remove no longer needed spec workarounds. 2024-02-29 21:22:13 +01:00
Jacek Caban
f380e34a5e winevulkan: Update to VK spec version 1.3.278.
The new spec uses length attribute for some static arrays. Change is_dynamic_array
to account account for that. Eventually we could use the new information to improve
conversion thunks.
2024-02-29 21:22:06 +01:00
Noah Berner
2dcc8ec08d comctl32/tests: Fix test that fails on Feb 29th. 2024-02-29 19:25:10 +01:00
Daniel Lehman
8c5b08d81c oleaut32: Implement GetSizeMax for empty picture. 2024-02-29 19:22:22 +01:00
Daniel Lehman
beececd101 oleaut32/tests: Add tests for IPersistStream::GetSizeMax. 2024-02-29 19:22:22 +01:00
Zebediah Figura
820b5ff0d1 shell32/tests: Add a few more tests for the New menu. 2024-02-29 19:21:50 +01:00
Zebediah Figura
9d9c3960ef shell32: Implement InvokeCommand() for the new menu. 2024-02-29 19:21:47 +01:00
Zebediah Figura
c2ee8627ff shell32: Enumerate the ShellNew key for Folder. 2024-02-29 19:21:37 +01:00
Zebediah Figura
227408c4fc wine.inf: Add ShellNew registry entries for Folder. 2024-02-29 19:21:08 +01:00
Zebediah Figura
e564b0d775 shell32: Return an initial "New" menu. 2024-02-29 19:19:28 +01:00
Alexandre Julliard
c67053bcce include: Remove the private definitions of the exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
64b2e44697 widl: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
b0a7439b30 winedbg: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
18543523e8 wow64: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
8605708e02 winecrt0: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
3282eda525 win32u: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
8739aef4ff msvcrt: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
35ef1be8ef msvcp90: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
9c5df8004d krnl386.exe: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
0698f732af kernelbase: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Alexandre Julliard
97259a3049 ntdll: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Jacek Caban
7a66313cfb winebuild: Output load config on PE targets. 2024-02-29 08:39:30 +01:00
Brendan McGrath
57c2c41d75 mshtml: Don't handle special case when doc != node->doc. 2024-02-29 08:38:38 +01:00
Brendan McGrath
74ff9f2371 mshtml: Always use the event target dispex.
The event target may be from a different document to the document associated with the
event handler.
2024-02-29 08:38:36 +01:00
Brendan McGrath
34a8478da8 mshtml/tests: Add test for document mode after InitNew and Load. 2024-02-29 08:38:36 +01:00
Brendan McGrath
54980a7868 mshtml: Use generic event dispatcher for DOMContentLoaded.
Use generic event dispatcher instead of nsevent for the
DOMContentLoaded event.

Also allow processing before dispatching event.

Only update dom_content_loaded_event start/end time when the event is
trusted.
2024-02-29 08:38:35 +01:00
Brendan McGrath
277acf61d0 mshtml: Pass DOMEvent instead of nsIDOMEvent during handle_event. 2024-02-29 08:38:33 +01:00
Paul Gofman
6cbe072c37 kernelbase: Use KEY_WOW64_64KEY flag when 64 bit registry access is assumed. 2024-02-28 22:40:43 +01:00
Aida Jonikienė
61983465aa qwave: Add tests for QOSCloseHandle(). 2024-02-28 21:57:55 +01:00
Aida Jonikienė
d6f13d8e0c qwave: Add QOSCloseHandle() stub.
Discord calls this function when hanging up a call.
2024-02-28 21:57:52 +01:00
Piotr Caban
da84d77353 wininet: Fix memory leak when loading proxy information. 2024-02-28 21:57:35 +01:00
Yuxuan Shui
29f73d6669 dmime: Add a stub chordtrack for MIDI segments. 2024-02-28 21:56:24 +01:00
Yuxuan Shui
05347b9703 dmime: Parse MIDI program change events and generate a bandtrack. 2024-02-28 21:56:24 +01:00
Yuxuan Shui
aebcb1a996 dmime: Better MIDI parsing interface.
MIDI tracks don't map one-to-one to segment tracks, so it doesn't make sense to use a
"get_next_track()" interface.
2024-02-28 21:56:22 +01:00
Yuxuan Shui
09c6f48b12 dmband: Move band.c to dmusic. 2024-02-28 21:56:19 +01:00
Alexandros Frantzis
8e0a00db04 winex11.drv: Remove unused refresh_drawables field.
The field is set but no longer read from.
2024-02-28 21:56:10 +01:00
Rémi Bernon
72c228a3ab winevulkan: Remove unnecessary WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT quirk. 2024-02-28 21:55:25 +01:00
Esme Povirk
1ee1f2e9d7 gdiplus: Fix crash in GdipAddPathString.
Apparently, 1454ffe7dd introduced
the assumption that the font passed to gdip_format_string is
non-NULL, and GdipAddPathString wasn't passing it in.
2024-02-28 21:54:59 +01:00
Alexandre Julliard
ebaa47dcee winedump: Print the correct register names for exception info on ARM64. 2024-02-28 19:51:20 +01:00
Alexandre Julliard
3de0f99d4e ntdll: Remove no longer needed definitions from the private header. 2024-02-28 19:51:20 +01:00
Alexandre Julliard
9478e1f74c ntdll: Move RtlHashUnicodeString constants to a public header. 2024-02-28 19:51:20 +01:00
Alexandre Julliard
6a153ac33e ntdll: Use the exported structures for dll redirection data. 2024-02-28 19:51:20 +01:00
Alexandre Julliard
31e3c4316d ntdll: Implement RtlCaptureContext on ARM64EC. 2024-02-28 19:51:20 +01:00
Rémi Bernon
9591a36ee8 server: Dispatch rawinput messages using the rawinput process list. 2024-02-28 19:51:20 +01:00
Rémi Bernon
c43b1ecbc3 server: Keep a list of processes that can receive rawinput messages. 2024-02-28 19:51:20 +01:00
Rémi Bernon
f7303cf7b6 server: Keep a list of threads connected to each desktop. 2024-02-28 19:51:20 +01:00
Rémi Bernon
496eed7aaf server: Send hardware input to the visible input desktop.
When hwnd is specified, it is because it received a direct host input,
so switch the input desktop to match the one that is receiving it.

We don't validate that the sending thread uses the same desktop as the
target window: it may not even be the case for drivers with a separate
thread that listens on input events.
2024-02-28 19:51:20 +01:00
Rémi Bernon
a1d63d109d server: Keep track of the winstation input desktop. 2024-02-28 19:51:20 +01:00
Rémi Bernon
c77261dd5c win32u: Introduce new NtUserSwitchDesktop syscall stub. 2024-02-28 19:51:20 +01:00
Zhiyi Zhang
d287548c77 Revert "winex11.drv: Handle X error from vkGetRandROutputDisplayEXT()."
This reverts commit 6f9d20806e.

6f9d208 was committed to work around a Nvidia driver bug that can cause vkGetRandROutputDisplayEXT()
to generate an X exception and crash applications. The bug is later fixed in Nvidia driver 450.56.11
and newer. Thus 6f9d208 is no longer necessary on the newer Nvidia drivers.

Then after 18ae96e, another bug in the Nvidia driver can cause vkGetRandROutputDisplayEXT() to hang
forever when XLockDisplay() is called before vkGetRandROutputDisplayEXT() and this bug is still not
fixed and affects multiple applications. Reverting 6f9d208 allows us to work around the
vkGetRandROutputDisplayEXT() hang bug because then it no longer calls XLockDisplay() before
vkGetRandROutputDisplayEXT().

Nvidia driver 455 was released on September 9th 2020 so hopefully the fix is already widespread. We
could theoretically still keep 6f9d208 on older Nvidia drivers by doing version checks. But it's
more straightforward to remove the workaround since it's not a bug of Wine.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53428
2024-02-28 19:51:16 +01:00
Vijay Kiran Kamuju
c2a4f3810b taskschd: Implement TaskService_get_ConnectedDomain.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48110
2024-02-27 21:17:58 +01:00
Vijay Kiran Kamuju
e1e0db6ebe taskschd: Implement IRegistrationTrigger_getEnabled. 2024-02-27 21:17:58 +01:00
Vijay Kiran Kamuju
ea552a6f39 taskschd: Implement IRegistrationTrigger_putEnabled. 2024-02-27 21:17:58 +01:00
Vijay Kiran Kamuju
4b9e76914a taskschd: Add IRegistrationTrigger stub implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46773
2024-02-27 21:17:58 +01:00
Vijay Kiran Kamuju
c34159db39 include: Add IRegistrationTrigger definition. 2024-02-27 21:17:58 +01:00
Paul Gofman
f5ba517323 wined3d: Force debug info in critical sections. 2024-02-27 21:17:50 +01:00
Paul Gofman
c837cb3e77 rsaenh: Force debug info in critical sections. 2024-02-27 21:17:50 +01:00
Paul Gofman
ed8b7b5e2a netapi32: Force debug info in critical sections. 2024-02-27 21:17:50 +01:00
Paul Gofman
a02d35d386 msvcrt: Force debug info in critical sections. 2024-02-27 21:17:50 +01:00
Paul Gofman
bca7038692 msvcp: Force debug info in critical sections. 2024-02-27 21:17:50 +01:00
Paul Gofman
beec1b57fb ntdll: Support generic xstate config in context manipulation functions. 2024-02-27 18:52:46 +01:00
Paul Gofman
efd3d31082 ntdll: Don't copy xstate from / to syscall frame in usr1_handler(). 2024-02-27 18:52:46 +01:00
Paul Gofman
ba1e2d5dda ntdll: Mind context compaction mask in context_from_server(). 2024-02-27 18:52:46 +01:00
Alexandre Julliard
631a43c577 ntdll: Use a .seh handler in RtlUserThreadStart on ARM64EC. 2024-02-27 16:50:47 +01:00
Alexandre Julliard
8e26b7e007 ntdll: Use a .seh handler in DbgUiRemoteBreakin on ARM64EC. 2024-02-27 16:50:47 +01:00
Alexandre Julliard
58e68a1b8a ntdll: Always use .seh handlers on ARM. 2024-02-27 16:46:47 +01:00
Alexandre Julliard
89336772f8 wow64: Use a .seh handler for the simulation loop. 2024-02-27 16:20:55 +01:00
Alexandre Julliard
259b92d13e wow64: Update Wow64RaiseException behavior to match i386 hardware exceptions. 2024-02-27 16:02:18 +01:00
Alexandre Julliard
4e25c07689 winebuild: Remove some no longer used support for ELF ARM platforms. 2024-02-27 13:01:57 +01:00
Fabian Maurer
8351a45cb2 win32u: Sync dpi awareness changes from user32. 2024-02-27 11:47:42 +01:00
Fabian Maurer
c77d2e8a97 user32: Fix AreDpiAwarenessContextsEqual behavior for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56360
2024-02-27 11:47:40 +01:00
Fabian Maurer
f541d947bb user32/tests: Add tests for AreDpiAwarenessContextsEqual. 2024-02-27 11:47:36 +01:00
Fabian Maurer
21bdc585f3 user32: Fix Set/GetThreadDpiAwarenessContext for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56360
2024-02-27 11:47:33 +01:00
Fabian Maurer
9ccfac44d5 user32/tests: Add exhaustive tests for Get/SetThreadDpiAwarenessContext. 2024-02-27 11:47:29 +01:00
Fabian Maurer
cbcf609108 win32u: Refactor get_thread_dpi_awareness to use get_awareness_from_dpi_awareness_context. 2024-02-27 11:47:26 +01:00
Fabian Maurer
d96754213c win32u: Move get_awareness_from_dpi_awareness_context. 2024-02-27 11:42:20 +01:00
Zebediah Figura
777a9d0f51 shell32: Stub IObjectWithSite on the New menu.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=24812
2024-02-27 11:37:47 +01:00
Zebediah Figura
667eca5c0c shell32: Stub IContextMenu3 on the New menu.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=24812
2024-02-27 11:37:47 +01:00
Zebediah Figura
1662fa9ab1 shell32: Stub CLSID_NewMenu.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=24812
2024-02-27 11:37:46 +01:00
Brendan Shanks
fe4f138292 ntdll: Add native thread renaming for FreeBSD. 2024-02-27 11:37:06 +01:00
Jacek Caban
a542400d15 vcomp/tests: Use limits.h macros in for_static_i8_cb.
Fixes clang warning:
vcomp.c:1346:34: warning: overflow in expression; result is -9223372036854775808 with type 'long long' [-Winteger-overflow]
2024-02-27 11:36:41 +01:00
Jacek Caban
2a5acd3dda configure: Disable -Wmisleading-indentation warnings on GCC. 2024-02-27 11:31:45 +01:00
Zebediah Figura
ef6e9a6bb4 wined3d/atifs: Move fragment program compilation from set_tex_op_atifs() to atifs_apply_draw_state(). 2024-02-26 22:44:35 +01:00
Zebediah Figura
3d6c33f450 wined3d/atifs: Move FFP bumpenv constant loading to atifs_apply_draw_state(). 2024-02-26 22:44:35 +01:00
Zebediah Figura
0e0ee3e21b wined3d/atifs: Move texture constant loading to arbfp_apply_draw_state(). 2024-02-26 22:44:35 +01:00
Zebediah Figura
3153441f14 wined3d/atifs: Move TEXTUREFACTOR constant loading to arbfp_apply_draw_state(). 2024-02-26 22:44:35 +01:00
Vijay Kiran Kamuju
3db38ea7f4 taskschd: Return success from Principal_put_RunLevel.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49877
2024-02-26 22:44:35 +01:00
Vijay Kiran Kamuju
6ec977aa00 taskschd: Implement ITaskService_get_ConnectedUser.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48110
2024-02-26 22:44:35 +01:00
Paul Gofman
b9a2ff2558 mmdevapi: Force debug info in critical sections. 2024-02-26 22:44:35 +01:00
Paul Gofman
131918e4c2 itss: Force debug info in critical sections. 2024-02-26 22:44:35 +01:00
Paul Gofman
f4a3f573c2 browseui: Force debug info in critical sections. 2024-02-26 22:44:35 +01:00
Paul Gofman
03e3bd947f wmwcore: Force debug info in critical sections. 2024-02-26 22:44:35 +01:00
Paul Gofman
0d51cce2fb wbemprox: Force debug info in critical sections. 2024-02-26 22:44:35 +01:00
Hans Leidekker
4cc9ee7e67 wbemprox: Handle implicit property in object path.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55619
2024-02-26 22:44:35 +01:00
Hans Leidekker
d2df3c2c21 netprofm: Set return pointer to NULL in networks_enum_Next().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56271
2024-02-26 22:44:35 +01:00
Hans Leidekker
635e0566a3 netprofm: Support NLM_ENUM_NETWORK flags.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56271
2024-02-26 22:44:35 +01:00
Paul Gofman
fbd6b2583d iphlpapi: Partially fill Ipv4 / Ipv6 metric in GetAdaptersAddresses(). 2024-02-26 22:44:35 +01:00
Paul Gofman
ee06925319 nsiproxy.sys: Fix ipv6 route table parsing on Linux. 2024-02-26 22:44:35 +01:00
Eric Pouech
9897719562 server: Allow 0-write length in WriteProcessMemory().
Adapt to Win >= 10 behavior.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56357
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-26 22:44:35 +01:00
Alexandre Julliard
2aee2990c0 ntdll: Add SEH information to ARM64EC breakpoints. 2024-02-26 22:44:35 +01:00
Alexandre Julliard
0abbb467af include: Add SEH information to ARM64EC syscalls. 2024-02-26 22:44:35 +01:00
Alexandre Julliard
79b9b60914 win32u: Add a wrapper macro for ARM64EC syscalls. 2024-02-26 12:56:31 +01:00
Alexandre Julliard
0c59e8622b ntdll: Add a wrapper macro for ARM64EC syscalls. 2024-02-26 12:56:31 +01:00
Zebediah Figura
f7c665fd6e shell32: Also zero-initialize the background menu.
Fixes: 063a377df4
2024-02-26 09:55:41 +01:00
Esme Povirk
c37fea89e6 gdiplus: Restore hdc argument to gdip_format_string.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56345
2024-02-26 09:50:55 +01:00
Esme Povirk
0d0d37bbea gdiplus: Pass gdip_format_string_info to font link functions. 2024-02-26 09:50:55 +01:00
Esme Povirk
f2c92c68a2 gdiplus: Switch to a struct for gdip_format_string callback args. 2024-02-26 09:50:55 +01:00
Sven Baars
8a8d1dedcf oleaut32: Use scientific notation if it prevents a loss of accuracy. 2024-02-26 09:50:35 +01:00
Alexandre Julliard
1b32ac45f8 Release 9.3. 2024-02-23 22:19:13 +01:00
Hans Leidekker
9015eebf87 wbemprox: Protect tables with a critical section.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56334
2024-02-23 21:05:57 +01:00
Alex Henrie
ce6e298a68 advapi32/tests: Use CRT allocation functions. 2024-02-23 17:13:19 +01:00
Rémi Bernon
74bf784b29 server: Use the startup info to connect the process winstation.
This changes the todos in the tests as it fixes the thread input not
being attached, but then exposes a different todo.
2024-02-23 17:11:00 +01:00
Paul Gofman
c55f5d87db wininet: Force debug info in critical sections. 2024-02-23 17:09:41 +01:00
Paul Gofman
4e49c37028 windowscodecs: Force debug info in critical sections. 2024-02-23 17:09:41 +01:00
Paul Gofman
fae3b7a90f qmgr: Force debug info in critical sections. 2024-02-23 17:09:41 +01:00
Paul Gofman
27e70ba8ec ntdll: Force debug info in critical sections. 2024-02-23 17:09:41 +01:00
Paul Gofman
7c2f6be10e mscoree: Force debug info in critical sections. 2024-02-23 17:09:41 +01:00
Alexandre Julliard
2e6651cb36 ntdll/tests: Fix a test failure when exception information is missing. 2024-02-23 17:00:28 +01:00
Alexandre Julliard
af64a8bb5c winebuild: Remove ARM code generation option.
They are not needed for PE builds.
2024-02-23 12:02:17 +01:00
Alexandre Julliard
0c0d181551 winegcc: Stop passing ARM code generation options to winebuild.
They are not needed for PE builds.
2024-02-23 12:01:38 +01:00
Alexandre Julliard
71a2e64aee configure: Require floating point support on ARM targets.
PE code requires hardware floating point.
2024-02-23 11:42:08 +01:00
Alexandre Julliard
23218818ac configure: Stop passing ARM code generation options to winebuild.
They are not needed for PE builds.
2024-02-23 11:34:31 +01:00
Jinoh Kang
232b18d820 kernel32/tests: Fix console test with odd-sized consoles. 2024-02-22 22:37:10 +01:00
Louis Lenders
7a92a33b27 imm32: Update spec file.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56299
2024-02-22 22:35:06 +01:00
Alexandre Julliard
2778e45421 ntdll: Remove support for unwinding ELF dlls on ARM. 2024-02-22 22:35:06 +01:00
Alexandre Julliard
654c03d131 ntdll: Handle leaf functions in RtlVirtualUnwind on x86-64. 2024-02-22 22:35:06 +01:00
Alexandre Julliard
18b0473fe9 ntdll: Handle leaf functions in RtlVirtualUnwind on ARM. 2024-02-22 22:35:06 +01:00
Alexandre Julliard
9f555cde20 ntdll: Handle leaf functions in RtlVirtualUnwind on ARM64. 2024-02-22 22:35:06 +01:00
Alexandre Julliard
852e2ffc13 include: Add new idl files to the makefile. 2024-02-22 12:56:33 +01:00
Rémi Bernon
f7bff8802f winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfaceFormatsKHR driver entry. 2024-02-22 12:56:14 +01:00
Rémi Bernon
8a98408056 winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfaceFormats2KHR driver entry. 2024-02-22 12:47:25 +01:00
Rémi Bernon
64ced5a345 winevulkan: Implement vkGetPhysicalDeviceSurfaceFormats2KHR fallback. 2024-02-22 12:47:21 +01:00
Alex Henrie
73685eb080 msxml3: Use CRT allocation functions. 2024-02-22 12:46:06 +01:00
Yuxuan Shui
5613917974 dmime/tests: Improve error reporting from expect_track.
Include a line number of the call site.
2024-02-22 12:45:55 +01:00
Yuxuan Shui
8710a1cb0a dmime: Read through a MIDI file.
Add a dummy track parser, that reads through MIDI tracks and events. To make sure we understand the
file structure correctly, no actual tracks or events are generated.

Also add test cases to make sure we read through a MIDI file correctly.
2024-02-22 12:45:52 +01:00
Yuxuan Shui
813b35c9d1 dmime: Don't skip chunk for MIDI files.
MIDI files aren't RIFF, calling stream_skip_chunk on it is invalid.
2024-02-22 12:45:51 +01:00
Brendan McGrath
c65ac223a0 d2d1/tests: Increase timeout from 1 sec to 5 secs.
Fixes a test that is frequently failing on the GitLab CI.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56188
2024-02-22 12:44:01 +01:00
Alex Henrie
2e9a57a0b8 include: Add debugstr_time to wine/strmbase.h. 2024-02-22 12:30:47 +01:00
Rémi Bernon
d0eea21735 winevulkan: Remove now unnecessary vkGetPhysicalDevicePresentRectanglesKHR driver entry. 2024-02-21 22:30:34 +01:00
Rémi Bernon
b541b9661a winevulkan: Handle invalid window in vkGetPhysicalDevicePresentRectanglesKHR. 2024-02-21 22:30:31 +01:00
Rémi Bernon
9a1362695b winevulkan: Handle invalid window in vkCreateSwapchainKHR. 2024-02-21 22:30:31 +01:00
Rémi Bernon
0d969b1764 winex11: Remove now unnecessary create_info HWND checks. 2024-02-21 22:30:31 +01:00
Rémi Bernon
8ba1b27f23 winevulkan: Handle creation of surfaces with no HWND directly. 2024-02-21 22:30:31 +01:00
Ivo Ivanov
e24cf32f81 hidclass.sys: Use HID_DEVICE in the mfg_section to match the recent changes. 2024-02-21 22:30:03 +01:00
Rémi Bernon
437d304c72 winegstreamer: Rename struct h264_decoder to struct video_decoder. 2024-02-21 22:30:03 +01:00
Rémi Bernon
ae584ac620 winegstreamer: Use the H264 decoder to implement the IV50 decoder. 2024-02-21 22:30:03 +01:00
Rémi Bernon
e1b21bf1e9 ir50_32: Use the proper hr value for stream format change. 2024-02-21 22:30:03 +01:00
Rémi Bernon
9a591bf4fe winegstreamer: Use MFCalculateImageSize to compute output info size. 2024-02-21 22:30:03 +01:00
Paul Gofman
39e5926760 inetcomm: Force debug info in critical sections. 2024-02-21 22:30:03 +01:00
Paul Gofman
6fda28d030 dwrite: Force debug info in critical sections. 2024-02-21 22:30:03 +01:00
Paul Gofman
c63a990091 dsound: Force debug info in critical sections. 2024-02-21 22:30:03 +01:00
Paul Gofman
8268d4e017 dplayx: Force debug info in critical sections. 2024-02-21 22:30:03 +01:00
Paul Gofman
a485f6b4a3 dinput: Force debug info in critical sections. 2024-02-21 22:30:03 +01:00
Ivo Ivanov
2497a53484 hidclass.sys: Use the correct string for container_id. 2024-02-21 22:30:03 +01:00
Alexandre Julliard
8bd411da0a ntdll: Share exception dispatch implementation across platforms. 2024-02-21 21:55:04 +01:00
Alexandre Julliard
61564202b5 ntdll: Add a helper macro to dump a register context. 2024-02-21 21:55:04 +01:00
Alexandre Julliard
2e63272f2f ntdll: Default to the SEH channel on x86-64.
The unwind info is now printed from unwind.c.
2024-02-21 21:55:04 +01:00
Paul Gofman
9c1bc32fe9 winhttp: Mind read size when skipping async read in WinHttpReadData(). 2024-02-21 21:55:04 +01:00
Rémi Bernon
a3686eeb5e win32u: Don't assume that the primary adapter is always first. 2024-02-21 21:55:04 +01:00
Rémi Bernon
76326ed369 win32u: Only consider active monitors in monitor_from_rect. 2024-02-21 21:55:04 +01:00
Rémi Bernon
f7788fc7e7 win32u: Only consider active monitors for virtual screen rect. 2024-02-21 21:55:04 +01:00
Rémi Bernon
db391c37a9 win32u: Only consider active monitors for clone detection. 2024-02-21 21:55:04 +01:00
Rémi Bernon
e4ff578bcc win32u: Deduce monitor device flags from their adapter. 2024-02-21 21:55:04 +01:00
Brendan Shanks
e628eb2c6f ntdll: On x86_64, don't access %gs in signal_start_thread().
%gs is not set until call_init_thunk().
Also, adjust other TEB accesses to be consistent with the surrounding
functions.

Fixes a crash on macOS introduced by 7ae488a2bb
("ntdll: Don't hardcode xstate size in syscall frame.")
2024-02-21 11:09:21 +01:00
Alex Henrie
340a4b05b5 wined3d: Use CRT allocation functions. 2024-02-20 22:27:02 +01:00
Biswapriyo Nath
6ec9f446eb include: Add FaceDetector runtimeclass in windows.media.faceanalysis.idl. 2024-02-20 22:26:58 +01:00
Biswapriyo Nath
f0ab43fea2 include: Add DetectedFace runtimeclass in windows.media.faceanalysis.idl. 2024-02-20 22:26:57 +01:00
Biswapriyo Nath
fbe99509d6 include: Add SoftwareBitmap runtimeclass in windows.graphics.imaging.idl. 2024-02-20 22:26:57 +01:00
Biswapriyo Nath
af4838321e include: Add BitmapBuffer runtimeclass in windows.graphics.imaging.idl. 2024-02-20 22:26:57 +01:00
Biswapriyo Nath
fe4f7632a7 include: Add IDirect3DSurface in windows.graphics.directx.direct3d11.idl. 2024-02-20 22:26:57 +01:00
Daniel Lehman
fb5302c29b msvcrt: Use string sort for strcoll/wcscoll. 2024-02-20 22:26:29 +01:00
Daniel Lehman
188d880493 msvcrt/tests: Add tests for strcoll/wcscoll. 2024-02-20 22:26:29 +01:00
David Kahurani
386dbe1059 msi: Avoid leaking stream on DB update.
MSI_RecordGetIStream adds a reference to the stream. This
reference should be negated as we are done setting the stream.

Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2024-02-20 22:26:13 +01:00
Zebediah Figura
9a614fefaf wined3d/arb: Move FFP bumpenv constant loading to arbfp_apply_draw_state(). 2024-02-20 22:26:01 +01:00
Zebediah Figura
088da327b5 wined3d/arb: Move texture constant loading to arbfp_apply_draw_state(). 2024-02-20 22:26:00 +01:00
Zebediah Figura
0f7ef9f47a wined3d/arb: Move color key constant loading to arbfp_apply_draw_state(). 2024-02-20 22:25:58 +01:00
Zebediah Figura
8faac9b94a wined3d/arb: Move TEXTUREFACTOR constant loading to arbfp_apply_draw_state(). 2024-02-20 22:25:56 +01:00
Zebediah Figura
6c1c917750 wined3d/arb: Move SPECULARENABLE constant loading to arbfp_apply_draw_state(). 2024-02-20 22:25:54 +01:00
Alexandre Julliard
f0584966c2 ntdll/tests: Run RtlVirtualUnwind tests on ARM64EC. 2024-02-20 11:05:13 +01:00
Alexandre Julliard
ec5e33cad6 ntdll/tests: Run dynamic unwind tests on ARM platforms. 2024-02-20 11:03:58 +01:00
Alexandre Julliard
510fc64140 ntdll/tests: Move unwinding tests to a separate file. 2024-02-20 10:58:13 +01:00
Eric Pouech
552bc893e1 dbghelp: Don't expected a fixed number of substreams in DBI header (PDB).
MSC no longer emits a fixed number of substreams (depending on version of
PDB file), but can emit less.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-20 10:51:37 +01:00
Eric Pouech
dee3be21a3 winedump: Don't expect a fixed number of substreams in DBI header (PDB).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-20 10:51:36 +01:00
Shaun Ren
c72f0ec0f0 sapi: Implement ISpeechVoice::Invoke. 2024-02-20 10:47:11 +01:00
Shaun Ren
9d044669f3 sapi: Implement ISpeechVoice::GetIDsOfNames. 2024-02-20 10:47:11 +01:00
Shaun Ren
dd083a6195 sapi: Implement ISpeechVoice::GetTypeInfo. 2024-02-20 10:47:11 +01:00
Shaun Ren
58087358d1 sapi: Implement ISpeechVoice::GetTypeInfoCount. 2024-02-20 10:47:11 +01:00
Shaun Ren
62aec0318b sapi: Implement ISpeechVoice::GetVoices. 2024-02-20 10:47:11 +01:00
Shaun Ren
0f8b59a245 sapi: Introduce create_token_category helper in tts. 2024-02-20 10:47:11 +01:00
Shaun Ren
4bbfd83898 sapi: Handle zero-length attributes correctly in ISpObjectTokenCategory::EnumTokens. 2024-02-20 10:47:11 +01:00
Shaun Ren
5243f2e82c sapi: Implement ISpeechVoice::Speak. 2024-02-20 10:47:11 +01:00
Shaun Ren
afac7d7e3f sapi: Free typelib on DLL detach. 2024-02-20 10:47:11 +01:00
Paul Gofman
164520f593 crypt32: Force debug info in critical sections. 2024-02-20 10:44:14 +01:00
Paul Gofman
9149c7e999 combase: Force debug info in critical sections. 2024-02-20 10:44:14 +01:00
Paul Gofman
6ba603a03c kernelbase: Force debug info in critical sections. 2024-02-20 10:44:14 +01:00
Paul Gofman
431a483edc xaudio2: Force debug info in critical sections. 2024-02-20 10:44:14 +01:00
Paul Gofman
5e3cc88326 winhttp: Force debug info in critical sections. 2024-02-20 10:44:14 +01:00
Zhiyi Zhang
7c7b2e8e7e dsound: Reject WAVEFORMATEX formats with more than two channels.
Formats with more than two channels require WAVEFORMATEXTENSIBLE according to tests.

Fix Viking: Battle for Asgard (211160) audio cracking in its intro video.
2024-02-20 10:44:05 +01:00
Zhiyi Zhang
b3ec5bc7ea dsound/tests: Test that formats with more than two channels require WAVEFORMATEXTENSIBLE. 2024-02-20 10:44:05 +01:00
Aurimas Fišeras
89e3be4ee9 po: Update Lithuanian translation. 2024-02-20 10:43:08 +01:00
Kartavya Vashishtha
1e34842799 kernelbase: Implement CopyFile2(). 2024-02-20 10:42:57 +01:00
Jinoh Kang
1b0d8428df kernelbase: Replace FileAllInformation with FileStatInformation in GetFileInformationByHandle().
It also fixes the game Unity of Command II (same bug).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46070
2024-02-19 21:28:42 +01:00
Jinoh Kang
152580cefe ntdll: Implement NtQueryInformationFile FileStatInformation. 2024-02-19 21:28:42 +01:00
Jinoh Kang
f5e7abb428 ntdll/tests: Add tests for NtQueryInformationFile FileStatInformation. 2024-02-19 21:28:42 +01:00
Jinoh Kang
4f61a8a1ab include: Add definition for FILE_STAT_INFORMATION. 2024-02-19 21:28:41 +01:00
Vijay Kiran Kamuju
08803bd136 include: Add msdelta header file. 2024-02-19 20:39:43 +01:00
Daniel Lehman
6a6263c8bd msvcrt/tests: Include locale in ok message. 2024-02-19 20:39:43 +01:00
Daniel Lehman
588db48be5 msvcrt: Use string sort for strncoll/wcsncoll. 2024-02-19 20:39:43 +01:00
Eric Pouech
65109c725d dbghelp: Implement SymFromIndex().
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-19 20:39:43 +01:00
Eric Pouech
989988a5ae winedbg: Use share attributes for opening command file.
(this fixes --command option when winedbg is relaunched in
wow64 case).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-19 20:39:43 +01:00
Zebediah Figura
063a377df4 shell32: Properly implement context menu verbs.
Enumerate "shell" registry key entries instead of hardcoding a list.

Don't enumerate any entries unless all the files have the same type.

Pass the correct type to ShellExecuteEx().
2024-02-19 18:28:21 +01:00
Zebediah Figura
d1eed1c702 shell32: Separate a get_filetype() helper. 2024-02-19 18:26:52 +01:00
Zebediah Figura
6fd349c6e0 shell32: Do not set the default menu item from ShellView_DoContextMenu().
This was added in f045c9df81, with no explanation.

It does not affect any behaviour in Wine, since FWF_DESKTOP is never set.

It does not make sense, since "open" is already usually the default action on
Windows, and it's not obvious why FWF_DESKTOP would affect this.

It also leans on IContextMenu implementation details.
2024-02-19 18:26:52 +01:00
Zebediah Figura
d9c4f506fd shell32: Always use IContextMenu::InvokeCommand() when selecting an item from the context menu.
This reverts one of the changes included in d30dfd24d6.

Relying on FCIDM_SHVIEW_OPEN snoops into the internals of IContextMenu for no
good reason.

While I haven't tested whether ICommDlgBrowser::OnDefaultCommand() is triggered
in this case, the documentation states that it is "called when a user
double-clicks in the view or presses the ENTER key"; this is neither scenario.

Simply let the context menu call ShellExecuteEx().
2024-02-19 18:26:52 +01:00
Zebediah Figura
f27e4a4a29 shell32: Remove two unused strings.
These were never used. They were probably anticipating the context menu, but are
missing accelerators and otherwise redundant with the existing entries.
2024-02-19 18:26:47 +01:00
Alex Henrie
e7364e2165 include: Annotate NdrGetBuffer with __WINE_(ALLOC_SIZE|MALLOC).
It would be nice to annotate it with __WINE_DEALLOC(NdrFreeBuffer) too,
but that causes a bunch of spurious -Wfree-nonheap-object warnings.
2024-02-19 18:15:13 +01:00
Rémi Bernon
6599f2ff90 winegstreamer: Complete H264 current output type reported attributes. 2024-02-19 18:15:09 +01:00
Rémi Bernon
a6d77cfd06 winegstreamer: Use GUID arrays for H264 decoder media types. 2024-02-19 18:15:09 +01:00
Rémi Bernon
5bf6af0c39 winegstreamer: Remove unnecessary create_output_media_type checks. 2024-02-19 18:15:09 +01:00
Rémi Bernon
71f5bce785 winegstreamer: Use MFCreateVideoMediaTypeFromSubtype in GetOutputAvailableType. 2024-02-19 18:15:09 +01:00
Rémi Bernon
86d82c7334 winegstreamer: Use MFCreateVideoMediaTypeFromSubtype in GetInputAvailableType. 2024-02-19 18:15:08 +01:00
Rémi Bernon
bb872831de winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfaceCapabilitiesKHR driver entry. 2024-02-19 18:14:43 +01:00
Rémi Bernon
923f1d1b10 winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfaceCapabilities2KHR driver entry. 2024-02-19 18:14:43 +01:00
Rémi Bernon
c83f86bef5 winevulkan: Implement vkGetPhysicalDeviceSurfaceCapabilities2KHR fallback. 2024-02-19 18:14:43 +01:00
Rémi Bernon
32e56bd029 winewayland: Remove now unnecessary VkSurfaceCapabilitiesKHR fixups. 2024-02-19 18:14:43 +01:00
Rémi Bernon
5a4d3bad17 winevulkan: Adjust VkSurfaceCapabilitiesKHR image extents with client rect. 2024-02-19 18:14:43 +01:00
Rémi Bernon
6eab84685e winevulkan: Wrap host swapchain handles. 2024-02-19 18:14:43 +01:00
Piotr Caban
8314812354 wininet/tests: Add initial PAC script tests. 2024-02-19 18:13:28 +01:00
Piotr Caban
b049dad6fd inetcpl.cpl: Use wininet functions to set proxy settings. 2024-02-19 18:13:26 +01:00
Piotr Caban
a5ce5d637f wininet/tests: Add more INTERNET_OPTION_PER_CONNECTION_OPTION tests. 2024-02-19 18:13:26 +01:00
Piotr Caban
62027a9c4d wininet: Add support for INTERNET_OPTION_PER_CONNECTION_OPTION option on session handles. 2024-02-19 18:13:26 +01:00
Piotr Caban
9aa7f27d82 wininet: Fix INTERNET_PER_CONN_AUTOCONFIG_URL option when quering global proxy settings. 2024-02-19 18:13:26 +01:00
Piotr Caban
b16110f17b wininet: Add support for INTERNET_PER_CONN_AUTOCONFIG_URL in InternetSetOption. 2024-02-19 18:13:26 +01:00
Floris Renaud
7e0177e1e4 po: Update Dutch translation. 2024-02-18 14:15:15 +01:00
Alexandre Julliard
839fb09bf0 fluidsynth: Import upstream release 2.3.4. 2024-02-17 22:42:20 +01:00
Alexandre Julliard
7914be3ca5 zydis: Import upstream release 4.1.0.
With headers from Zycore version 1.5.0.
2024-02-17 22:18:47 +01:00
Alexandre Julliard
da62790584 xml2: Import upstream release 2.11.7. 2024-02-17 21:04:18 +01:00
Alexandre Julliard
f1454777a8 xslt: Import upstream release 1.1.39. 2024-02-17 20:54:51 +01:00
Alexandre Julliard
72b7866950 ldap: Import upstream release 2.5.17. 2024-02-17 20:54:51 +01:00
Alexandre Julliard
b15d0120cf lcms2: Import upstream release 2.16. 2024-02-17 20:54:51 +01:00
Alexandre Julliard
041167b20a zlib: Import upstream release 1.3.1. 2024-02-17 18:42:30 +01:00
Alexandre Julliard
73a8c06804 jpeg: Import upstream release 9f. 2024-02-17 18:36:56 +01:00
Alexandre Julliard
1e5cc509a7 png: Import upstream release 1.6.42. 2024-02-17 18:36:56 +01:00
Alexandre Julliard
3881edf6f3 mpg123: Import upstream release 1.32.5. 2024-02-17 18:36:56 +01:00
Alexandre Julliard
fa42210c49 faudio: Import upstream release 24.02. 2024-02-17 18:18:03 +01:00
Alexandre Julliard
6e9d214096 kernelbase: Update timezone data to version 2024a. 2024-02-17 18:18:03 +01:00
Alex Henrie
90103fa07e where: Implement search with default options.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55282
2024-02-16 23:32:06 +01:00
Daniel Lehman
7c6a50cc46 include: Add some msvcrt declarations. 2024-02-16 23:32:06 +01:00
Paul Gofman
1a4163b686 powershell: Read input command from stdin. 2024-02-16 23:32:06 +01:00
Rémi Bernon
75fa35ad7f mfreadwrite/reader: Repeat pushing / pulling samples while it succeeds. 2024-02-16 23:32:06 +01:00
Rémi Bernon
c20fc715e2 mfreadwrite/reader: Introduce new source_reader_(drain|flush)_transform_samples helpers. 2024-02-16 23:32:06 +01:00
Rémi Bernon
8946e6df7e mfreadwrite/reader: Introduce a new source_reader_allocate_stream_sample helper. 2024-02-16 23:32:06 +01:00
Rémi Bernon
dd6e8198e0 mfreadwrite/reader: Pass the transform to source_reader_pull_stream_samples. 2024-02-16 23:32:06 +01:00
Rémi Bernon
cbb343567a mfreadwrite/reader: Introduce source_reader_queue_sample helper. 2024-02-16 23:32:06 +01:00
Paul Gofman
dfe2b717a6 ntdll: Don't hardcode xstate size in exception stack layout. 2024-02-16 23:32:06 +01:00
Paul Gofman
7ae488a2bb ntdll: Don't hardcode xstate size in syscall frame. 2024-02-16 23:32:06 +01:00
Paul Gofman
1e0728c5d4 ntdll: Don't hardcode xstate feature mask. 2024-02-16 23:32:06 +01:00
Alexandre Julliard
af4ef5fa02 ntdll: Always set non-volatile pointers for ARM64 unwinding. 2024-02-16 23:32:06 +01:00
Alexandre Julliard
14a290e77d ntdll: Implement CLEAR_UNWOUND_TO_CALL unwinding operation on ARM64. 2024-02-16 23:30:34 +01:00
Alexandre Julliard
f4ac9b35c2 ntdll: Implement EC_CONTEXT unwinding operation on ARM64. 2024-02-16 23:30:34 +01:00
Alexandre Julliard
931c1a6887 ntdll: Move ARM64 context conversion functions to a new header. 2024-02-16 23:30:34 +01:00
Alexandre Julliard
41d7baa013 ntdll: Ignore home parameters saving when unwinding epilog on ARM64. 2024-02-16 23:30:08 +01:00
Alexandre Julliard
9cc5ed1802 ntdll/tests: Simplify testing of unwind register values on ARM64. 2024-02-16 16:43:18 +01:00
Alexandre Julliard
18bdd435f1 rpcrt4/tests: Fix some malloc/HeapAlloc mismatches.
Fixes regressions caused by a38e05636d.
2024-02-16 16:43:18 +01:00
Zebediah Figura
4e74e9dfa9 wined3d: Use dynamic state for depth/stencil state if possible. 2024-02-16 16:43:18 +01:00
Zebediah Figura
ee620f0277 wined3d: Enable EXT_extended_dynamic_state. 2024-02-16 16:43:18 +01:00
Zebediah Figura
a9c9d49a12 wined3d: Make the scissor state dynamic. 2024-02-16 16:43:18 +01:00
Zebediah Figura
e8a2f816f0 wined3d: Make the viewport state dynamic. 2024-02-16 16:43:18 +01:00
Zebediah Figura
3b59be59ae wined3d: Set the pipeline key viewport and scissor count at initialization.
It never changes.
2024-02-16 16:43:18 +01:00
Zebediah Figura
fabf45a9d8 wined3d/arb: Move fragment program compilation from fragment_prog_arbfp() to arbfp_apply_draw_state(). 2024-02-16 16:43:18 +01:00
Zebediah Figura
17b9c45311 wined3d: Pass a non-const wined3d_context pointer to the FFP *_apply_draw_state() methods. 2024-02-16 16:43:18 +01:00
Zebediah Figura
dfb1665b5f wined3d: Pass a wined3d_state pointer to the vp_enable() and fp_enable() methods.
Rename to *_apply_draw_state() per Henri's suggestion.
2024-02-16 16:43:18 +01:00
Zebediah Figura
b64cc15d61 wined3d: Introduce a separate fp_disable() method.
Analogous to shader_disable().

We'd like to pass a wined3d_state pointer to fp_enable() to let it handle
actually compiling the fragment pipeline, which doesn't mesh well conceptually
with its use in shader_disable().
2024-02-16 16:43:18 +01:00
Zebediah Figura
9880e29d69 wined3d: Introduce a separate vp_disable() method.
Analogous to shader_disable().

We'd like to pass a wined3d_state pointer to vp_enable() to let it handle
actually compiling the vertex pipeline, which doesn't mesh well conceptually
with its use in shader_disable().
2024-02-16 16:43:18 +01:00
Zebediah Figura
c8a98e03c8 wined3d: Merge shader_load_constants() into shader_select().
Arguably there is a benefit here in that it reduces shader backend state
application down to a single method, although whether that is an improvement may
be up for debate.

More saliently, we would like to move FFP state application out of the state
table and into a linear state function. In practice that function will probably
be vp_enable / fp_enable. In that case we will need those functions, and hence
also shader_select(), to be called when more states are dirty.

This does not in itself mean that shader_load_constants() needs to be merged
with shader_select(), but it does remove the primary impetus for keeping them
separate.

Rename to shader_apply_draw_state() to reflect the adjusted purpose, as
suggested by Henri Verbeet.
2024-02-16 16:43:18 +01:00
Eric Pouech
5efab11752 kernel32/tests: Check if thread is suspended in debugger attachment tests.
Looks like thread is suspended until DBG_CONTINUE is sent on thread
creation debug event.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-16 11:36:58 +01:00
Zebediah Figura
a97a4af0dd dinput/tests: Return void from test_winmm_joystick(). 2024-02-16 11:36:45 +01:00
Paul Gofman
95e12689e6 webservices: Force debug info in critical sections. 2024-02-16 11:36:30 +01:00
Paul Gofman
c65d0a0770 vcomp: Force debug info in critical sections. 2024-02-16 11:36:30 +01:00
Paul Gofman
139d624787 rpcrt4: Force debug info in critical sections. 2024-02-16 11:36:30 +01:00
Paul Gofman
67bea281cc propsys: Force debug info in critical sections. 2024-02-16 11:36:30 +01:00
Paul Gofman
0efd48113e mapi32: Force debug info in critical sections. 2024-02-16 11:36:29 +01:00
Piotr Caban
bbf222ca72 wininet: Add support for reading connection settings binary blobs from registry. 2024-02-15 22:01:15 +01:00
Piotr Caban
fac555fe68 wininet: Add support for writing connection settings binary blobs from registry. 2024-02-15 22:01:15 +01:00
Piotr Caban
707685642c wininet/tests: Cleanup INTERNET_OPTION_PER_CONNECTION_OPTION tests. 2024-02-15 22:01:15 +01:00
Piotr Caban
9ea0a1072d wininet: Use GlobalAlloc in InternetQueryOption(INTERNET_OPTION_PER_CONNECTION_OPTION).
So the allocator matches with documentation.
2024-02-15 22:01:12 +01:00
Piotr Caban
7dcdfd7bf2 wininet: Fix buffer size calculation in InternetQueryOption(INTERNET_OPTION_PER_CONNECTION_OPTION). 2024-02-15 22:01:12 +01:00
Piotr Caban
f54acf3de0 wininet: Test INTERNET_OPTION_PER_CONNECTION_OPTION on process settings.
Setting invalid proxy server has some side effects.
2024-02-15 22:01:10 +01:00
Eric Pouech
9119e3102b winedump: Don't crash on non-effective runtime function entries.
MSVC generates zeroed out entries when EditAndContinue (aka HotPatch)
is enabled.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-15 20:41:49 +01:00
Gabriel Ivăncescu
8a71a4a304 explorer: Set layered style on systray icons before calling into the driver.
Fixes a regression introduced by b5c57b9a62,
which broke the systray integration outside of virtual desktops on some
DEs like XFCE.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-15 20:40:55 +01:00
Krzysztof Bogacki
223292da02 win32u: Implement NtGdiDdDDIEnumAdapters2.
Signed-off-by: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
2024-02-15 20:39:48 +01:00
Krzysztof Bogacki
800b5e44fc win32u: Maintain a list of GPUs in cache.
Signed-off-by: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
2024-02-15 20:39:48 +01:00
Krzysztof Bogacki
10db5b67b8 gdi32: Add D3DKMTEnumAdapters2() stub.
Signed-off-by: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
2024-02-15 20:39:46 +01:00
Krzysztof Bogacki
842461979c gdi32/tests: Add D3DKMTEnumAdapters2 tests.
Signed-off-by: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
2024-02-15 20:39:46 +01:00
Nikola Kuburović
fddea5da01 kernelbase: Reduce FIXME to TRACE if params is null.
If CREATEFILE2_EXTENDED_PARAMS struct pointer is null, we just forward
to CreateFileW and we don't need FIXME's.
2024-02-15 20:37:07 +01:00
Fabian Maurer
231670e899 mmdevapi/tests: Add test for invalid format with exclusive mode. 2024-02-15 20:36:37 +01:00
Fabian Maurer
c62ca5fced winealsa: Remove superflous check. 2024-02-15 20:36:30 +01:00
Fabian Maurer
e75d1b38b5 wineoss: Remove superflous check. 2024-02-15 20:36:28 +01:00
Daniel Lehman
4d1ad4f975 oleaut32: Use scientific notation only for larger numbers in VarBstrFromR[48]. 2024-02-15 20:35:49 +01:00
Daniel Lehman
55e4aa7a31 oleaut32/tests: Add tests for number of digits. 2024-02-15 20:35:49 +01:00
Jinoh Kang
b74e1a570b ntdll: Remove stale comment from set_async_direct_result() documentation.
The supplied async handle passed to set_async_direct_result() cannot be
NULL.
2024-02-15 20:35:00 +01:00
Alexandre Julliard
2601a8a2f1 ntdll: Don't count custom stack frames as part of the prolog on ARM64. 2024-02-15 20:31:49 +01:00
Alexandre Julliard
1abebca6dc ntdll: Ignore end_c when processing ARM64 unwind codes.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55584
2024-02-15 20:31:49 +01:00
Alexandre Julliard
a271fc9e19 ntdll: Add support for the save_any_reg ARM64 unwind code.
Based on a patch by Billy Laws.
2024-02-15 20:31:49 +01:00
Alexandre Julliard
7c4ca6ff74 winedump: Add dumping of the save_any_reg ARM64 unwind code. 2024-02-15 15:08:55 +01:00
Paul Gofman
17f94ab563 dmsynth: Force debug info in critical sections. 2024-02-15 11:23:57 +01:00
Paul Gofman
bbe1c7532a dmime: Force debug info in critical sections. 2024-02-15 11:23:57 +01:00
Paul Gofman
fb64ea8675 strmbase: Force debug info in critical sections. 2024-02-15 11:23:57 +01:00
Jacek Caban
3f421410c1 winebuild: Move target filtering to assign_exports. 2024-02-15 11:23:52 +01:00
Jacek Caban
3c9ede8abc winebuild: Use exports struct in assign_names. 2024-02-15 11:23:51 +01:00
Jacek Caban
1bc06138f4 winebuild: Use exports struct in assign_ordinals. 2024-02-15 11:23:51 +01:00
Jacek Caban
f5ed0de392 winebuild: Use exports struct for exports handling. 2024-02-15 11:23:51 +01:00
Jacek Caban
6ee0583546 winebuild: Use exports struct for 16-bit modules handlign. 2024-02-15 11:23:51 +01:00
Jacek Caban
499c6be734 winebuild: Use exports struct for imports handling. 2024-02-15 11:23:51 +01:00
Jacek Caban
73f0bbc731 winebuild: Introduce exports struct. 2024-02-15 11:23:49 +01:00
Geoffrey McRae
b8c75f3d2a include: Add interfaces for ID3D11On12Device1 and ID3D11On12Device2. 2024-02-14 23:23:25 +01:00
Marc-Aurel Zent
1eb8f41e54 server: Improve formatting in mach init_tracing_mechanism(). 2024-02-14 23:17:23 +01:00
Marc-Aurel Zent
dee10199cc server: Use bootstrap_register2() instead of bootstrap_register(). 2024-02-14 23:17:23 +01:00
Marc-Aurel Zent
52f34cf976 server: Use __pthread_kill() syscall wrapper. 2024-02-14 23:17:23 +01:00
Brendan Shanks
455086e295 ntdll: Assume process-private futexes are always present on Linux. 2024-02-14 21:00:44 +01:00
Yuxuan Shui
d93275c6ca dmime: Parse MIDI headers. 2024-02-14 20:54:23 +01:00
Yuxuan Shui
4434c17c94 dmime/tests: Add MIDI loading test.
Besides a seq track and a tempo track, Windows also adds a "fake" band
track to segments loaded from MIDI files, which handles soundfont
loading etc.
2024-02-14 20:54:18 +01:00
Alexandre Julliard
cb2013e7b4 ntdll: Implement RtlVirtualUnwind for ARM64EC. 2024-02-14 19:19:33 +01:00
Alexandre Julliard
3b85ab31a9 ntdll: Move RtlUnwind to unwind.c. 2024-02-14 19:19:33 +01:00
Alexandre Julliard
8602a1c24e ntdll: Move the dynamic unwind tables to unwind.c. 2024-02-14 19:19:33 +01:00
Alexandre Julliard
a5a253820f ntdll: Move exception unwinding code to a separate file. 2024-02-14 19:19:33 +01:00
Rémi Bernon
d88f92eb4e mouhid.sys: Parse HID reports to track contact points. 2024-02-14 19:19:32 +01:00
Rémi Bernon
683710fbc7 mouhid.sys: Read reports from the underlying HID device. 2024-02-14 19:19:32 +01:00
Rémi Bernon
a05b67b7e5 mouhid.sys: Request preparsed data and inspect device caps. 2024-02-14 19:19:32 +01:00
Rémi Bernon
0ed830eac5 mouhid.sys: Introduce a new HID pointer device driver.
This only matches with digitizer devices for now, it could later be
used for HID mice but for now we use a different path for that.
2024-02-14 19:19:32 +01:00
Rémi Bernon
8db5dec9d2 hidclass: Only access Tail.Overlay.OriginalFileObject when needed. 2024-02-14 19:19:32 +01:00
Rémi Bernon
677107956f hidclass: Make HID hardware ids more similar to windows. 2024-02-14 19:19:32 +01:00
Aurimas Fišeras
998111eca1 po: Update Lithuanian translation. 2024-02-14 19:19:32 +01:00
Alex Henrie
a38e05636d rpcrt4/tests: Use CRT allocation functions. 2024-02-14 19:19:32 +01:00
Rastislav Stanik
1bab7ea25e iphlpapi: Add stub for GetAnycastIpAddressTable().
This change adds an implementation of Win32 API function
GetAnycastIpAddressTable() that does not return real information, it
just says "no entries found".

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56065
2024-02-14 19:19:32 +01:00
Alex Henrie
fb2ebbbb40 ntdll: Include alloc_type argument in NtMapViewOfSection(Ex) traces.
LANCommander calls NtMapViewOfSectionEx with
alloc_type=MEM_REPLACE_PLACEHOLDER, but you couldn't tell from the
trace.
2024-02-14 19:19:32 +01:00
Marc-Aurel Zent
cd2570c28d iphlpapi: Implement GetRTTAndHopCount(). 2024-02-14 19:19:32 +01:00
Zhiyi Zhang
ca97cb8700 server: Inherit internal desktop flags when creating desktops.
Based on Rémi's idea.

CEF applications create their own desktops and so is_virtual_desktop() could incorrectly
report that virtual desktop is off if DF_WINE_VIRTUAL_DESKTOP is not inherited.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55810
2024-02-13 22:37:50 +01:00
Zhiyi Zhang
2990a4f8c3 include: Rename DF_WINE_CREATE_DESKTOP to DF_WINE_VIRTUAL_DESKTOP. 2024-02-13 22:37:50 +01:00
Shaun Ren
6e8d450804 sapi: Implement ISpeechObjectTokens::Invoke. 2024-02-13 22:37:50 +01:00
Shaun Ren
6f2a0c412f sapi: Implement IEnumVARIANT::Next for ISpeechObjectTokens. 2024-02-13 22:37:50 +01:00
Shaun Ren
261d7c3de4 sapi: Implement ISpeechObjectTokens::get_Count. 2024-02-13 22:37:50 +01:00
Shaun Ren
59a7ee1a2c sapi: Implement ISpeechObjectToken::GetIDsOfNames. 2024-02-13 22:37:50 +01:00
Shaun Ren
001d1a4319 sapi: Implement ISpeechObjectToken::Invoke. 2024-02-13 22:37:50 +01:00
Shaun Ren
b6c1760727 sapi: Implement ISpeechObjectToken::GetDescription. 2024-02-13 22:37:50 +01:00
Mohamad Al-Jaf
23f360b1db windows.security.authentication.onlineid: Implement IOnlineIdSystemAuthenticatorStatics::get_Default().
Called by Minecraft Education Edition.
2024-02-13 22:37:50 +01:00
Mohamad Al-Jaf
df9b41afcb windows.security.authentication.onlineid: Add IOnlineIdServiceTicketRequestFactory stub interface. 2024-02-13 22:37:50 +01:00
Mohamad Al-Jaf
a3ef7d7487 windows.security.authentication.onlineid: Add IOnlineIdSystemAuthenticatorStatics stub interface. 2024-02-13 22:37:50 +01:00
Mohamad Al-Jaf
9809102897 windows.security.authentication.onlineid: Add stub DLL. 2024-02-13 22:37:50 +01:00
Mohamad Al-Jaf
f0b32fa541 include: Add windows.security.authentication.onlineid.idl file. 2024-02-13 22:37:50 +01:00
Daniel Lehman
834558245b oleaut32: Handle exponent in VarBstrFromR[48] in non-English locales. 2024-02-13 22:37:50 +01:00
Fabian Maurer
5ffed8830c user32/sysparams: Handle more contexts in GetAwarenessFromDpiAwarenessContext.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55630
2024-02-13 22:37:50 +01:00
Fabian Maurer
d34cbe61db user32/sysparams: Only allow dpi awareness tests to return invalid on windows.
We can't use IsValidDpiAwarenessContext since this uses
GetAwarenessFromDpiAwarenessContext which we're testing
2024-02-13 22:37:50 +01:00
Zebediah Figura
f74f8b9ef3 shlwapi/tests: Add many more tests for UrlCanonicalize(). 2024-02-13 22:37:50 +01:00
Zebediah Figura
5ca8e4b00d kernelbase: Use scheme_is_opaque() in UrlIs(). 2024-02-13 22:37:50 +01:00
Zebediah Figura
37aabda67e kernelbase: Reimplement UrlCanonicalize().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=23166
2024-02-13 22:37:50 +01:00
Zebediah Figura
80a92c07f5 kernelbase: Do not canonicalize the relative part in UrlCombine(). 2024-02-13 22:37:50 +01:00
Zebediah Figura
13d48ed315 kernelbase: Do not use isalnum() with Unicode characters.
It does not expect code points higher than U+00FF and will read past the end of the ctypes[] array.
2024-02-13 22:37:50 +01:00
Zebediah Figura
ca29c3a422 shlwapi/tests: Move UrlCombine() error tests out of the loop.
And expand them a bit while we're at it.
2024-02-13 22:37:50 +01:00
Zebediah Figura
a4ac824fe5 shlwapi/tests: Use winetest_push_context() in test_UrlCanonicalizeA(). 2024-02-13 22:37:50 +01:00
Zebediah Figura
fc0c738f9d shlwapi/tests: Remove the unused "wszExpectUrl" variable from check_url_canonicalize(). 2024-02-13 22:37:50 +01:00
Zebediah Figura
dc800b56b6 shlwapi/tests: Move the UrlCanonicalize() tests into test_UrlCanonicalizeA(). 2024-02-13 22:37:50 +01:00
Zebediah Figura
6ff5c3b500 urlmon/tests: Add basic tests for CoInternetParseUrl(PARSE_CANONICALIZE). 2024-02-13 22:37:50 +01:00
Alexandre Julliard
8f278f89df ntdll: Make APCs alertable by default on ARM platforms. 2024-02-13 22:37:49 +01:00
Alexandre Julliard
0b3d3ad2b7 ntdll: Support ARM64EC code in RtlLookupFunctionEntry. 2024-02-13 22:37:49 +01:00
Alexandre Julliard
ab69f71912 ntdll: Move RtlAddFunctionTable() to the CPU backends. 2024-02-13 21:57:05 +01:00
Alexandre Julliard
02ebacca0c ntdll: Move find_function_info() to the CPU backends. 2024-02-13 21:57:05 +01:00
Alexandre Julliard
215a8e68d3 ntdll: Move RtlLookupFunctionEntry() to the CPU backends. 2024-02-13 21:57:02 +01:00
Alexandre Julliard
b9a985a677 include: Add some public exception handling structures. 2024-02-13 17:59:38 +01:00
Paul Gofman
0b441c4c8f kernel32/tests: Add tests for critical section debug info presence. 2024-02-13 15:46:24 +01:00
Gabriel Ivăncescu
e8f4909ac3 kernelbase: Copy the read-only attribute from the source.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-12 23:02:03 +01:00
Bernhard Übelacker
267a5658fb wininet: Avoid crash in InternetCreateUrl with scheme unknown.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33050
2024-02-12 23:02:03 +01:00
Bernhard Übelacker
ceea01b165 wininet: Add missing assignment of return value. 2024-02-12 23:02:03 +01:00
Santino Mazza
ba4681e776 gdiplus: Implement font linking for gdiplus. 2024-02-12 23:02:03 +01:00
Santino Mazza
d68a9d1213 gdiplus/tests: Add interactive test for font linking. 2024-02-12 23:02:03 +01:00
Santino Mazza
1454ffe7dd gdiplus: Replace HDC with GpGraphics in parameters. 2024-02-12 23:02:03 +01:00
Santino Mazza
b549ae11fb mlang: Fix bug with codepage priority in GetStrCodePages. 2024-02-12 23:02:03 +01:00
Santino Mazza
bc62314811 mlang/tests: Test codepages priority bug in GetStrCodepages. 2024-02-12 23:02:03 +01:00
Santino Mazza
8293074558 mlang: Implement GetGlobalFontLinkObject. 2024-02-12 23:02:03 +01:00
Santino Mazza
6360992dea mlang/tests: Test for GetGlobalFontLinkObject. 2024-02-12 23:02:03 +01:00
Gabriel Ivăncescu
e00270a8b2 jscript: Implement ArrayBuffer.prototype.slice.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-12 23:02:03 +01:00
Gabriel Ivăncescu
aa2bd097d6 jscript: Implement DataView getters.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-12 23:02:03 +01:00
Gabriel Ivăncescu
556e3349ab jscript: Implement DataView setters.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-12 23:02:02 +01:00
Gabriel Ivăncescu
00f04ef3ce jscript: Add initial implementation of DataView.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-12 23:02:02 +01:00
Gabriel Ivăncescu
88c0f72bbf jscript: Add initial implementation of ArrayBuffer.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2024-02-12 23:02:02 +01:00
Eric Pouech
52b9f8a9fa kernel32/tests: Remove todo scaffolding for CreateProcess() tests.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-12 23:02:02 +01:00
Eric Pouech
233074ded0 msvcrt: Don't reset invalid std handle in init.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-12 23:02:02 +01:00
Eric Pouech
35bea75647 msvcrt/tests: Extend test for invalid std handle on msvcrt init.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-12 23:02:02 +01:00
Eric Pouech
4121a29b50 kernelbase: Don't use INVALID_HANDLE_VALUE as std handle in CreateProcess.
And don't infer detached console state from std handle values, but rely
on a NULL console handle.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-12 23:02:02 +01:00
Eric Pouech
eba8b54870 kernel32/tests: Add tests for CreateProcess with invalid handles.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-12 23:02:02 +01:00
Bernhard Übelacker
c418771a43 cmd: Avoid execution if block misses closing brackets. 2024-02-12 23:02:02 +01:00
Bernhard Übelacker
d7edf3e651 cmd: Handle lines with just spaces in bracket blocks.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51599
2024-02-12 23:02:02 +01:00
Piotr Caban
1d479df4e8 wininet: Set AutoConfigURL registry key when saving proxy information. 2024-02-12 23:02:02 +01:00
Piotr Caban
666a472f06 wininet: Set ProxyOverride registry key when saving proxy information. 2024-02-12 23:02:02 +01:00
Piotr Caban
17d8cb24d4 wininet: Store whole ProxyServer string so it's not lost while saving settings to registry. 2024-02-12 23:02:02 +01:00
Piotr Caban
40b5e767d4 wininet: Add support for reading AutoConfigURL from registry. 2024-02-12 23:02:02 +01:00
Piotr Caban
132da0e0ee wininet: Return process-wide proxy settings from INTERNET_GetProxySettings.
Use INTERNET_LoadProxySettings when settings from registry are needed.
2024-02-12 23:02:02 +01:00
Piotr Caban
5fe477767a wininet: Move reading proxy settings from registry to separate function. 2024-02-12 23:02:02 +01:00
Piotr Caban
1a53e28cc8 wininet: Don't allocate global_proxy structure dynamically. 2024-02-12 23:02:02 +01:00
Piotr Caban
c17b0d6a3f wininet: Store proxy type in proxyinfo_t. 2024-02-12 23:02:02 +01:00
Alexandre Julliard
df8d907fb4 ntdll/tests: Don't use x86-64 assembly on ARM64EC. 2024-02-12 23:01:55 +01:00
Alexandre Julliard
de492f9a34 ntdll: Implement RtlLookupFunctionTable. 2024-02-12 22:53:21 +01:00
Rémi Bernon
165830c317 winex11: Simplify XInput2 device valuator lookup.
Valuator names aren't well specified, and although they are usually
named "Rel X/Y" or "Abs X/Y", there are cases where the names are
different.

Lets just assume that the first two valuators are the X/Y axes, as it
seems to be generally the case.
2024-02-12 12:32:23 +01:00
Rémi Bernon
51e99345de winex11: Always listen to XInput2 device changes events. 2024-02-12 12:32:22 +01:00
Rémi Bernon
b7867059ce winex11: Initialize XInput2 extension on every thread. 2024-02-12 12:32:22 +01:00
Rémi Bernon
1a757a0146 winex11: Advertise XInput2 version 2.2 support.
This is the required version for XInput2 touch events. It also allows
to greatly simplify the code by listening to master device events only
and get rid of device id tracking:

Under XInput2 protocol version < 2.1, RawEvents are not supposed to be
sent if a pointer grab is active. However slave device events are still
received regardless of this specification and Wine implemented a
workaround to receive RawEvents during pointer grabs by listening to
these slave device events.

By advertising the support of XInput2 version >= 2.1, where RawEvents
are sent even during pointer grabs, we ensure to receive the RawMotion
even if a mouse grab is active.
2024-02-12 12:32:20 +01:00
Rémi Bernon
b341688dbd winex11: Process XInput2 events with QS_INPUT filter. 2024-02-12 12:32:20 +01:00
Yuxuan Shui
e9e8ab1392 dmband: Implement getting/setting GUID_BandParam on band tracks. 2024-02-12 12:26:34 +01:00
1091 changed files with 91611 additions and 46305 deletions

View file

@ -18,7 +18,7 @@ Charles Davis <cdavis@codeweavers.com>
Charles Davis <cdavis5x@gmail.com>
Christopher Gautier <krys@via.ecp.fr>
David A. Cuthbert <dacut@ece.cmu.edu>
David Heidelberger <david@ixit.cz>
David Heidelberg <david@ixit.cz>
Dennis Björklund <db@zigo.dhs.org>
Dennis Björklund <dennisb@cs.chalmers.se>
Dimitrie O. Paun <dimi@bigfoot.com>

View file

@ -1,12 +1,12 @@
The Wine development release 9.2 is now available.
The Wine development release 9.5 is now available.
What's new in this release:
- Mono engine updated to version 9.0.0.
- A number of system tray fixes.
- Exception handling improvements on ARM platforms.
- Initial SLTG-format typelib support in widl.
- Exception handling on ARM64EC.
- Improvements to Minidump support.
- Various bug fixes.
The source is available at <https://dl.winehq.org/wine/source/9.x/wine-9.2.tar.xz>
The source is available at <https://dl.winehq.org/wine/source/9.x/wine-9.5.tar.xz>
Binary packages for various distributions will be available
from <https://www.winehq.org/download>
@ -16,306 +16,375 @@ You will find documentation on <https://www.winehq.org/documentation>
Wine is available thanks to the work of many people.
See the file [AUTHORS][1] for the complete list.
[1]: https://gitlab.winehq.org/wine/wine/-/raw/wine-9.2/AUTHORS
[1]: https://gitlab.winehq.org/wine/wine/-/raw/wine-9.5/AUTHORS
----------------------------------------------------------------
### Bugs fixed in 9.2 (total 15):
### Bugs fixed in 9.5 (total 27):
- #43993 Quick3270 5.21: crashes when using the Connect function
- #47521 digikam 6.10 crashes on start
- #51360 vkGetDeviceProcAddr invalid behavior for functions from extensions unsupported by host Vulkan instance
- #51770 digikam-7.1.0 freezes on start
- #51843 dlls/ws2_32/socket.c:839:17: error: IP_ADD_SOURCE_MEMBERSHIP undeclared here
- #53934 __unDName fails to demangle a name
- #55997 Dolphin Emulator crashes from 5.0-17264
- #56122 LANCommander won't start, prints "error code 0x8007046C" (ERROR_MAPPED_ALIGNMENT)
- #56243 ShowSystray registry key was removed without alternative
- #56250 Elite Dangerous client gets stuck on black screen after launch
- #56256 Windows Sysinternals Process Explorer 17.05 shows incomplete user interface (32-bit).
- #56259 Microsoft Webview 2 installer hangs forever
- #56265 Epic Games Launcher 15.21.0 calls unimplemented function cfgmgr32.dll.CM_Get_Device_Interface_PropertyW
- #56291 Kodu game lab crashes (with xnafx40_redist+dotnet48 preinstalled): Object reference not set to an instance of an object.
- #56293 user32:msg test_recursive_hook fails on Windows 7
- #25207 SHFileOperation does not create new directory on FO_MOVE
- #29523 CDBurnerXP hangs on right-clicking empty space in the file browser
- #40613 Multiple applications require UAC implementation to run installer/app as a normal user instead of administrator (WhatsApp Desktop, Smartflix, Squirrel Installers, OneDrive)
- #44514 Elder Scrolls Online (Dragon Bones update) requires more than 32 samplers in pixel shaders with D3D11 renderer
- #45862 Multiple applications need MFCreateSinkWriterFromURL() implementation (Overwatch highlights, RadiAnt DICOM Viewer, Grand Theft Auto V Rockstar Editor)
- #48085 Wine error trying to install Mono after a version update
- #51957 Program started via HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths should also be started if extension ".exe" is missing
- #52352 YI Home installer crashes on unimplemented urlmon.dll.414
- #52622 windows-rs 'lib' test crashes on unimplemented function d3dcompiler_47.dll.D3DCreateLinker
- #53613 Visual novel RE:D Cherish! logo video and opening movie does not play
- #53635 Alune Klient 14.03.2022 crashes on unimplemented function urlmon.dll.414
- #54155 WeCom (aka WeChat Work) 4.x failed to launch.
- #55421 Fallout Tactics launcher has graphics glitches
- #55876 Acrom Controller Updater broken due to oleaut32 install
- #56318 Totem Arts Launcher.exe does not open
- #56367 Tomb Raider 3 GOG crashes at start
- #56379 d2d1 unable to build
- #56380 Rocket League crashes with Wine 9.3 after BakkesMod (trainer app) injects into the game
- #56400 SSPI authentication does not work when connecting to sql server
- #56406 wineserver crashes in set_input_desktop()
- #56411 Failure to build wine 9.4 due to EGL 64-bit development files not found
- #56433 QQ8.9.6 Installer crashes at very beginning due to a change in server/process.c
- #56434 WScript.Network does not implement UserName, ComputerName, and UserDomain properties
- #56435 capture mouse dont work in virtual desktop (work on wine 9.3)
- #56445 d3d1-9 applications run out of memory after f6a1844dbe (ArmA: Cold War Assault, Final Fantasy XI Online, Far Cry 3)
- #56450 Non-input USB HID devices stopped working in 9.1
- #56458 ntdll tests skipped on win7 & win8: missing entry point kernel32.RtlPcToFileHeader
### Changes since 9.1:
### Changes since 9.4:
```
Aida Jonikienė (1):
configure: Use YEAR2038 macro when it's available.
Akihiro Sagawa (2):
dsound/tests: Add tests for implicit MTA creation in IDirectSound::Initialize().
dsound: Initialize MTA in IDirectSound::Initialize().
Alex Henrie (2):
krnl386: Emulate the VGA status register.
explorer: Handle the back and forward buttons of a 5-button mouse.
Alexandre Julliard (42):
configure: Check the correct variable for the Wayland EGL library.
ntdll: Implement RtlRestoreContext on ARM64EC.
ntdll: Implement RtlWalkFrameChain on x86-64.
ntdll: Implement RtlWalkFrameChain on i386.
ntdll: Implement RtlWalkFrameChain on ARM.
ntdll: Implement RtlWalkFrameChain on ARM64.
ntdll: Implement RtlWalkFrameChain on ARM64EC.
ntdll: Export RtlVirtualUnwind2 and RtlWalkFrameChain.
ntdll: Share RtlCaptureStackBackTrace implementation across platforms.
secur32/tests: Update count for new winehq.org certificate.
ws2_32/tests: Fix a couple of failures on Windows.
include: Define setjmpex prototype even when it's a builtin.
ntdll/tests: Directly link to setjmp().
ntdll/tests: Fix a backtrace test failure on Windows ARM64.
ntdll: Add test for non-volatile regs in consolidated unwinds.
ntdll: Port the RtlRestoreContext test to ARM64.
ntdll: Port the RtlRestoreContext test to ARM.
ntdll: Implement RtlUnwindEx on ARM64EC.
ntdll: Move __C_specific_handler implementation to unwind.c.
ntdll: Implement __C_specific_handler on ARM64EC.
ntdll: Always use SEH support on ARM64.
ntdll/tests: Skip segment register tests on ARM64EC.
ntdll/tests: Fix debug register tests on ARM64EC.
ntdll/tests: Fix a few more test failures on ARM64EC.
ntdll: Implement RtlGetCallersAddress.
kernelbase: Remove no longer needed DllMainCRTStartup function.
include: Add some new error codes.
include: Add some new status codes.
ntdll: Add mappings for more status codes.
jscript: Use the correct facility for JScript errors.
netprofm: Use the correct symbols for error codes.
msvcrt: Use floating point comparison builtins also in MSVC mode.
ntdll/tests: Fix exception address checks in child process on ARM64EC.
ntdll/tests: Update the KiUserExceptionDispatcher test for ARM64EC.
configure: Don't build wow64 support in non-PE builds.
wow64: Use a .seh handler in raise_exception().
wow64: Always use a .seh handler in cpu_simulate().
wow64: Access the BTCpuSimulate backend function pointer directly.
wow64: Use a .seh handler for system calls.
wow64cpu: Save non-volatile registers before switching to 32-bit code.
wow64: Use setjmp/longjmp from ntdll.
server: Add a helper to trace uint64 arrays.
Alexandre Julliard (37):
configure: Reset host flags in all cross-compiler error paths.
winsta: Start time is an input parameter in WinStationGetProcessSid.
ntdll: Use the system setjmp/longjmp for exceptions in Unix libs.
ntdll: Use a .seh handler for the unwind exception handler.
ntdll: Avoid calling DbgBreakPoint() in process_breakpoint().
ntdll: Move DbgUiRemoteBreakin() to the CPU backends.
include: Include cfg.h from cfgmgr32.h.
ntdll: Report the correct address for breakpoint exception on ARM platforms.
kernel32/tests: Fix some test failures on ARM platforms.
ntdll: Use a .seh handler for DbgUiRemoteBreakin().
dbghelp/tests: Mark failing tests as todo.
Revert "loader: Associate folder with explorer".
configure: Require a PE compiler for 32-bit ARM.
ntdll: Share the is_valid_frame() helper function.
ntdll: Only call TEB handlers for frames inside the current stack.
winedump: Make the ARM exception information more compact.
winedump: Handle ARM64 exception unwind info with flag==3.
winebuild: Default to plain "clang" in find_clang_tool().
winebuild: Remove some no longer used code for ARM platforms.
winebuild: Add .seh annotations on ARM.
kernel32: Move Wow64Get/SetThreadContext implementation to kernelbase.
kernel32: Don't export RtlRaiseException on ARM64.
ntdll: Fix stack layout for ARM syscalls.
ntdll/tests: Add some process machine tests for ARM64X.
server: Don't report alternate 64-bit machines as supported.
ntdll: Update the image information when loading a builtin dll.
ntdll: Use the correct machine when loading ntdll on ARM64EC.
server: Don't update the machine in the image information for ARM64EC modules.
server: Don't update the entry point in the image information for ARM64EC modules.
ntdll: Redirect the module entry point for ARM64EC modules.
server: Add hybrid flag in image mapping information.
ntdll: Use the current machine by default to create an ARM64X process.
ntdll: Fix RtlWow64GetCurrentMachine() result on ARM64EC.
uxtheme: Use BOOLEAN instead of BOOL in ordinal functions.
gdi32/tests: Fix the expected GetTextMetrics() results on recent Windows.
user32/tests: Fix some sysparams results on recent Windows.
ntdll/tests: Mark a failing test as todo.
Alexandros Frantzis (5):
winewayland.drv: Implement wglCreateContextAttribsARB.
winewayland.drv: Implement wglShareLists.
winewayland.drv: Implement wgl(Get)SwapIntervalEXT.
win32u: Cancel auto-repeat only if the repeat key is released.
win32u: Cancel previous key auto-repeat when starting a new one.
Alexandros Frantzis (2):
winewayland.drv: Track and apply latest window cursor on pointer enter.
win32u: Use consistent locking order for display related mutexes.
Andrew Nguyen (3):
ddraw: Reserve extra space in the reference device description buffer.
oleaut32: Bump version resource to Windows 10.
ddraw: Release only valid texture parents on ddraw_texture_init failure.
Arkadiusz Hiler (4):
winebus.sys: Fix units used for hat switches.
winebus.sys: Use 4 bits for hat switches.
wbemprox/tests: Test LIKE queries.
wbemprox: Reimplement LIKE.
Andrew Wesie (1):
wined3d: Use bindless textures for GLSL shaders if possible.
Brendan Shanks (2):
winebuild: Refactor find_tool().
winebuild: As a last resort, search for tools un-prefixed using clang.
Brendan McGrath (5):
comdlg32: Use values from DeviceCapabilities in combobox.
comdlg32: Add resolutions to PRINTDLG_ChangePrinterW.
comdlg32: Populate printer name on the print dialogs.
comdlg32: Use ANSI functions in ANSI WMCommandA.
comdlg32: Don't treat cmb1 as the printer list unless in PRINT_SETUP.
Daniel Lehman (9):
glu32/tests: Add a few tests for gluScaleImage.
glu32: Return GL_OUT_OF_MEMORY from gluScaleImage if no context.
glu32: Return GLU_INVALID_ENUM for illegal pixel types.
advapi32/tests: Reduce reallocations.
advapi32/tests: Add some more EventLog tests.
oleaut32/tests: Add tests for VarBstrFromR8.
oleaut32/tests: Add tests for VarBstrFromR4.
ucrtbase/tests: Add sprintf tests.
msvcrt/tests: Add sprintf tests.
Brendan Shanks (6):
ntdll: Remove support for msg_accrights FD passing.
server: Remove support for msg_accrights FD passing.
mountmgr: Replace sprintf with snprintf to avoid deprecation warnings on macOS.
mountmgr: Replace some malloc/sprintf/strcpy calls with asprintf.
opengl32: Replace sprintf with snprintf/asprintf to avoid deprecation warnings on macOS.
secur32: Replace sprintf with snprintf to avoid deprecation warnings on macOS.
David Kahurani (5):
gdiplus: Use GdipCreatePath2 in GdipClonePath.
gdiplus: Use GdipCreatePath2 when serializing paths.
gdiplus: Use path_list to path helper in GdipFlattenPath.
gdiplus: Use path_list to path helper in GdipWidenPath.
msvcrt: Free previous environment variable when clearing.
Daniel Lehman (2):
oleaut32/tests: Add tests for GetSizeMax after dirty flag cleared.
oleaut32: Return success from GetSizeMax if not dirty.
David Gow (1):
evr/dshow: Support NV12 in evr_render.
David Heidelberg (2):
d3d9/tests: Replace LPDWORD cast with float_to_int function.
mailmap: Add a mailmap entry for myself with the proper name.
Dmitry Timoshkov (6):
d2d1: Make some strings const.
wineps.drv: Return default resolution if PPD doesn't provide the list of supported resolutions.
kerberos: Allocate memory for the output token if requested.
comctl32/tests: Add more tests for IImageList2 interface.
comctl32: Implement IImageList2::Initialize().
widl: Add initial implementation of SLTG typelib generator.
Eric Pouech (18):
dmime/tests: Fix copy & paste errors.
dmime/tests: Add some tests for loops on wave tracks.
dmime: Fix IDirectMusicAudioPath::GetObjectInPath() prototype.
dmime: Remove unused fields in segment.
dmime/tests: Add some tests about end-points.
dbghelp/tests: Use Unicode encoding for generated PDB filenames.
dbghelp/tests: Test SymSrvGetFileIndexInfo() on .dbg files.
dbghelp: Implement SymSrvGetFileIndexInfo() for .dbg files.
dbghelp: Implement SymSrvGetFileIndexInfo() for PDB/JG files.
kernel32/tests: Added tests about std handle flags inheritance.
kernel32/tests: Test DUPLICATE_SAME_ATTRIBUTES flag in DuplicateHandle().
server: Implement support for DUPLICATE_SAME_ATTRIBUTES in DuplicateHandle().
server: Preserve handle flags when inheriting a std handle.
dmime: Fully implement IDirectMusicSegmentState::GetRepeats().
dmime: Add tests about segment state's graph interface.
dmime: Add IDirectMusicGraph interface to segment state.
dmime: Generate track flags while in loop.
dmime: Use sent duration in loop's playback.
include: Update minidumpapiset.h.
dbghelp/tests: Add tests for minidumps.
dbghelp/tests: Add tests about generated memory chunks.
dbghelp/tests: Add tests about minidump's callback.
dbghelp/tests: Test exception information in minidump.
dbghelp/tests: Add tests for function table lookup.
dbghelp: Use an intermediate buffer in SymFunctionTableAccess (x86_64).
dbghelp: Don't write minidump from running thread.
dbghelp: Simplify thread info generation in minidump.
dbghelp: Add support for V2 unwind info (x86_64).
winedbg: Fallback to PE image when reading memory (minidump).
winedbg: Reload module without virtual flag.
dbghelp: No longer embed unwind information in minidump (x86_64).
winedbg: Add ability to set executable name.
winedbg: Extend 'attach' command to load minidump files.
winedbg: Flush expr buffer upon internal exception.
winedbg: Update the CPU information displayed when reloading a minidump.
winedbg: Don't reload a minidump for a different machine.
Esme Povirk (6):
gdiplus: Prefer Tahoma for generic sans serif font.
mscoree: Update Wine Mono to 9.0.0.
user32/tests: Accept EM_GETPASSWORDCHAR when edit is focused.
gdiplus: Fix some degenerate cases combining infinite regions.
gdiplus/tests: Thoroughly test region combines.
user32/tests: Fix flags on expected EM_GETPASSWORDCHAR message.
Esme Povirk (7):
user32/tests: Accept HCBT_ACTIVATE in TrackPopupMenu.
gdiplus: Check bounding box in GdipIsVisibleRegionPoint.
user32/tests: Add another missing message for TrackPopupMenu.
gdiplus/tests: Region bounds aren't rounded.
gdiplus: Calculate region bounding box without generating HRGN.
user32/tests: Accept WM_ACTIVATE in TrackPopupMenu.
user32/tests: Further updates for win11 TrackPopupMenu failures.
Fabian Maurer (1):
msi: Don't write past end of string when selecting parent directory.
Felix Münchhalfen (2):
ntdll: Use pagesize alignment if MEM_REPLACE_PLACEHOLDER is set in flags of NtMapViewOfSection(Ex).
kernelbase/tests: Add a test for MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER.
Gabriel Ivăncescu (16):
mshtml: Forward the script site's QueryService to the document's.
mshtml: Forward SID_SInternetHostSecurityManager of the document obj to the doc node.
mshtml: Implement IActiveScriptSite service.
mshtml: Implement Exec for CGID_ScriptSite's CMDID_SCRIPTSITE_SECURITY_WINDOW.
vbscript: Implement IActiveScriptSite service.
jscript: Implement IActiveScriptSite service.
mshtml: Use a hook to implement postMessage.
mshtml: Implement `source` prop for MessageEvents.
mshtml: Return E_ABORT from postMessage called without a caller ServiceProvider.
mshtml: Implement `data` getter for MessageEvent objs.
mshtml: Implement `origin` prop for MessageEvents.
mshtml: Implement `initMessageEvent` for MessageEvents.
mshtml: Expose the IHTMLEventObj5 props to scripts.
mshtml/tests: Test builtin function default value getter with custom IOleCommandTarget.
explorer: Don't activate the systray icon when showing it.
explorer: Set layered style on systray icons only when it's actually layered.
Georg Lehmann (3):
winevulkan: Prepare for VK_KHR_calibrated_timestamps.
winevulkan: Update to VK spec version 1.3.277.
winevulkan: Enable VK_ARM_render_pass_striped.
Gabriel Ivăncescu (1):
shell32: Construct the proper path target for UnixFolder.
Giovanni Mascellani (1):
d2d1: Compile vertex shaders with D3DCompile().
d2d1: Compile the pixel shader with D3DCompile().
Hans Leidekker (1):
msxml3: Enable XPath object cache.
Hans Leidekker (3):
dnsapi/tests: Skip tests if no CNAME records are returned.
ntdll/tests: Fix a test failure.
ntdll/tests: Load NtMakeTemporaryObject() dynamically.
Helix Graziani (2):
cfgmgr32: Add CM_Get_Device_Interface_PropertyW stub.
windows.globalization: Add IIterable_HSTRING impl to IVectorView_HSTRING.
Henri Verbeet (1):
wined3d: Do not check the input signature element count for sm4+ shaders in shader_spirv_compile_arguments_init().
Ivo Ivanov (1):
winebus.sys: Prefer hidraw if it is the only backend enabled.
Jacek Caban (2):
configure: Don't explicitly enable -Wenum-conversion on Clang.
widl: Always close parsed input file.
Jacek Caban (11):
ncrypt/tests: Don't use uninitialized variable in test_get_property.
windowscodecs: Pass result as void pointer to ComponentInfo_GetUINTValue.
mf: Avoid implicit enum to int pointer casts.
mfplat: Avoid implicit cast in IMFAttributes_GetUINT32 call.
mfplat/tests: Use MF_ATTRIBUTE_TYPE type in IMFMediaType_GetItemType call.
mfplat: Introduce media_type_get_uint32 helper.
mfmediaengine/tests: Use MF_MEDIA_ENGINE_CANPLAY type in IMFMediaEngine_CanPlayType call.
mfmediaengine: Avoid implicit casts in IMFAttributes_GetUINT32 calls.
include: Add RtlRestoreContext declaration.
d3d10/tests: Avoid implicit cast changing value.
dsound: Simplify f_to_32.
Jinoh Kang (10):
tools/gitlab: Run make_specfiles before building.
ntdll/tests: Add tests for OBJ_PERMANENT object attribute.
ntdll/tests: Add tests for NtMakeTemporaryObject.
server: Generalize server request make_temporary to set_object_permanence.
ntdll: Implement NtMakePermanentObject.
ntdll/tests: Don't import kernel32.RtlPcToFileHeader.
Revert "ntdll/tests: Load NtMakeTemporaryObject() dynamically."
server: Check for DELETE access in NtMakeTemporaryObject().
kernelbase: Open object with DELETE access for NtMakeTemporaryObject().
gitlab: Output collapsible section markers in test stage script.
Louis Lenders (5):
ntdll: Add stub for RtlGetDeviceFamilyInfoEnum.
shcore: Add stub for RegisterScaleChangeNotifications.
wbemprox: Add property 'Caption' to Win32_PnPEntity.
wbemprox: Add property 'ClassGuid' to Win32_PnPEntity.
wbemprox: Add property 'Caption' to Win32_DiskDrive.
Kyrylo Babikov (1):
dbghelp: Fix PDB processing using the FPO stream instead of FPOEXT.
Marc-Aurel Zent (2):
ntdll: Reimplement set_native_thread_name() for macOS.
ntdll: Fix DW_OP_abs absolute value warning on labs() for clang.
Louis Lenders (1):
shell32: Try appending .exe when looking up an App Paths key.
Nikolay Sivov (3):
mfplat/tests: Skip device manager test if d3d11 device can't be created.
mfplat/tests: Skip tests that require d3d9 support.
d3d10/effect: Clarify constant buffer flags field meaning.
Marcus Meissner (1):
ntdll/tests: Fix size passed to GetModuleFileNameW.
Paul Gofman (6):
ntdll/tests: Fix test_user_shared_data() for a more generic set of present features.
server: Check if we have waiting asyncs in (send_socket) before enforcing blocking send.
server: Check if we have waiting asyncs in sock_dispatch_asyncs() before clearing POLLOUT.
explorer: Don't pop start menu on "minimize all windows" systray command.
explorer: Don't pop start menu on "undo minimize all windows" systray command.
msvcrt: Adjust _gmtime64_s() accepted time limits.
Mark Jansen (1):
kernel32/tests: Add tests for job object accounting.
Nikolay Sivov (16):
include: Add ID2D1Factory7 definition.
include: Add ID2D1DeviceContext6 definition.
d3dcompiler: Set correct compilation target for effects profiles.
d3dcompiler: Wrap fx_4_x output in a dxbc container.
d3d10/tests: Add a small effect compilation test.
wshom/network: Use TRACE() for implemented method.
wshom/network: Implement GetTypeInfo().
wshom/network: Implement ComputerName() property.
wshom/network: Check pointer argument in get_UserName().
d3dx10/tests: Remove todo's from now passing tests.
d3d10_1/tests: Remove todo from now passing test.
wshom/network: Implement UserDomain property.
msxml6/tests: Add some tests for MXWriter60.
msxml/tests: Move some of the validation tests to their modules.
msxml/tests: Move version-specific schema tests to corresponding modules.
include: Remove XMLSchemaCache60 from msxml2.idl.
Noah Berner (1):
advapi32/tests: Add todo_wine to tests that are currently failing.
Paul Gofman (11):
imm32: Set lengths to 0 for NULL strings in ImmSetCompositionString().
cryptowinrt: Force debug info in critical sections.
diasymreader: Force debug info in critical sections.
dsdmo: Force debug info in critical sections.
qasf: Force debug info in critical sections.
services: Force debug info in critical sections.
explorer: Force debug info in critical sections.
ntdll: Only allocate debug info in critical sections with RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO.
server: Ignore some ICMP-originated socket errors for connectionless sockets.
strmbase: Fallback to InitializeCriticalSection() if RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO is unsupported.
ntdll: Don't use debug info presence to detect critical section global status.
Pavel Ondračka (1):
d3d9/tests: Define enums outside of struct.
Piotr Caban (6):
msvcrt: Store _unDName function parameter backreferences in parsed_symbol structure.
msvcrt: Remove no longer used parameters reference arguments from _unDname helpers.
winedump: Sync demangling code with msvcrt.
jsproxy: Don't ignore hostname and url length in InternetGetProxyInfo.
winhttp/tests: Add more WinHttpGetProxyForUrl tests.
winhttp: Add support for WINHTTP_AUTOPROXY_HOST_LOWERCASE flag in WinHttpGetProxyForUrl.
ntdll: Workaround sendmsg bug on macOS.
winedump: Fix REG_DWORD dumping with no data.
advapi32/tests: Merge RegLoadKey and RegUnLoadKey tests.
advapi32/tests: Remove all files created by RegLoadKey tests.
advapi32/tests: Test if modifications are saved in RegUnLoadKey.
advapi32/tests: Remove all files created by RegLoadAppKey tests.
Rémi Bernon (48):
explorer: Restore a per-desktop ShowSystray registry setting.
mf/tests: Check inserted topology loader transforms explicitly.
mf/topology_loader: Use a local variable for the indirect connection method.
mf/topology_loader: Ignore SetOutputType errors when doing indirect connect.
mf/topology_loader: Initialize transform output type before adding converter.
mf/topology_loader: Try to connect transform nodes with their current types first.
winegstreamer: Implement H264 decoder GetInputCurrentType.
winegstreamer: Ask GStreamer to stop messing with signal handlers.
vulkan-1/tests: Enable VK_VERSION_1_1 as requested by validation layers.
vulkan-1/tests: Create surface and device before calling test_null_hwnd.
vulkan-1/tests: Test VK_KHR_win32_surface with windows in various states.
vulkan-1/tests: Add more VK_KHR_win32_surface surface formats tests.
vulkan-1/tests: Test VK_KHR_win32_surface WSI with swapchain functions.
imm32/tests: Also ignore NotifyIME calls when ignoring WM_IME_NOTIFY.
imm32/tests: Fix some spurious failures with Windows ko_KR IME.
win32u: Only queue a single IME update during ImeProcessKey.
winevulkan: Keep the create_info HWND on the surface wrappers.
winevulkan: Return VK_ERROR_SURFACE_LOST_KHR from surface functions.
winewayland: Remove now unnecessary VK_ERROR_SURFACE_LOST_KHR checks.
winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfaceSupportKHR driver entry.
winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfacePresentModesKHR driver entry.
winevulkan: Remove now unnecessary vkGetDeviceGroupSurfacePresentModesKHR driver entry.
user32/tests: Run rawinput device tests in the separate desktop.
user32/tests: Rewrite the rawinput buffer test with keyboard input.
dinput/tests: Add a helper to wait on HID input reads.
dinput/tests: Add more tests for HID rawinput buffer.
dinput/tests: Test rawinput messages with non-input desktop.
dinput/tests: Use a polled HID touchscreen device.
dinput/tests: Test rawinput with the virtual HID touchscreen.
winegstreamer: Trace wg_transform input and output caps.
winegstreamer: Handle allocation query in a separate helper.
winegstreamer: Handle sink caps query in a separate helper.
winegstreamer: Handle sink event caps in a separate helper.
winegstreamer: Use GST_PTR_FORMAT to trace GStreamer objects.
winegstreamer: Ignore wg_transform input / output video format fps.
winegstreamer: Allow wg_transform size changes with an explicit attribute.
mf/tests: Report more transform current type mismatches.
mf/tests: Add some tests with video processor aperture handling.
mfreadwrite/tests: Initialize test source stream types from descriptors.
mfreadwrite/tests: Test source reader exposed transforms and types.
mfreadwrite/tests: Test source reader transforms with MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING.
mfreadwrite/tests: Test source reader transforms with MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING.
server: Combine HID usage page and usage together.
server: Stop using union rawinput in hw_input_t.
server: Stop using hardware_msg_data in rawinput_message.
server: Move rawinput message conversion from win32u.
server: Fix rawinput buffer sizes and alignment on WoW64.
win32u: Get rid of the rawinput thread data and buffer.
Robin Kertels (1):
d3d9/tests: Skip desktop window tests if device creation fails.
Shaun Ren (4):
sapi: Create a new engine only when needed in ISpVoice.
sapi: Add ISpeechObjectToken stub.
sapi: Add ISpeechObjectTokens stub.
sapi: Add stub implementation for ISpeechObjectTokens::get__NewEnum.
Rémi Bernon (74):
win32u: Move D3DKMT functions to a new d3dkmt.c source.
win32u: Move D3DKMT VidPn* functions out of winex11.
win32u: Add an adapter struct to the device manager context.
win32u: Split writing monitor to registry to a separate helper.
win32u: Get rid of the monitor display_device.
win32u: Get rid of the monitor state_flags.
win32u: Get rid of the adapter display_device.
win32u: Get rid of the monitor flags.
win32u: Enumerate monitors from their device keys.
mfreadwrite/reader: Handle MF_E_TRANSFORM_STREAM_CHANGE results.
win32u: Fix incorrect ascii key name in get_config_key.
winevulkan: Use an rb_tree and allocate entries for handle mappings.
winevulkan: Use a single allocation for device and queues.
winevulkan: Pass VkDeviceQueueCreateInfo to wine_vk_device_init_queues.
winevulkan: Rename wine_vk_physical_device_alloc parameters and variables.
winevulkan: Use a single allocation for instance and physical devices.
winevulkan: Get rid of the wine_vk_device_free helper.
winevulkan: Simplify wine_vk_instance_free helper.
winevulkan: Add handle mappings on creation success only.
winevulkan: Get rid of the wine_vk_instance_free helper.
mfplat/tests: Test each VIDEOINFOHEADER field conversion separately.
mfplat/mediatype: Implement implicit MFInitMediaTypeFromVideoInfoHeader subtype.
mfplat/mediatype: Implement MFInitMediaTypeFromVideoInfoHeader2.
mfplat/tests: Add tests for MFInitMediaTypeFromVideoInfoHeader2.
mfplat/mediatype: Implement MFInitAMMediaTypeFromMFMediaType for FORMAT_VideoInfo2.
mfplat/tests: Test aperture to VIDEOINFOHEADER fields mapping.
mfplat/mediatype: Support FORMAT_VideoInfo2 in MFInitMediaTypeFromAMMediaType.
mfplat/mediatype: Set MF_MT_SAMPLE_SIZE from bmiHeader.biSizeImage.
mfplat/mediatype: Map rcSource to MF_MT_(PAN_SCAN|MINIMUM_DISPLAY)_APERTURE.
mfplat/mediatype: Set rcSource and rcTarget if stride differs from width.
mfplat/tests: Add more MFAverageTimePerFrameToFrameRate tests.
mfplat: Support flexible frame time in MFAverageTimePerFrameToFrameRate.
mfplat/mediatype: Implement MF_MT_FRAME_RATE from VIDEOINFOHEADER2.
mfplat/mediatype: Implement VIDEOINFOHEADER2 dwControlFlags conversion.
mfplat/mediatype: Implement some VIDEOINFOHEADER2 dwInterlaceFlags conversion.
mfplat/tests: Test that aperture is dropped with VIDEOINFOHEADER2.
mfplat/tests: Test that MFCreateMFVideoFormatFromMFMediaType appends user data.
mfplat/mediatype: Append user data in MFCreateMFVideoFormatFromMFMediaType.
mfplat/tests: Check the conditions for the MFVideoFlag_BottomUpLinearRep flags.
mfplat/mediatype: Stub MFInitMediaTypeFromMFVideoFormat.
mfplat/tests: Add tests for MFInitMediaTypeFromMFVideoFormat.
mfplat/mediatype: Implement MFInitMediaTypeFromMFVideoFormat.
winebus: Add HID usages in the device descriptor when possible.
winebus: Read hidraw device usages from their report descriptors.
winebus: Prefer hidraw for everything that is not a game controller.
winebus: Remove devices that are ignored wrt hidraw preferences.
winevulkan: Allow only one vulkan surface at a time for an HWND.
win32u: Avoid a crash when cleaning up a monitor without an adapter.
winegstreamer: Release sink caps in the error path.
winegstreamer: Append an optional parser before decoders.
mfplat/tests: Add some broken results for Win7.
mfplat/tests: Test initializing mediatype from AAC WAVEFORMATEXTENSIBLE.
mfplat/tests: Check how AAC attributes are copied from user data.
mfplat/mediatype: Check format pointers and sizes in MFInitMediaTypeFromAMMediaType.
mfplat/mediatype: Support audio major type in MFInitMediaTypeFromAMMediaType.
mfplat/mediatype: Force WAVEFORMATEXTENSIBLE in MFCreateWaveFormatExFromMFMediaType in some cases.
mfplat/mediatype: Implement MFCreateMediaTypeFromRepresentation.
mfplat/mediatype: Use MFCreateWaveFormatExFromMFMediaType in init_am_media_type_audio_format.
ntoskrnl.exe: Open symbolic link with DELETE before making them temporary.
server: Avoid removing thread twice from its desktop thread list.
winex11: Accept key and mouse events with QS_RAWINPUT.
server: Send WM_WINE_CLIPCURSOR message only when necessary.
server: Send WM_WINE_SETCURSOR message only when necessary.
win32u: Use a structure to pass peek_message arguments.
server: Check for internal hardware messages before others.
server: Process internal messages when checking queue status.
user32/tests: Add missing winetest_pop_context.
user32/tests: Add some LoadKeyboardLayoutEx tests.
winemac: Use SONAME_LIBVULKAN as an alias for MoltenVK.
win32u: Move vulkan loading and init guard out of the drivers.
win32u: Move vkGet(Instance|Device)ProcAddr out the drivers.
winevulkan: Stop generating the wine/vulkan_driver.h header.
win32u: Move vkGet(Device|Instance)ProcAddr helpers inline.
mfplat: Append MFVIDEOFORMAT user data after the structure padding.
Tim Clem (1):
winebus.sys: Do not attempt to open keyboard and mouse HID devices on macOS.
Santino Mazza (2):
mf/test: Check the topologies id's in topo loader.
mf/topoloader: Preserve input topology id.
Vibhav Pant (1):
configure: Correctly derive the target from CC if it's set to an absolute path.
Vijay Kiran Kamuju (4):
include: Add Windows.UI.ViewManagement.UIViewSettings definitions.
urlmon: Add stub for ordinal 414.
d3dcompiler: Add D3DCreateLinker stub.
user32: Add LoadKeyboardLayoutEx stub.
Yuxuan Shui (2):
dmusic: Fix loading wave data from soundfont.
mf: Only preroll when starting from stopped state.
Yuxuan Shui (8):
shell32/tests: Check FindExecutable is looking in the correct current directory.
shell32/tests: Check ShellExecute is looking in the correct current directory.
shell32: PathResolve(file, NULL, ...) should not look in the current directory.
shell32: Make sure PathResolve can find files in the current directory.
shell32: PathResolve should be able to find files that already have extensions.
shell32: PathResolve should remove trailing dot.
shell32: Fix FindExecutable search path.
shell32: Rely solely on SHELL_FindExecutable for ShellExecute.
Zebediah Figura (8):
wined3d: Move state objects from state.c to device.c.
wined3d: Rename state.c to ffp_gl.c.
wined3d: Move sampler_texdim() and texture_activate_dimensions() to ffp_gl.c.
d3d8/tests: Add more tests for SPECULARENABLE.
wined3d/glsl: Always set WINED3D_SHADER_CONST_FFP_LIGHTS in FFP constant update masks.
wined3d/glsl: Pass through the specular varying when SPECULARENABLE is FALSE.
wined3d/arb: Always disable the fragment pipeline in shader_arb_select().
wined3d/arb: Compare the fragment pipe ops in shader_arb_select() instead of using an extra field.
Zebediah Figura (12):
ntdll: Assign a primary token in elevate_token().
d3d9/tests: Remove a no longer accurate comment.
d3d11/tests: Add a test for using a large number of SRV resources.
wined3d: Rename the shader_select_compute method to shader_apply_compute_state.
wined3d: Move checking shader_update_mask to shader_glsl_apply_compute_state().
shell32/tests: Remove obsolete workarounds from test_move().
quartz: Implement SetVideoClippingWindow() and PresentImage() in the VMR7 presenter.
quartz: Reimplement the VMR7 using the VMR7 presenter.
quartz: Implement IVMRSurfaceAllocatorNotify::AdviseSurfaceAllocator().
quartz: Return S_OK from IVMRSurfaceAllocator_PrepareSurface().
quartz/tests: Add some tests for VMR7 renderless mode.
wined3d: Avoid leaking string buffers in shader_glsl_load_bindless_samplers().
Zhiyi Zhang (7):
winex11.drv: Translate whole_rect to x11 root coordinates in set_size_hints().
user32/tests: Fix test_recursive_messages() test failures on win7.
mf: Make session_get_node_object() more robust.
mf: Add a session_flush_nodes() helper.
mf/tests: Add a create_test_topology() helper.
mf: Support seeking while a session is started.
mf/tests: Test IMFMediaSession::Start().
Zhenbo Li (1):
shell32: Create nonexistent destination directories in FO_MOVE.
Zhiyi Zhang (5):
mfreadwrite: Fix a memory leak (Coverity).
win32u: Support HiDPI for the non-client close button in WS_EX_TOOLWINDOW windows.
win32u: Fix a possible condition that makes EnumDisplayMonitors() not reporting any monitors.
win32u: Don't enumerate mirrored monitor clones for GetSystemMetrics(SM_CMONITORS).
win32u: Don't enumerate mirrored monitor clones when unnecessary.
```

10
AUTHORS
View file

@ -405,7 +405,7 @@ David Gow
David Grant
David Hammerton
David Hedberg
David Heidelberger
David Heidelberg
David Hemmo
David Howells
David Kahurani
@ -591,6 +591,7 @@ Gavriel State
Gediminas Jakutis
Geoff Clare
Geoffrey Hausheer
Geoffrey McRae
Geoff Thorpe
Georg Beyerle
George Gov
@ -973,6 +974,7 @@ Karl Lessard
Karl Relton
Karol Herbst
Karsten Elfenbein
Kartavya Vashishtha
Kasper Sandberg
Katarzyna Caban
K.B.Dharun Krishna
@ -1034,12 +1036,14 @@ Kristian Nielsen
Kristján Gerhardsson
Kristofer Henriksson
Kristoffer Gleditsch
Krzysztof Bogacki
Krzysztof Foltman
Krzysztof Kotlenga
Krzysztof Nowicki
Kurt Kartaltepe
Kusanagi Kouichi
Kyle Luna
Kyrylo Babikov
Lance Jackson
Lars-Ake Fredlund
Lars Heete
@ -1309,6 +1313,7 @@ Niels Kristian Bech Jensen
Nigel Liang
Nikita Morozkin
Nikita V. Youshchenko
Nikola Kuburović
Nikola Pavlica
Nikolas Zimmermann
Nikolay Bogoychev
@ -1316,6 +1321,7 @@ Nikolay Sivov
Nikolay Stefanov
Nils Kuhnhenn
Nix N. Nix
Noah Berner
Noel Borthwick
Noomen Hamza
Norman Stevens
@ -1383,6 +1389,7 @@ Paul van Schayck
Paul Vriens
Pavel Borecki
Pavel Kankovsky
Pavel Ondračka
Pavel Roskin
Pavel Semerad
Pavel Troller
@ -1479,6 +1486,7 @@ Ralf S. Engelschall
Ramon Garcia
Randy Weems
Raphael Junqueira
Rastislav Stanik
Raul Dias
Raul Fernandes
Raul Metsma

View file

@ -169,6 +169,7 @@ P: Aric Stewart <aric@codeweavers.com>
F: dlls/hid/
F: dlls/hidclass.sys/
F: dlls/hidparse.sys/
F: dlls/mouhid.sys/
F: dlls/winehid.sys/
HTTP server
@ -217,7 +218,6 @@ P: Zebediah Figura <z.figura12@gmail.com>
F: dlls/mf/tests/transform.c
F: dlls/winegstreamer/aac_decoder.c
F: dlls/winegstreamer/color_convert.c
F: dlls/winegstreamer/h264_decoder.c
F: dlls/winegstreamer/media_source.c
F: dlls/winegstreamer/mfplat.c
F: dlls/winegstreamer/resampler.c

View file

@ -42,7 +42,7 @@ especially the wealth of information found at https://www.winehq.org.
To compile and run Wine, you must have one of the following:
- Linux version 2.0.36 or later
- Linux version 2.6.22 or later
- FreeBSD 12.4 or later
- Solaris x86 9 or later
- NetBSD-current

View file

@ -1 +1 @@
Wine version 9.2
Wine version 9.5

422
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for Wine 9.2.
# Generated by GNU Autoconf 2.71 for Wine 9.5.
#
# Report bugs to <wine-devel@winehq.org>.
#
@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Wine'
PACKAGE_TARNAME='wine'
PACKAGE_VERSION='9.2'
PACKAGE_STRING='Wine 9.2'
PACKAGE_VERSION='9.5'
PACKAGE_STRING='Wine 9.5'
PACKAGE_BUGREPORT='wine-devel@winehq.org'
PACKAGE_URL='https://www.winehq.org'
@ -702,6 +702,10 @@ INOTIFY_LIBS
INOTIFY_CFLAGS
PCSCLITE_LIBS
PCAP_LIBS
WAYLAND_EGL_LIBS
WAYLAND_EGL_CFLAGS
EGL_LIBS
EGL_CFLAGS
XKBREGISTRY_LIBS
XKBREGISTRY_CFLAGS
XKBCOMMON_LIBS
@ -929,7 +933,6 @@ with_capi
with_coreaudio
with_cups
with_dbus
with_float_abi
with_fontconfig
with_freetype
with_gettext
@ -1233,6 +1236,7 @@ enable_midimap
enable_mlang
enable_mmcndmgr
enable_mmdevapi
enable_mouhid_sys
enable_mountmgr_sys
enable_mp3dmod
enable_mpr
@ -1493,6 +1497,7 @@ enable_windows_media
enable_windows_networking_hostname
enable_windows_networking
enable_windows_perception_stub
enable_windows_security_authentication_onlineid
enable_windows_security_credentials_ui_userconsentverifier
enable_windows_storage_applicationdata
enable_windows_system_profile_systemmanufacturers
@ -1802,6 +1807,10 @@ XKBCOMMON_CFLAGS
XKBCOMMON_LIBS
XKBREGISTRY_CFLAGS
XKBREGISTRY_LIBS
EGL_CFLAGS
EGL_LIBS
WAYLAND_EGL_CFLAGS
WAYLAND_EGL_LIBS
INOTIFY_CFLAGS
INOTIFY_LIBS
DBUS_CFLAGS
@ -2388,7 +2397,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 9.2 to adapt to many kinds of systems.
\`configure' configures Wine 9.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -2458,7 +2467,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Wine 9.2:";;
short | recursive ) echo "Configuration of Wine 9.5:";;
esac
cat <<\_ACEOF
@ -2487,7 +2496,6 @@ Optional Packages:
--without-coreaudio do not use the CoreAudio sound support
--without-cups do not use CUPS
--without-dbus do not use DBus (dynamic device support)
--with-float-abi=abi specify the ABI (soft|softfp|hard) for ARM platforms
--without-fontconfig do not use fontconfig
--without-freetype do not use the FreeType library
--without-gettext do not use gettext
@ -2629,6 +2637,12 @@ Some influential environment variables:
C compiler flags for xkbregistry, overriding pkg-config
XKBREGISTRY_LIBS
Linker flags for xkbregistry, overriding pkg-config
EGL_CFLAGS C compiler flags for egl, overriding pkg-config
EGL_LIBS Linker flags for egl, overriding pkg-config
WAYLAND_EGL_CFLAGS
C compiler flags for wayland-egl, overriding pkg-config
WAYLAND_EGL_LIBS
Linker flags for wayland-egl, overriding pkg-config
INOTIFY_CFLAGS
C compiler flags for libinotify, overriding pkg-config
INOTIFY_LIBS
@ -2756,7 +2770,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Wine configure 9.2
Wine configure 9.5
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@ -3207,7 +3221,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 9.2, which was
It was created by Wine $as_me 9.5, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@ -4271,13 +4285,6 @@ then :
fi
# Check whether --with-float-abi was given.
if test ${with_float_abi+y}
then :
withval=$with_float_abi;
fi
# Check whether --with-fontconfig was given.
if test ${with_fontconfig+y}
then :
@ -6362,24 +6369,11 @@ printf "%s\n" "$wine_cv_thumb2" >&6; }
if test x"$wine_cv_thumb2" = xyes
then
CFLAGS="$CFLAGS -mthumb"
TARGETFLAGS="$TARGETFLAGS -mthumb"
else
CFLAGS="$CFLAGS -marm"
TARGETFLAGS="$TARGETFLAGS -marm"
fi
case $with_float_abi in
soft|softfp|hard)
float_abi=$with_float_abi ;;
*)
case $host_os in
*eabihf)
float_abi=hard ;;
*)
float_abi=softfp
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5
printf %s "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports floating point instructions" >&5
printf %s "checking whether $CC supports floating point instructions... " >&6; }
if test ${wine_cv_float_abi+y}
then :
printf %s "(cached) " >&6
@ -6406,38 +6400,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_float_abi" >&5
printf "%s\n" "$wine_cv_float_abi" >&6; }
if test $wine_cv_float_abi = no
then
float_abi=soft
as_fn_append wine_warnings "|Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries."
fi
CFLAGS=$saved_CFLAGS
esac
;;
esac
CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi"
test $wine_cv_float_abi != no || as_fn_error $? "The ARM target needs to support floating point instructions." "$LINENO" 5
;;
esac
enable_win16=${enable_win16:-i386}
enable_win64=${enable_win64:-no}
enable_wow64=${enable_wow64:-aarch64,x86_64}
enable_wow64win=${enable_wow64win:-aarch64,x86_64}
enable_wow64cpu=${enable_wow64cpu:-x86_64}
enable_vcruntime140_1=${enable_vcruntime140_1:-x86_64,arm64ec}
enable_cmd=${enable_cmd:-yes}
enable_dllhost=${enable_dllhost:-yes}
enable_dpnsvr=${enable_dpnsvr:-i386,x86_64,arm64ec}
enable_dxdiag=${enable_dxdiag:-yes}
enable_msiexec=${enable_msiexec:-yes}
enable_netsh=${enable_netsh:-yes}
enable_regsvr32=${enable_regsvr32:-yes}
enable_rundll32=${enable_rundll32:-yes}
enable_winetest=${enable_winetest:-$enable_tests}
if test "x$enable_win64" = "xyes"
then
test -z "$with_wine64" || as_fn_error $? "--enable-win64 and --with-wine64 are mutually exclusive.
@ -11521,7 +11487,41 @@ if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
as_fn_append ${wine_arch}_EXTRACFLAGS " -Wabsolute-value"
fi }
{ as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-conversion" | $as_tr_sh`
{ as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-enum-conversion" | $as_tr_sh`
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-enum-conversion" >&5
printf %s "checking whether $CC supports -Wenum-enum-conversion... " >&6; }
if eval test \${$as_ac_var+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -Wenum-enum-conversion"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void *__os_arm64x_dispatch_ret = 0;
int __cdecl mainCRTStartup(void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
eval "$as_ac_var=yes"
else $as_nop
eval "$as_ac_var=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
eval ac_res=\$$as_ac_var
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
:
else $as_nop
{ as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-Wenum-conversion" | $as_tr_sh`
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-conversion" >&5
printf %s "checking whether $CC supports -Wenum-conversion... " >&6; }
if eval test \${$as_ac_var+y}
@ -11555,6 +11555,42 @@ if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
as_fn_append ${wine_arch}_EXTRACFLAGS " -Wenum-conversion"
fi }
fi }
{ as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-flarge-source-files -Wmisleading-indentation" | $as_tr_sh`
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flarge-source-files -Wmisleading-indentation" >&5
printf %s "checking whether $CC supports -flarge-source-files -Wmisleading-indentation... " >&6; }
if eval test \${$as_ac_var+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -flarge-source-files -Wmisleading-indentation"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void *__os_arm64x_dispatch_ret = 0;
int __cdecl mainCRTStartup(void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
eval "$as_ac_var=yes"
else $as_nop
eval "$as_ac_var=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
eval ac_res=\$$as_ac_var
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
as_fn_append ${wine_arch}_EXTRACFLAGS " -Wno-misleading-indentation"
fi }
case $wine_arch in
i386) { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-fno-omit-frame-pointer" | $as_tr_sh`
@ -13570,7 +13606,7 @@ then :
MPG123_PE_LIBS=mpg123
if ${MPG123_PE_CFLAGS:+false} :
then :
MPG123_PE_CFLAGS="-I\$(top_srcdir)/libs/mpg123/src/libmpg123"
MPG123_PE_CFLAGS="-I\$(top_srcdir)/libs/mpg123/src/include"
else $as_nop
enable_mpg123=no
fi
@ -16167,6 +16203,188 @@ fi
CPPFLAGS=$ac_save_CPPFLAGS
if test "x$with_opengl" != "xno"
then
rm -f conftest.err
if ${EGL_CFLAGS:+false} :
then :
if test ${PKG_CONFIG+y}
then :
EGL_CFLAGS=`$PKG_CONFIG --cflags egl 2>conftest.err`
fi
fi
if ${EGL_LIBS:+false} :
then :
if test ${PKG_CONFIG+y}
then :
EGL_LIBS=`$PKG_CONFIG --libs egl 2>/dev/null`
fi
fi
EGL_LIBS=${EGL_LIBS:-"-lEGL"}
printf "%s\n" "$as_me:${as_lineno-$LINENO}: egl cflags: $EGL_CFLAGS" >&5
printf "%s\n" "$as_me:${as_lineno-$LINENO}: egl libs: $EGL_LIBS" >&5
if test -s conftest.err; then
printf %s "$as_me:${as_lineno-$LINENO}: egl errors: " >&5
cat conftest.err >&5
fi
rm -f conftest.err
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $EGL_CFLAGS"
ac_fn_c_check_header_compile "$LINENO" "EGL/egl.h" "ac_cv_header_EGL_egl_h" "$ac_includes_default"
if test "x$ac_cv_header_EGL_egl_h" = xyes
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -lEGL" >&5
printf %s "checking for -lEGL... " >&6; }
if test ${ac_cv_lib_soname_EGL+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_soname_save_LIBS=$LIBS
LIBS="-lEGL $EGL_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char eglGetProcAddress ();
int
main (void)
{
return eglGetProcAddress ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
case "$LIBEXT" in
dll) ac_cv_lib_soname_EGL=`$ac_cv_path_LDD conftest.exe | grep "EGL" | sed -e "s/dll.*/dll/"';2,$d'` ;;
dylib) ac_cv_lib_soname_EGL=`$OTOOL -L conftest$ac_exeext | grep "libEGL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libEGL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_EGL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libEGL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libEGL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'`
if ${ac_cv_lib_soname_EGL:+false} :
then :
ac_cv_lib_soname_EGL=`$LDD conftest$ac_exeext | grep "libEGL\\.$LIBEXT" | sed -e "s/^.*\(libEGL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'`
fi ;;
esac
else $as_nop
ac_cv_lib_soname_EGL=
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_soname_save_LIBS
fi
if ${ac_cv_lib_soname_EGL:+false} :
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5
printf "%s\n" "not found" >&6; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_EGL" >&5
printf "%s\n" "$ac_cv_lib_soname_EGL" >&6; }
printf "%s\n" "#define SONAME_LIBEGL \"$ac_cv_lib_soname_EGL\"" >>confdefs.h
fi
fi
CPPFLAGS=$ac_save_CPPFLAGS
rm -f conftest.err
if ${WAYLAND_EGL_CFLAGS:+false} :
then :
if test ${PKG_CONFIG+y}
then :
WAYLAND_EGL_CFLAGS=`$PKG_CONFIG --cflags wayland-egl 2>conftest.err`
fi
fi
if ${WAYLAND_EGL_LIBS:+false} :
then :
if test ${PKG_CONFIG+y}
then :
WAYLAND_EGL_LIBS=`$PKG_CONFIG --libs wayland-egl 2>/dev/null`
fi
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-egl cflags: $WAYLAND_EGL_CFLAGS" >&5
printf "%s\n" "$as_me:${as_lineno-$LINENO}: wayland-egl libs: $WAYLAND_EGL_LIBS" >&5
if test -s conftest.err; then
printf %s "$as_me:${as_lineno-$LINENO}: wayland-egl errors: " >&5
cat conftest.err >&5
fi
rm -f conftest.err
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $WAYLAND_EGL_CFLAGS"
ac_fn_c_check_header_compile "$LINENO" "wayland-egl.h" "ac_cv_header_wayland_egl_h" "$ac_includes_default"
if test "x$ac_cv_header_wayland_egl_h" = xyes
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wl_egl_window_create in -lwayland-egl" >&5
printf %s "checking for wl_egl_window_create in -lwayland-egl... " >&6; }
if test ${ac_cv_lib_wayland_egl_wl_egl_window_create+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lwayland-egl $WAYLAND_EGL_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char wl_egl_window_create ();
int
main (void)
{
return wl_egl_window_create ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_wayland_egl_wl_egl_window_create=yes
else $as_nop
ac_cv_lib_wayland_egl_wl_egl_window_create=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wayland_egl_wl_egl_window_create" >&5
printf "%s\n" "$ac_cv_lib_wayland_egl_wl_egl_window_create" >&6; }
if test "x$ac_cv_lib_wayland_egl_wl_egl_window_create" = xyes
then :
printf "%s\n" "#define HAVE_LIBWAYLAND_EGL 1" >>confdefs.h
else $as_nop
WAYLAND_EGL_LIBS=""
fi
fi
CPPFLAGS=$ac_save_CPPFLAGS
if test "x$with_wayland" != "x"
then
if test -z "$ac_cv_lib_soname_EGL" -o "$ac_cv_lib_wayland_egl_wl_egl_window_create" != yes
then :
case "x$with_opengl" in
x) as_fn_append wine_notices "|EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL" ;;
xno) ;;
*) as_fn_error $? "EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL
This is an error since --with-opengl was requested." "$LINENO" 5 ;;
esac
fi
fi
fi
fi
if test -z "$WAYLAND_CLIENT_LIBS" -o -z "$WAYLAND_SCANNER" -o -z "$XKBCOMMON_LIBS" -o -z "$XKBREGISTRY_LIBS" -o "$ac_cv_header_linux_input_h" = "no"
then :
@ -18949,6 +19167,7 @@ printf "%s\n" "$ac_cv_lib_soname_MoltenVK" >&6; }
printf "%s\n" "#define SONAME_LIBMOLTENVK \"$ac_cv_lib_soname_MoltenVK\"" >>confdefs.h
printf "%s\n" "#define SONAME_LIBVULKAN \"$ac_cv_lib_soname_MoltenVK\"" >>confdefs.h
fi
fi
@ -19503,6 +19722,35 @@ then :
EXTRACFLAGS="$EXTRACFLAGS -Wwrite-strings"
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -flarge-source-files -Wmisleading-indentation" >&5
printf %s "checking whether the compiler supports -flarge-source-files -Wmisleading-indentation... " >&6; }
if test ${ac_cv_cflags__flarge_source_files__Wmisleading_indentation+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -flarge-source-files -Wmisleading-indentation"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_cflags__flarge_source_files__Wmisleading_indentation=yes
else $as_nop
ac_cv_cflags__flarge_source_files__Wmisleading_indentation=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__flarge_source_files__Wmisleading_indentation" >&5
printf "%s\n" "$ac_cv_cflags__flarge_source_files__Wmisleading_indentation" >&6; }
if test "x$ac_cv_cflags__flarge_source_files__Wmisleading_indentation" = xyes
then :
EXTRACFLAGS="$EXTRACFLAGS -Wno-misleading-indentation"
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wpointer-arith" >&5
printf %s "checking whether the compiler supports -Wpointer-arith... " >&6; }
if test ${ac_cv_cflags__Wpointer_arith+y}
@ -20784,19 +21032,6 @@ printf "%s\n" "#define HAVE_LINUX_GETHOSTBYNAME_R_6 1" >>confdefs.h
fi
ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_accrights" "ac_cv_member_struct_msghdr_msg_accrights" "#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
"
if test "x$ac_cv_member_struct_msghdr_msg_accrights" = xyes
then :
printf "%s\n" "#define HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS 1" >>confdefs.h
fi
ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_len" "ac_cv_member_struct_sockaddr_un_sun_len" "#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
@ -21554,6 +21789,32 @@ fi ;;
esac
enable_win16=${enable_win16:-i386}
enable_vcruntime140_1=${enable_vcruntime140_1:-x86_64,arm64ec}
if test -n "$PE_ARCHS"
then
enable_wow64=${enable_wow64:-aarch64,x86_64}
enable_wow64win=${enable_wow64win:-aarch64,x86_64}
enable_wow64cpu=${enable_wow64cpu:-x86_64}
else
enable_wow64=${enable_wow64:-no}
enable_wow64win=${enable_wow64win:-no}
enable_wow64cpu=${enable_wow64cpu:-no}
fi
enable_cmd=${enable_cmd:-yes}
enable_dllhost=${enable_dllhost:-yes}
enable_dpnsvr=${enable_dpnsvr:-i386,x86_64,arm64ec}
enable_dxdiag=${enable_dxdiag:-yes}
enable_msiexec=${enable_msiexec:-yes}
enable_netsh=${enable_netsh:-yes}
enable_regsvr32=${enable_regsvr32:-yes}
enable_rundll32=${enable_rundll32:-yes}
enable_winetest=${enable_winetest:-$enable_tests}
@ -21975,6 +22236,7 @@ wine_fn_config_makefile dlls/mmdevapi/tests enable_tests
wine_fn_config_makefile dlls/mmdevldr.vxd enable_win16
wine_fn_config_makefile dlls/mmsystem.dll16 enable_win16
wine_fn_config_makefile dlls/monodebg.vxd enable_win16
wine_fn_config_makefile dlls/mouhid.sys enable_mouhid_sys
wine_fn_config_makefile dlls/mountmgr.sys enable_mountmgr_sys
wine_fn_config_makefile dlls/mouse.drv16 enable_win16
wine_fn_config_makefile dlls/mp3dmod enable_mp3dmod
@ -22405,6 +22667,8 @@ wine_fn_config_makefile dlls/windows.networking.hostname/tests enable_tests
wine_fn_config_makefile dlls/windows.networking enable_windows_networking
wine_fn_config_makefile dlls/windows.perception.stub enable_windows_perception_stub
wine_fn_config_makefile dlls/windows.perception.stub/tests enable_tests
wine_fn_config_makefile dlls/windows.security.authentication.onlineid enable_windows_security_authentication_onlineid
wine_fn_config_makefile dlls/windows.security.authentication.onlineid/tests enable_tests
wine_fn_config_makefile dlls/windows.security.credentials.ui.userconsentverifier enable_windows_security_credentials_ui_userconsentverifier
wine_fn_config_makefile dlls/windows.security.credentials.ui.userconsentverifier/tests enable_tests
wine_fn_config_makefile dlls/windows.storage.applicationdata enable_windows_storage_applicationdata
@ -23360,7 +23624,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 9.2, which was
This file was extended by Wine $as_me 9.5, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -23424,7 +23688,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
Wine config.status 9.2
Wine config.status 9.5
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
@ -23765,6 +24029,10 @@ XKBCOMMON_CFLAGS = $XKBCOMMON_CFLAGS
XKBCOMMON_LIBS = $XKBCOMMON_LIBS
XKBREGISTRY_CFLAGS = $XKBREGISTRY_CFLAGS
XKBREGISTRY_LIBS = $XKBREGISTRY_LIBS
EGL_CFLAGS = $EGL_CFLAGS
EGL_LIBS = $EGL_LIBS
WAYLAND_EGL_CFLAGS = $WAYLAND_EGL_CFLAGS
WAYLAND_EGL_LIBS = $WAYLAND_EGL_LIBS
PCAP_LIBS = $PCAP_LIBS
PCSCLITE_LIBS = $PCSCLITE_LIBS
INOTIFY_CFLAGS = $INOTIFY_CFLAGS

View file

@ -29,7 +29,6 @@ AC_ARG_WITH(capi, AS_HELP_STRING([--without-capi],[do not use CAPI (ISDN su
AC_ARG_WITH(coreaudio, AS_HELP_STRING([--without-coreaudio],[do not use the CoreAudio sound support]))
AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS]))
AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)]))
AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms]))
AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]))
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext]))
@ -146,58 +145,15 @@ case $host in
if test x"$wine_cv_thumb2" = xyes
then
CFLAGS="$CFLAGS -mthumb"
TARGETFLAGS="$TARGETFLAGS -mthumb"
else
CFLAGS="$CFLAGS -marm"
TARGETFLAGS="$TARGETFLAGS -marm"
fi
case $with_float_abi in
soft|softfp|hard)
float_abi=$with_float_abi ;;
*)
case $host_os in
*eabihf)
float_abi=hard ;;
*)
float_abi=softfp
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
AC_CACHE_CHECK([whether $CC supports -mfloat-abi=$float_abi],wine_cv_float_abi,
[WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,[wine_cv_float_abi=yes],[wine_cv_float_abi=no])])
if test $wine_cv_float_abi = no
then
float_abi=soft
WINE_WARNING([Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries.])
fi
CFLAGS=$saved_CFLAGS
esac
;;
esac
CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi"
AC_CACHE_CHECK([whether $CC supports floating point instructions],wine_cv_float_abi,
[WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,[wine_cv_float_abi=yes],[wine_cv_float_abi=no])])
test $wine_cv_float_abi != no || AC_MSG_ERROR([The ARM target needs to support floating point instructions.])
;;
esac
enable_win16=${enable_win16:-i386}
enable_win64=${enable_win64:-no}
enable_wow64=${enable_wow64:-aarch64,x86_64}
enable_wow64win=${enable_wow64win:-aarch64,x86_64}
enable_wow64cpu=${enable_wow64cpu:-x86_64}
enable_vcruntime140_1=${enable_vcruntime140_1:-x86_64,arm64ec}
dnl Explicitly enable some programs for arm64ec
enable_cmd=${enable_cmd:-yes}
enable_dllhost=${enable_dllhost:-yes}
enable_dpnsvr=${enable_dpnsvr:-i386,x86_64,arm64ec}
enable_dxdiag=${enable_dxdiag:-yes}
enable_msiexec=${enable_msiexec:-yes}
enable_netsh=${enable_netsh:-yes}
enable_regsvr32=${enable_regsvr32:-yes}
enable_rundll32=${enable_rundll32:-yes}
dnl Disable winetest too if tests are disabled
enable_winetest=${enable_winetest:-$enable_tests}
dnl Some special cases for the 64-bit build
if test "x$enable_win64" = "xyes"
then
@ -990,7 +946,10 @@ This is an error since --enable-archs=$wine_arch was requested.])])
WINE_TRY_PE_CFLAGS([-Wpointer-arith])
WINE_TRY_PE_CFLAGS([-Wlogical-op])
WINE_TRY_PE_CFLAGS([-Wabsolute-value])
WINE_TRY_PE_CFLAGS([-Wenum-conversion])
WINE_TRY_PE_CFLAGS([-Wenum-enum-conversion],[:],WINE_TRY_PE_CFLAGS([-Wenum-conversion]))
dnl GCC can't handle large files when -Wmisleading-indentation is enabled (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549)
WINE_TRY_PE_CFLAGS([-flarge-source-files -Wmisleading-indentation],[AS_VAR_APPEND(${wine_arch}_EXTRACFLAGS,[" -Wno-misleading-indentation"])])
case $wine_arch in
i386) WINE_TRY_PE_CFLAGS([-fno-omit-frame-pointer])
@ -1186,7 +1145,7 @@ WINE_EXTLIB_FLAGS(JPEG, jpeg, jpeg, "-I\$(top_srcdir)/libs/jpeg")
WINE_EXTLIB_FLAGS(JXR, jxr, jxr, "-I\$(top_srcdir)/libs/jxr/jxrgluelib -I\$(top_srcdir)/libs/jxr/image/sys")
WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I\$(top_srcdir)/libs/lcms2/include")
WINE_EXTLIB_FLAGS(LDAP, ldap, ldap, "-I\$(top_srcdir)/libs/ldap/include")
WINE_EXTLIB_FLAGS(MPG123, mpg123, mpg123, "-I\$(top_srcdir)/libs/mpg123/src/libmpg123")
WINE_EXTLIB_FLAGS(MPG123, mpg123, mpg123, "-I\$(top_srcdir)/libs/mpg123/src/include")
WINE_EXTLIB_FLAGS(MUSL, musl, musl)
WINE_EXTLIB_FLAGS(PNG, png, "png \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/png")
WINE_EXTLIB_FLAGS(TIFF, tiff, "tiff \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/tiff/libtiff")
@ -1401,6 +1360,22 @@ then
WINE_PACKAGE_FLAGS(XKBREGISTRY,[xkbregistry],,,,
[AC_CHECK_HEADERS([xkbcommon/xkbregistry.h])
AC_CHECK_LIB(xkbregistry,rxkb_context_new,[:],[XKBREGISTRY_LIBS=""],[$XKBREGISTRY_LIBS])])
if test "x$with_opengl" != "xno"
then
WINE_PACKAGE_FLAGS(EGL,[egl],[-lEGL],,,
[AC_CHECK_HEADER([EGL/egl.h],
[WINE_CHECK_SONAME(EGL,eglGetProcAddress,,,[$EGL_LIBS])])])
WINE_PACKAGE_FLAGS(WAYLAND_EGL,[wayland-egl],,,,
[AC_CHECK_HEADER([wayland-egl.h],
[AC_CHECK_LIB(wayland-egl,wl_egl_window_create,
[AC_DEFINE(HAVE_LIBWAYLAND_EGL, 1, [Define if we have the wayland-egl development environment])],
[WAYLAND_EGL_LIBS=""],[$WAYLAND_EGL_LIBS])])])
if test "x$with_wayland" != "x"
then
WINE_NOTICE_WITH(opengl, [test -z "$ac_cv_lib_soname_EGL" -o "$ac_cv_lib_wayland_egl_wl_egl_window_create" != yes],
[EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL])
fi
fi
fi
WINE_NOTICE_WITH(wayland, [test -z "$WAYLAND_CLIENT_LIBS" -o -z "$WAYLAND_SCANNER" -o -z "$XKBCOMMON_LIBS" -o -z "$XKBREGISTRY_LIBS" -o "$ac_cv_header_linux_input_h" = "no"],
[Wayland ${notice_platform}development files not found, the Wayland driver won't be supported.],
@ -1852,7 +1827,7 @@ then
WINE_CHECK_SONAME(vulkan, vkGetInstanceProcAddr)
if test "x$ac_cv_lib_soname_vulkan" = "x"
then
WINE_CHECK_SONAME(MoltenVK, vkGetInstanceProcAddr)
WINE_CHECK_SONAME(MoltenVK, vkGetInstanceProcAddr, [AC_DEFINE_UNQUOTED(SONAME_LIBVULKAN,["$ac_cv_lib_soname_MoltenVK"])])
fi
fi
WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x"],
@ -1887,6 +1862,9 @@ then
WINE_TRY_CFLAGS([-Wvla])
WINE_TRY_CFLAGS([-Wwrite-strings])
dnl GCC can't handle large files when -Wmisleading-indentation is enabled (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549)
WINE_TRY_CFLAGS([-flarge-source-files -Wmisleading-indentation],[EXTRACFLAGS="$EXTRACFLAGS -Wno-misleading-indentation"])
dnl Check for noisy string.h
WINE_TRY_CFLAGS([-Wpointer-arith],
[saved_string_h_CFLAGS=$CFLAGS
@ -2165,7 +2143,7 @@ AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
fi
dnl Check for socket structure members
AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr_un.sun_len],,,
AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,,
[#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
@ -2373,6 +2351,35 @@ case $host_vendor in
*sun*) WINE_CHECK_DEFINE([__sun__]) ;;
esac
dnl *** Check for modules to disable by default
enable_win16=${enable_win16:-i386}
enable_vcruntime140_1=${enable_vcruntime140_1:-x86_64,arm64ec}
if test -n "$PE_ARCHS"
then
enable_wow64=${enable_wow64:-aarch64,x86_64}
enable_wow64win=${enable_wow64win:-aarch64,x86_64}
enable_wow64cpu=${enable_wow64cpu:-x86_64}
else
enable_wow64=${enable_wow64:-no}
enable_wow64win=${enable_wow64win:-no}
enable_wow64cpu=${enable_wow64cpu:-no}
fi
dnl Explicitly enable some programs for arm64ec
enable_cmd=${enable_cmd:-yes}
enable_dllhost=${enable_dllhost:-yes}
enable_dpnsvr=${enable_dpnsvr:-i386,x86_64,arm64ec}
enable_dxdiag=${enable_dxdiag:-yes}
enable_msiexec=${enable_msiexec:-yes}
enable_netsh=${enable_netsh:-yes}
enable_regsvr32=${enable_regsvr32:-yes}
enable_rundll32=${enable_rundll32:-yes}
dnl Disable winetest too if tests are disabled
enable_winetest=${enable_winetest:-$enable_tests}
dnl **** Generate output files ****
AH_TOP([#ifndef __WINE_CONFIG_H
@ -2792,6 +2799,7 @@ WINE_CONFIG_MAKEFILE(dlls/mmdevapi/tests)
WINE_CONFIG_MAKEFILE(dlls/mmdevldr.vxd,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/mmsystem.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/monodebg.vxd,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/mouhid.sys)
WINE_CONFIG_MAKEFILE(dlls/mountmgr.sys)
WINE_CONFIG_MAKEFILE(dlls/mouse.drv16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/mp3dmod)
@ -3222,6 +3230,8 @@ WINE_CONFIG_MAKEFILE(dlls/windows.networking.hostname/tests)
WINE_CONFIG_MAKEFILE(dlls/windows.networking)
WINE_CONFIG_MAKEFILE(dlls/windows.perception.stub)
WINE_CONFIG_MAKEFILE(dlls/windows.perception.stub/tests)
WINE_CONFIG_MAKEFILE(dlls/windows.security.authentication.onlineid)
WINE_CONFIG_MAKEFILE(dlls/windows.security.authentication.onlineid/tests)
WINE_CONFIG_MAKEFILE(dlls/windows.security.credentials.ui.userconsentverifier)
WINE_CONFIG_MAKEFILE(dlls/windows.security.credentials.ui.userconsentverifier/tests)
WINE_CONFIG_MAKEFILE(dlls/windows.storage.applicationdata)

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -7,4 +7,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -27,4 +27,4 @@
threading(both),
uuid(b8da6310-e19b-11d0-933c-00a0c90dcaa9) /* IActiveScriptStats */
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

View file

@ -70,6 +70,9 @@ LSTATUS WINAPI RegOverridePredefKey( HKEY hkey, HKEY override )
*/
LSTATUS WINAPI RegCreateKeyW( HKEY hkey, LPCWSTR lpSubKey, PHKEY phkResult )
{
if (!phkResult)
return ERROR_INVALID_PARAMETER;
return RegCreateKeyExW( hkey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE,
MAXIMUM_ALLOWED, NULL, phkResult, NULL );
}
@ -82,6 +85,9 @@ LSTATUS WINAPI RegCreateKeyW( HKEY hkey, LPCWSTR lpSubKey, PHKEY phkResult )
*/
LSTATUS WINAPI RegCreateKeyA( HKEY hkey, LPCSTR lpSubKey, PHKEY phkResult )
{
if (!phkResult)
return ERROR_INVALID_PARAMETER;
return RegCreateKeyExA( hkey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE,
MAXIMUM_ALLOWED, NULL, phkResult, NULL );
}

View file

@ -1260,10 +1260,10 @@ static void test_container_sd(void)
ok(err == ERROR_INSUFFICIENT_BUFFER || broken(err == ERROR_INVALID_PARAMETER), "got %lu\n", err);
ok(len, "expected len > 0\n");
sd = HeapAlloc(GetProcessHeap(), 0, len);
sd = malloc(len);
ret = CryptGetProvParam(prov, PP_KEYSET_SEC_DESCR, (BYTE *)sd, &len, OWNER_SECURITY_INFORMATION);
ok(ret, "got %lu\n", GetLastError());
HeapFree(GetProcessHeap(), 0, sd);
free(sd);
ret = CryptReleaseContext(prov, 0);
ok(ret, "got %lu\n", GetLastError());

View file

@ -445,14 +445,14 @@ static void test_read(void)
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD));
buf = malloc(sizeof(EVENTLOGRECORD));
SetLastError(0xdeadbeef);
ret = ReadEventLogA(NULL, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_FORWARDS_READ,
0, buf, sizeof(EVENTLOGRECORD), &read, &needed);
ok(!ret, "Expected failure\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, buf);
free(buf);
handle = OpenEventLogA(NULL, "Application");
if (!handle && (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == RPC_S_SERVER_UNAVAILABLE))
@ -463,7 +463,7 @@ static void test_read(void)
ok(handle != NULL, "OpenEventLogA(Application) failed : %ld\n", GetLastError());
/* Show that we need the proper dwFlags with a (for the rest) proper call */
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD));
buf = malloc(sizeof(EVENTLOGRECORD));
SetLastError(0xdeadbeef);
ret = ReadEventLogA(handle, 0, 0, buf, sizeof(EVENTLOGRECORD), &read, &needed);
@ -504,7 +504,7 @@ static void test_read(void)
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, buf);
free(buf);
/* First check if there are any records (in practice only on Wine: FIXME) */
count = 0;
@ -517,7 +517,7 @@ static void test_read(void)
}
/* Get the buffer size for the first record */
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD));
buf = malloc(sizeof(EVENTLOGRECORD));
read = needed = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = ReadEventLogA(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_FORWARDS_READ,
@ -529,7 +529,7 @@ static void test_read(void)
/* Read the first record */
toread = needed;
buf = HeapReAlloc(GetProcessHeap(), 0, buf, toread);
buf = realloc(buf, toread);
read = needed = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = ReadEventLogA(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_FORWARDS_READ, 0, buf, toread, &read, &needed);
@ -538,7 +538,7 @@ static void test_read(void)
broken(read < toread), /* NT4 wants a buffer size way bigger than just 1 record */
"Expected the requested size to be read\n");
ok(needed == 0, "Expected no extra bytes to be read\n");
HeapFree(GetProcessHeap(), 0, buf);
free(buf);
CloseEventLog(handle);
}
@ -785,7 +785,7 @@ static void test_readwrite(void)
if (pCreateWellKnownSid)
{
sidsize = SECURITY_MAX_SID_SIZE;
user = HeapAlloc(GetProcessHeap(), 0, sidsize);
user = malloc(sidsize);
SetLastError(0xdeadbeef);
pCreateWellKnownSid(WinInteractiveSid, NULL, user, &sidsize);
sidavailable = TRUE;
@ -846,12 +846,12 @@ static void test_readwrite(void)
ok(ret, "Expected success : %ld\n", GetLastError());
/* Needed to catch earlier Vista (with no ServicePack for example) */
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENTLOGRECORD));
buf = malloc(sizeof(EVENTLOGRECORD));
if (!(ret = ReadEventLogA(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_FORWARDS_READ,
0, buf, sizeof(EVENTLOGRECORD), &read, &needed)) &&
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
buf = HeapReAlloc(GetProcessHeap(), 0, buf, needed);
buf = realloc(buf, needed);
ret = ReadEventLogA(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_FORWARDS_READ,
0, buf, needed, &read, &needed);
}
@ -865,7 +865,7 @@ static void test_readwrite(void)
if (record->EventType == EVENTLOG_SUCCESS)
on_vista = TRUE;
}
HeapFree(GetProcessHeap(), 0, buf);
free(buf);
}
/* This will clear the eventlog. The record numbering for new
@ -949,13 +949,13 @@ static void test_readwrite(void)
size = 0;
SetLastError(0xdeadbeef);
pGetComputerNameExA(ComputerNameDnsFullyQualified, NULL, &size);
localcomputer = HeapAlloc(GetProcessHeap(), 0, size);
localcomputer = malloc(size);
pGetComputerNameExA(ComputerNameDnsFullyQualified, localcomputer, &size);
}
else
{
size = MAX_COMPUTERNAME_LENGTH + 1;
localcomputer = HeapAlloc(GetProcessHeap(), 0, size);
localcomputer = malloc(size);
GetComputerNameA(localcomputer, &size);
}
@ -964,7 +964,7 @@ static void test_readwrite(void)
ok(handle != NULL, "OpenEventLogA(%s) failed : %ld\n", eventlogname, GetLastError());
i = 0;
size = sizeof(EVENTLOGRECORD) + 128;
buf = HeapAlloc(GetProcessHeap(), 0, size);
buf = malloc(size);
for (;;)
{
DWORD read, needed;
@ -989,9 +989,9 @@ static void test_readwrite(void)
if (needed > size)
{
HeapFree(GetProcessHeap(), 0, buf);
free(buf);
size = needed;
buf = HeapAlloc(GetProcessHeap(), 0, size);
buf = malloc(size);
}
ret = ReadEventLogA(handle, EVENTLOG_SEQUENTIAL_READ | EVENTLOG_FORWARDS_READ,
0, buf, needed, &read, &needed);
@ -1069,7 +1069,7 @@ static void test_readwrite(void)
winetest_pop_context();
i++;
}
HeapFree(GetProcessHeap(), 0, buf);
free(buf);
CloseEventLog(handle);
/* Test clearing a real eventlog */
@ -1088,8 +1088,8 @@ static void test_readwrite(void)
CloseEventLog(handle);
cleanup:
HeapFree(GetProcessHeap(), 0, localcomputer);
HeapFree(GetProcessHeap(), 0, user);
free(localcomputer);
free(user);
}
/* Before Vista:
@ -1240,7 +1240,7 @@ static void test_start_trace(void)
LONG ret;
buffersize = sizeof(EVENT_TRACE_PROPERTIES) + sizeof(sessionname) + sizeof(filepath);
properties = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buffersize);
properties = calloc(1, buffersize);
properties->Wnode.BufferSize = buffersize;
properties->Wnode.Flags = WNODE_FLAG_TRACED_GUID;
properties->LogFileMode = EVENT_TRACE_FILE_MODE_NONE;
@ -1317,7 +1317,7 @@ static void test_start_trace(void)
/* clean up */
ControlTraceA(handle, sessionname, properties, EVENT_TRACE_CONTROL_STOP);
done:
HeapFree(GetProcessHeap(), 0, properties);
free(properties);
DeleteFileA(filepath);
}

View file

@ -243,15 +243,15 @@ static void test_LsaLookupNames2(void)
return;
}
name[0].Buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(n1));
name[0].Buffer = malloc(sizeof(n1));
name[0].Length = name[0].MaximumLength = sizeof(n1);
memcpy(name[0].Buffer, n1, sizeof(n1));
name[1].Buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(n1));
name[1].Buffer = malloc(sizeof(n1));
name[1].Length = name[1].MaximumLength = sizeof(n1) - sizeof(WCHAR);
memcpy(name[1].Buffer, n1, sizeof(n1) - sizeof(WCHAR));
name[2].Buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(n2));
name[2].Buffer = malloc(sizeof(n2));
name[2].Length = name[2].MaximumLength = sizeof(n2);
memcpy(name[2].Buffer, n2, sizeof(n2));
@ -307,9 +307,9 @@ static void test_LsaLookupNames2(void)
LsaFreeMemory(sids);
LsaFreeMemory(domains);
HeapFree(GetProcessHeap(), 0, name[0].Buffer);
HeapFree(GetProcessHeap(), 0, name[1].Buffer);
HeapFree(GetProcessHeap(), 0, name[2].Buffer);
free(name[0].Buffer);
free(name[1].Buffer);
free(name[2].Buffer);
status = LsaClose(handle);
ok(status == STATUS_SUCCESS, "LsaClose() failed, returned 0x%08lx\n", status);

View file

@ -195,7 +195,7 @@ static void _test_hkey_main_Value_A(int line, LPCSTR name, LPCSTR string,
lok(type == REG_SZ, "RegQueryValueExA/1 returned type %ld\n", type);
lok(cbData == full_byte_len, "cbData=%ld instead of %ld or %ld\n", cbData, full_byte_len, str_byte_len);
value = HeapAlloc(GetProcessHeap(), 0, cbData+1);
value = malloc(cbData+1);
memset(value, 0xbd, cbData+1);
type=0xdeadbeef;
ret = RegQueryValueExA(hkey_main, name, NULL, &type, value, &cbData);
@ -213,7 +213,7 @@ static void _test_hkey_main_Value_A(int line, LPCSTR name, LPCSTR string,
debugstr_an(string, full_byte_len), full_byte_len);
lok(*(value+cbData) == 0xbd, "RegQueryValueExA/2 overflowed at offset %lu: %02x != bd\n", cbData, *(value+cbData));
}
HeapFree(GetProcessHeap(), 0, value);
free(value);
}
#define test_hkey_main_Value_W(name, string, full_byte_len) _test_hkey_main_Value_W(__LINE__, name, string, full_byte_len)
@ -243,7 +243,7 @@ static void _test_hkey_main_Value_W(int line, LPCWSTR name, LPCWSTR string,
"cbData=%ld instead of %ld\n", cbData, full_byte_len);
/* Give enough space to overflow by one WCHAR */
value = HeapAlloc(GetProcessHeap(), 0, cbData+2);
value = malloc(cbData+2);
memset(value, 0xbd, cbData+2);
type=0xdeadbeef;
ret = RegQueryValueExW(hkey_main, name, NULL, &type, value, &cbData);
@ -258,7 +258,7 @@ static void _test_hkey_main_Value_W(int line, LPCWSTR name, LPCWSTR string,
/* This implies that when cbData == 0, RegQueryValueExW() should not modify the buffer */
lok(*(value+cbData) == 0xbd, "RegQueryValueExW/2 overflowed at %lu: %02x != bd\n", cbData, *(value+cbData));
lok(*(value+cbData+1) == 0xbd, "RegQueryValueExW/2 overflowed at %lu+1: %02x != bd\n", cbData, *(value+cbData+1));
HeapFree(GetProcessHeap(), 0, value);
free(value);
}
static void test_set_value(void)
@ -1218,7 +1218,7 @@ static void test_reg_open_key(void)
ok(ret == ERROR_SUCCESS,
"Expected SetEntriesInAclA to return ERROR_SUCCESS, got %lu, last error %lu\n", ret, GetLastError());
sd = HeapAlloc(GetProcessHeap(), 0, SECURITY_DESCRIPTOR_MIN_LENGTH);
sd = malloc(SECURITY_DESCRIPTOR_MIN_LENGTH);
bRet = InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION);
ok(bRet == TRUE,
"Expected InitializeSecurityDescriptor to return TRUE, got %d, last error %lu\n", bRet, GetLastError());
@ -1256,7 +1256,7 @@ static void test_reg_open_key(void)
RegCloseKey(hkResult);
}
HeapFree(GetProcessHeap(), 0, sd);
free(sd);
LocalFree(key_acl);
FreeSid(world_sid);
RegDeleteKeyA(hkRoot64, "");
@ -1279,6 +1279,19 @@ static void test_reg_create_key(void)
PACL key_acl;
SECURITY_DESCRIPTOR *sd;
/* NULL return key check */
ret = RegCreateKeyA(hkey_main, "Subkey1", NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyW(hkey_main, L"Subkey1", NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, NULL, NULL);
ok(ret == ERROR_BADKEY, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyExW(hkey_main, L"Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, NULL, NULL);
ok(ret == ERROR_BADKEY, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
ok(!ret, "RegCreateKeyExA failed with error %ld\n", ret);
/* should succeed: all versions of Windows ignore the access rights
@ -1380,7 +1393,7 @@ static void test_reg_create_key(void)
ok(dwRet == ERROR_SUCCESS,
"Expected SetEntriesInAclA to return ERROR_SUCCESS, got %lu, last error %lu\n", dwRet, GetLastError());
sd = HeapAlloc(GetProcessHeap(), 0, SECURITY_DESCRIPTOR_MIN_LENGTH);
sd = malloc(SECURITY_DESCRIPTOR_MIN_LENGTH);
bRet = InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION);
ok(bRet == TRUE,
"Expected InitializeSecurityDescriptor to return TRUE, got %d, last error %lu\n", bRet, GetLastError());
@ -1418,7 +1431,7 @@ static void test_reg_create_key(void)
RegCloseKey(hkey1);
}
HeapFree(GetProcessHeap(), 0, sd);
free(sd);
LocalFree(key_acl);
FreeSid(world_sid);
RegDeleteKeyA(hkRoot64, "");
@ -1529,62 +1542,68 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set)
return TRUE;
}
static void test_reg_save_key(void)
static void delete_dir(const char *path)
{
DWORD ret;
char file[2 * MAX_PATH], *p;
WIN32_FIND_DATAA fd;
HANDLE hfind;
BOOL r;
if (!set_privileges(SE_BACKUP_NAME, TRUE) ||
!set_privileges(SE_RESTORE_NAME, FALSE))
strcpy(file, path);
p = file + strlen(file);
p[0] = '\\';
p[1] = '*';
p[2] = 0;
hfind = FindFirstFileA(file, &fd);
if (hfind != INVALID_HANDLE_VALUE)
{
win_skip("Failed to set SE_BACKUP_NAME privileges, skipping tests\n");
return;
do
{
if (!strcmp(fd.cFileName, ".") || !strcmp(fd.cFileName, ".."))
continue;
strcpy(p + 1, fd.cFileName);
r = DeleteFileA(file);
ok(r, "DeleteFile failed on %s: %ld\n", debugstr_a(file), GetLastError());
} while(FindNextFileA(hfind, &fd));
FindClose(hfind);
}
ret = RegSaveKeyA(hkey_main, "saved_key", NULL);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
set_privileges(SE_BACKUP_NAME, FALSE);
r = RemoveDirectoryA(path);
ok(r, "RemoveDirectory failed: %ld\n", GetLastError());
}
static void test_reg_load_key(void)
{
DWORD ret;
HKEY hkHandle;
if (!set_privileges(SE_RESTORE_NAME, TRUE) ||
!set_privileges(SE_BACKUP_NAME, FALSE))
{
win_skip("Failed to set SE_RESTORE_NAME privileges, skipping tests\n");
return;
}
ret = RegLoadKeyA(HKEY_LOCAL_MACHINE, "Test", "saved_key");
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
set_privileges(SE_RESTORE_NAME, FALSE);
ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, "Test", &hkHandle);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
RegCloseKey(hkHandle);
}
static void test_reg_unload_key(void)
{
char saved_key[2 * MAX_PATH], buf[16], *p;
UNICODE_STRING key_name;
OBJECT_ATTRIBUTES attr;
NTSTATUS status;
DWORD ret;
DWORD ret, size;
HKEY key;
if (!set_privileges(SE_RESTORE_NAME, TRUE) ||
!set_privileges(SE_BACKUP_NAME, FALSE))
!set_privileges(SE_BACKUP_NAME, TRUE))
{
win_skip("Failed to set SE_RESTORE_NAME privileges, skipping tests\n");
return;
}
ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Test", 0, KEY_READ, &key);
GetTempPathA(MAX_PATH, saved_key);
strcat(saved_key, "\\wine_reg_test");
CreateDirectoryA(saved_key, NULL);
strcat(saved_key, "\\saved_key");
ret = RegSaveKeyA(hkey_main, saved_key, NULL);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
ret = RegLoadKeyA(HKEY_LOCAL_MACHINE, "Test", saved_key);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, "Test", &key);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
ret = RegSetValueExA(key, "test", 0, REG_SZ, (BYTE *)"value", 6);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
/* try to unload though the key handle is live */
@ -1598,6 +1617,27 @@ static void test_reg_unload_key(void)
ret = RegUnLoadKeyA(HKEY_LOCAL_MACHINE, "Test");
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
/* check if modifications are saved */
ret = RegLoadKeyA(HKEY_LOCAL_MACHINE, "Test", saved_key);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, "Test", &key);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
size = sizeof(buf);
ret = RegGetValueA(key, NULL, "test", RRF_RT_REG_SZ, NULL, buf, &size);
todo_wine ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
if (ret == ERROR_SUCCESS)
{
ok(size == 6, "size = %ld\n", size);
ok(!strcmp(buf, "value"), "buf = %s\n", buf);
}
RegCloseKey(key);
ret = RegUnLoadKeyA(HKEY_LOCAL_MACHINE, "Test");
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
pRtlInitUnicodeString(&key_name, L"\\REGISTRY\\User\\.Default");
InitializeObjectAttributes(&attr, &key_name, OBJ_CASE_INSENSITIVE, NULL, NULL);
status = pNtUnloadKey(&attr);
@ -1607,9 +1647,11 @@ static void test_reg_unload_key(void)
ok(ret == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %ld\n", ret);
set_privileges(SE_RESTORE_NAME, FALSE);
set_privileges(SE_BACKUP_NAME, FALSE);
DeleteFileA("saved_key");
DeleteFileA("saved_key.LOG");
p = strrchr(saved_key, '\\');
*p = 0;
delete_dir(saved_key);
}
/* Helper function to wait for a file blocked by the registry to be available */
@ -1631,31 +1673,26 @@ static void wait_file_available(char *path)
static void test_reg_load_app_key(void)
{
DWORD ret, size;
char temppath[MAX_PATH], hivefilepath[MAX_PATH];
char hivefilepath[2 * MAX_PATH], *p;
const BYTE test_data[] = "Hello World";
BYTE output[sizeof(test_data)];
HKEY appkey = NULL;
GetTempPathA(sizeof(temppath), temppath);
GetTempFileNameA(temppath, "key", 0, hivefilepath);
DeleteFileA(hivefilepath);
if (!set_privileges(SE_BACKUP_NAME, TRUE) ||
!set_privileges(SE_RESTORE_NAME, FALSE))
if (!set_privileges(SE_BACKUP_NAME, TRUE))
{
win_skip("Failed to set SE_BACKUP_NAME privileges, skipping tests\n");
return;
}
GetTempPathA(MAX_PATH, hivefilepath);
strcat(hivefilepath, "\\wine_reg_test");
CreateDirectoryA(hivefilepath, NULL);
strcat(hivefilepath, "\\saved_key");
ret = RegSaveKeyA(hkey_main, hivefilepath, NULL);
if (ret != ERROR_SUCCESS)
{
win_skip("Failed to save test key 0x%lx\n", ret);
return;
}
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
set_privileges(SE_BACKUP_NAME, FALSE);
set_privileges(SE_RESTORE_NAME, FALSE);
/* Test simple key load */
/* Check if the changes are saved */
@ -1684,8 +1721,10 @@ static void test_reg_load_app_key(void)
RegCloseKey(appkey);
wait_file_available(hivefilepath);
ret = DeleteFileA(hivefilepath);
ok(ret, "couldn't delete hive file %ld\n", GetLastError());
p = strrchr(hivefilepath, '\\');
*p = 0;
delete_dir(hivefilepath);
}
/* tests that show that RegConnectRegistry and
@ -2425,7 +2464,7 @@ static void test_symlinks(void)
pRtlFormatCurrentUserKeyPath( &target_str );
target_len = target_str.Length + sizeof(targetW);
target = HeapAlloc( GetProcessHeap(), 0, target_len );
target = malloc( target_len );
memcpy( target, target_str.Buffer, target_str.Length );
memcpy( target + target_str.Length/sizeof(WCHAR), targetW, sizeof(targetW) );
@ -2530,7 +2569,7 @@ static void test_symlinks(void)
ok( !status, "NtDeleteKey failed: 0x%08lx\n", status );
RegCloseKey( link );
HeapFree( GetProcessHeap(), 0, target );
free( target );
pRtlFreeUnicodeString( &target_str );
}
@ -2778,6 +2817,28 @@ static void test_redirection(void)
RegCloseKey( root32 );
RegCloseKey( root64 );
err = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\WOW6432Node\\test1\\test2", 0, NULL, 0,
KEY_WRITE | KEY_WOW64_32KEY, NULL, &key, NULL );
ok(!err, "got %#lx.\n", err);
RegCloseKey(key);
err = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\test1\\test2", 0, NULL, 0, KEY_WRITE | KEY_WOW64_32KEY,
NULL, &key, NULL );
ok(!err, "got %#lx.\n", err);
RegCloseKey(key);
err = RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\test1\\test2", 0, KEY_WRITE | KEY_WOW64_32KEY, &key );
ok(!err, "got %#lx.\n", err);
RegCloseKey(key);
if (pRegDeleteTreeA)
{
err = pRegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\test1");
ok(!err, "got %#lx.\n", err);
err = pRegDeleteTreeA(HKEY_LOCAL_MACHINE, "Software\\test1");
ok(err == ERROR_FILE_NOT_FOUND, "got %#lx.\n", err);
}
/* Software\Classes is shared/reflected so behavior is different */
err = RegCreateKeyExA( HKEY_LOCAL_MACHINE, "Software\\Classes\\Wine",
@ -4951,9 +5012,7 @@ START_TEST(registry)
test_classesroot();
test_classesroot_enum();
test_classesroot_mask();
test_reg_save_key();
test_reg_load_key();
test_reg_unload_key();
test_reg_load_app_key();
test_reg_copy_tree();
test_reg_delete_tree();

File diff suppressed because it is too large Load diff

View file

@ -1000,14 +1000,14 @@ static void test_query_svc(void)
}
/* Pass a correct buffer and buffersize but a NULL handle */
statusproc = HeapAlloc(GetProcessHeap(), 0, sizeof(SERVICE_STATUS_PROCESS));
statusproc = malloc(sizeof(SERVICE_STATUS_PROCESS));
bufsize = needed;
SetLastError(0xdeadbeef);
ret = pQueryServiceStatusEx(NULL, SC_STATUS_PROCESS_INFO, (BYTE*)statusproc, bufsize, &needed);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, statusproc);
free(statusproc);
/* Correct handle and info level */
SetLastError(0xdeadbeef);
@ -1023,21 +1023,21 @@ static void test_query_svc(void)
}
/* All parameters are OK but we don't have enough rights */
statusproc = HeapAlloc(GetProcessHeap(), 0, sizeof(SERVICE_STATUS_PROCESS));
statusproc = malloc(sizeof(SERVICE_STATUS_PROCESS));
bufsize = sizeof(SERVICE_STATUS_PROCESS);
SetLastError(0xdeadbeef);
ret = pQueryServiceStatusEx(svc_handle, SC_STATUS_PROCESS_INFO, (BYTE*)statusproc, bufsize, &needed);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_ACCESS_DENIED,
"Expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, statusproc);
free(statusproc);
/* Open the service with just enough rights. */
CloseServiceHandle(svc_handle);
svc_handle = OpenServiceA(scm_handle, spooler, SERVICE_QUERY_STATUS);
/* Everything should be fine now. */
statusproc = HeapAlloc(GetProcessHeap(), 0, sizeof(SERVICE_STATUS_PROCESS));
statusproc = malloc(sizeof(SERVICE_STATUS_PROCESS));
bufsize = sizeof(SERVICE_STATUS_PROCESS);
SetLastError(0xdeadbeef);
ret = pQueryServiceStatusEx(svc_handle, SC_STATUS_PROCESS_INFO, (BYTE*)statusproc, bufsize, &needed);
@ -1056,7 +1056,7 @@ static void test_query_svc(void)
ok(broken(GetLastError() == ERROR_INVALID_PARAMETER) /* NT4 */ ||
GetLastError() == ERROR_INVALID_ADDRESS, "got %ld\n", GetLastError());
HeapFree(GetProcessHeap(), 0, statusproc);
free(statusproc);
CloseServiceHandle(svc_handle);
CloseServiceHandle(scm_handle);
@ -1274,14 +1274,14 @@ static BOOL test_enum_svc(int attempt)
tempneeded = needed;
/* Allocate the correct needed bytes */
services = HeapAlloc(GetProcessHeap(), 0, needed);
services = malloc(needed);
bufsize = needed;
needed = 0xdeadbeef;
returned = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
services, bufsize, &needed, &returned, NULL);
HeapFree(GetProcessHeap(), 0, services);
free(services);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
ok(ret, "Expected success, got error %lu\n", GetLastError());
@ -1291,14 +1291,14 @@ static BOOL test_enum_svc(int attempt)
/* Store the number of returned services */
tempreturned = returned;
servicesA = HeapAlloc(GetProcessHeap(), 0, neededA);
servicesA = malloc(neededA);
bufsize = neededA;
neededA = 0xdeadbeef;
returnedA = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = EnumServicesStatusA(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
servicesA, bufsize, &neededA, &returnedA, NULL);
HeapFree(GetProcessHeap(), 0, servicesA);
free(servicesA);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
if (!ret && GetLastError() == ERROR_NOT_ENOUGH_MEMORY && GetACP() == CP_UTF8)
@ -1314,7 +1314,7 @@ static BOOL test_enum_svc(int attempt)
* More than one service will be missing because of the space needed for
* the strings.
*/
services = HeapAlloc(GetProcessHeap(), 0, tempneeded);
services = malloc(tempneeded);
bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSW);
needed = 0xdeadbeef;
returned = 0xdeadbeef;
@ -1323,7 +1323,7 @@ static BOOL test_enum_svc(int attempt)
services, bufsize, &needed, &returned, NULL);
if (ret && needed == 0 && attempt)
{
HeapFree(GetProcessHeap(), 0, services);
free(services);
goto retry; /* service stop race condition */
}
ok(!ret, "Expected failure\n");
@ -1346,7 +1346,7 @@ static BOOL test_enum_svc(int attempt)
services, bufsize, &needed, &returned, &resume);
if (ret && needed == 0 && attempt)
{
HeapFree(GetProcessHeap(), 0, services);
free(services);
goto retry; /* service stop race condition */
}
ok(!ret, "Expected failure\n");
@ -1365,7 +1365,7 @@ static BOOL test_enum_svc(int attempt)
SetLastError(0xdeadbeef);
ret = EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
services, bufsize, &needed, &returned, &resume);
HeapFree(GetProcessHeap(), 0, services);
free(services);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
ok(ret, "Expected success, got error %lu\n", GetLastError());
@ -1390,10 +1390,10 @@ static BOOL test_enum_svc(int attempt)
/* Get the number of active win32 services */
EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_ACTIVE, NULL, 0,
&needed, &returned, NULL);
services = HeapAlloc(GetProcessHeap(), 0, needed);
services = malloc(needed);
ret = EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_ACTIVE,
services, needed, &needed, &returned, NULL);
HeapFree(GetProcessHeap(), 0, services);
free(services);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
@ -1402,10 +1402,10 @@ static BOOL test_enum_svc(int attempt)
/* Get the number of inactive win32 services */
EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_INACTIVE, NULL, 0,
&needed, &returned, NULL);
services = HeapAlloc(GetProcessHeap(), 0, needed);
services = malloc(needed);
ret = EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_INACTIVE,
services, needed, &needed, &returned, NULL);
HeapFree(GetProcessHeap(), 0, services);
free(services);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
@ -1414,10 +1414,10 @@ static BOOL test_enum_svc(int attempt)
/* Get the number of win32 services */
EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL, NULL, 0,
&needed, &returned, NULL);
services = HeapAlloc(GetProcessHeap(), 0, needed);
services = malloc(needed);
ret = EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
services, needed, &needed, &returned, NULL);
HeapFree(GetProcessHeap(), 0, services);
free(services);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
@ -1435,7 +1435,7 @@ static BOOL test_enum_svc(int attempt)
*/
EnumServicesStatusW(scm_handle, SERVICE_DRIVER | SERVICE_WIN32, SERVICE_STATE_ALL,
NULL, 0, &needed, &returned, NULL);
services = HeapAlloc(GetProcessHeap(), 0, needed);
services = malloc(needed);
ret = EnumServicesStatusW(scm_handle, SERVICE_DRIVER | SERVICE_WIN32, SERVICE_STATE_ALL,
services, needed, &needed, &returned, NULL);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
@ -1482,7 +1482,7 @@ static BOOL test_enum_svc(int attempt)
}
}
}
HeapFree(GetProcessHeap(), 0, services);
free(services);
if ((servicecountactive || servicecountinactive) && attempt)
goto retry; /* service start|stop race condition */
@ -1695,11 +1695,11 @@ static BOOL test_enum_svc_ex(int attempt)
/* Show the Ex call returns the same service count as the regular enum */
EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
NULL, 0, &needed, &returned, NULL);
services = HeapAlloc(GetProcessHeap(), 0, needed);
services = malloc(needed);
returned = 0xdeadbeef;
ret = EnumServicesStatusW(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
services, needed, &needed, &returned, NULL);
HeapFree(GetProcessHeap(), 0, services);
free(services);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
ok(ret, "Expected success, got error %lu\n", GetLastError());
@ -1710,14 +1710,14 @@ static BOOL test_enum_svc_ex(int attempt)
tempreturned = returned;
/* Allocate the correct needed bytes */
exservices = HeapAlloc(GetProcessHeap(), 0, tempneeded);
exservices = malloc(tempneeded);
bufsize = tempneeded;
needed = 0xdeadbeef;
returned = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_STATE_ALL,
(BYTE*)exservices, bufsize, &needed, &returned, NULL, NULL);
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
ok(ret, "Expected success, got error %lu\n", GetLastError());
@ -1731,7 +1731,7 @@ static BOOL test_enum_svc_ex(int attempt)
* More than one service will be missing because of the space needed for
* the strings.
*/
exservices = HeapAlloc(GetProcessHeap(), 0, tempneeded);
exservices = malloc(tempneeded);
bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSW);
needed = 0xdeadbeef;
returned = 0xdeadbeef;
@ -1740,7 +1740,7 @@ static BOOL test_enum_svc_ex(int attempt)
(BYTE*)exservices, bufsize, &needed, &returned, NULL, NULL);
if (ret && needed == 0 && attempt)
{
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
goto retry; /* service stop race condition */
}
ok(!ret, "Expected failure\n");
@ -1763,7 +1763,7 @@ static BOOL test_enum_svc_ex(int attempt)
(BYTE*)exservices, bufsize, &needed, &returned, &resume, NULL);
if (ret && needed == 0 && attempt)
{
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
goto retry; /* service stop race condition */
}
ok(!ret, "Expected failure\n");
@ -1782,7 +1782,7 @@ static BOOL test_enum_svc_ex(int attempt)
SetLastError(0xdeadbeef);
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_STATE_ALL,
(BYTE*)exservices, bufsize, &needed, &returned, &resume, NULL);
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
ok(ret, "Expected success, got error %lu\n", GetLastError());
@ -1795,10 +1795,10 @@ static BOOL test_enum_svc_ex(int attempt)
/* Get the number of active win32 services */
pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_ACTIVE,
NULL, 0, &needed, &returned, NULL, NULL);
exservices = HeapAlloc(GetProcessHeap(), 0, needed);
exservices = malloc(needed);
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_ACTIVE,
(BYTE*)exservices, needed, &needed, &returned, NULL, NULL);
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
@ -1807,10 +1807,10 @@ static BOOL test_enum_svc_ex(int attempt)
/* Get the number of inactive win32 services */
pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_INACTIVE,
NULL, 0, &needed, &returned, NULL, NULL);
exservices = HeapAlloc(GetProcessHeap(), 0, needed);
exservices = malloc(needed);
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_INACTIVE,
(BYTE*)exservices, needed, &needed, &returned, NULL, NULL);
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
@ -1819,10 +1819,10 @@ static BOOL test_enum_svc_ex(int attempt)
/* Get the number of win32 services */
pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_STATE_ALL,
NULL, 0, &needed, &returned, NULL, NULL);
exservices = HeapAlloc(GetProcessHeap(), 0, needed);
exservices = malloc(needed);
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32, SERVICE_STATE_ALL,
(BYTE*)exservices, needed, &needed, &returned, NULL, NULL);
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
goto retry; /* service start race condition */
@ -1837,7 +1837,7 @@ static BOOL test_enum_svc_ex(int attempt)
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32 | SERVICE_DRIVER,
SERVICE_STATE_ALL, NULL, 0, &needed, &returned, NULL, NULL);
ok(!ret, "Expected failure\n");
exservices = HeapAlloc(GetProcessHeap(), 0, needed);
exservices = malloc(needed);
ret = pEnumServicesStatusExW(scm_handle, 0, SERVICE_WIN32 | SERVICE_DRIVER,
SERVICE_STATE_ALL, (BYTE*)exservices, needed, &needed, &returned, NULL, NULL);
if (!ret && GetLastError() == ERROR_MORE_DATA && attempt)
@ -1908,7 +1908,7 @@ static BOOL test_enum_svc_ex(int attempt)
}
}
}
HeapFree(GetProcessHeap(), 0, exservices);
free(exservices);
if ((servicecountactive || servicecountinactive) && attempt)
goto retry; /* service start|stop race condition */
@ -2154,7 +2154,7 @@ static void test_sequence(void)
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
config = HeapAlloc(GetProcessHeap(), 0, needed);
config = malloc(needed);
given = needed;
SetLastError(0xdeadbeef);
ret = QueryServiceConfigA(svc_handle, config, given, &needed);
@ -2182,7 +2182,7 @@ static void test_sequence(void)
ok(ret, "ChangeServiceConfig failed (err=%ld)\n", GetLastError());
QueryServiceConfigA(svc_handle, NULL, 0, &needed);
config = HeapReAlloc(GetProcessHeap(), 0, config, needed);
config = realloc(config, needed);
ok(QueryServiceConfigA(svc_handle, config, needed, &needed), "QueryServiceConfig failed\n");
ok(config->lpBinaryPathName && config->lpLoadOrderGroup && config->lpDependencies && config->lpServiceStartName &&
config->lpDisplayName, "Expected all string struct members to be non-NULL\n");
@ -2201,7 +2201,7 @@ static void test_sequence(void)
ok(ret, "Expected success, got error %lu\n", GetLastError());
CloseServiceHandle(svc_handle);
CloseServiceHandle(scm_handle);
HeapFree(GetProcessHeap(), 0, config);
free(config);
}
static void test_queryconfig2(void)
@ -2890,7 +2890,7 @@ static void test_EventLog(void)
ok(!ret, "QueryServiceConfig should fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", GetLastError());
config = HeapAlloc(GetProcessHeap(), 0, size);
config = malloc(size);
ret = QueryServiceConfigA(svc_handle, config, size, &size);
ok(ret, "QueryServiceConfig error %lu\n", GetLastError());
@ -2912,7 +2912,7 @@ static void test_EventLog(void)
!strcmp(config->lpDisplayName, "Event Log") /* XP */ ||
!strcmp(config->lpDisplayName, "Windows Event Log") /* Vista+ */, "got %s\n", config->lpDisplayName);
HeapFree(GetProcessHeap(), 0, config);
free(config);
memset(&status, 0, sizeof(status));
size = sizeof(status);

View file

@ -254,6 +254,8 @@ static ULONG WINAPI filter_Release(IMediaStreamFilter *iface)
free(filter->streams);
if (filter->clock)
IReferenceClock_Release(filter->clock);
if (filter->cs.DebugInfo)
filter->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->cs);
free(filter);
}
@ -1100,7 +1102,7 @@ HRESULT filter_create(IUnknown *outer, void **out)
object->refcount = 1;
list_init(&object->free_events);
list_init(&object->used_events);
InitializeCriticalSection(&object->cs);
InitializeCriticalSectionEx(&object->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": MediaStreamFilter.cs");
TRACE("Created media stream filter %p.\n", object);

View file

@ -122,7 +122,7 @@ coclass WAVFile { interface IAVIFile; }
threading(both),
uuid(0002000d-0000-0000-c000-000000000046)
]
coclass PSFactoryBuffer { interface IFactoryBuffer; }
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }
[
helpstring("ACM Compressed Audio Stream"),

View file

@ -254,6 +254,8 @@ static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos)
} /* for (lNext < lPos) */
} /* if (This->lCurrentFrame != lPos) */
This->lCurrentFrame = lPos;
return (This->hic == NULL ? This->lpInFormat : This->lpOutFormat);
}

View file

@ -241,19 +241,23 @@ struct key_asymmetric_decrypt_params
struct key *key;
UCHAR *input;
unsigned input_len;
void *padding;
UCHAR *output;
ULONG output_len;
ULONG *ret_len;
ULONG flags;
};
struct key_asymmetric_encrypt_params
{
struct key *key;
UCHAR *input;
unsigned input_len;
unsigned input_len;
void *padding;
UCHAR *output;
ULONG output_len;
ULONG output_len;
ULONG *ret_len;
ULONG flags;
};
struct key_asymmetric_duplicate_params

View file

@ -732,7 +732,7 @@ static NTSTATUS get_rsa_property( enum chain_mode mode, const WCHAR *prop, UCHAR
{
*ret_size = sizeof(ULONG);
if (size < sizeof(ULONG)) return STATUS_BUFFER_TOO_SMALL;
if (buf) *(ULONG *)buf = BCRYPT_SUPPORTED_PAD_PKCS1_SIG;
if (buf) *(ULONG *)buf = BCRYPT_SUPPORTED_PAD_PKCS1_SIG | BCRYPT_SUPPORTED_PAD_OAEP;
return STATUS_SUCCESS;
}
@ -2254,7 +2254,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
}
else
{
if (flags & BCRYPT_PAD_NONE || flags & BCRYPT_PAD_OAEP)
if (flags & BCRYPT_PAD_NONE)
{
FIXME( "flags %#lx not implemented\n", flags );
return STATUS_NOT_IMPLEMENTED;
@ -2263,10 +2263,12 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
asymmetric_params.input = input;
asymmetric_params.input_len = input_len;
asymmetric_params.padding = padding;
asymmetric_params.key = key;
asymmetric_params.output = output;
asymmetric_params.output_len = output_len;
asymmetric_params.ret_len = ret_len;
asymmetric_params.flags = flags;
ret = UNIX_CALL(key_asymmetric_encrypt, &asymmetric_params);
}
@ -2299,7 +2301,7 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
}
else
{
if (flags & BCRYPT_PAD_NONE || flags & BCRYPT_PAD_OAEP)
if (flags & BCRYPT_PAD_NONE)
{
FIXME( "flags %#lx not implemented\n", flags );
return STATUS_NOT_IMPLEMENTED;
@ -2309,9 +2311,11 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
params.key = key;
params.input = input;
params.input_len = input_len;
params.padding = padding;
params.output = output;
params.output_len = output_len;
params.ret_len = ret_len;
params.flags = flags;
ret = UNIX_CALL(key_asymmetric_decrypt, &params);
}

View file

@ -162,6 +162,9 @@ static int (*pgnutls_privkey_import_dh_raw)(gnutls_privkey_t, const gnutls_dh_pa
const gnutls_datum_t *);
static int (*pgnutls_pubkey_import_dh_raw)(gnutls_pubkey_t, const gnutls_dh_params_t, const gnutls_datum_t *);
/* Not present in gnutls version < 3.8.4 */
static int (*pgnutls_x509_spki_set_rsa_oaep_params)(gnutls_x509_spki_t, gnutls_digest_algorithm_t, gnutls_datum_t *);
static void *libgnutls_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR(gnutls_cipher_decrypt2);
@ -303,6 +306,12 @@ static void compat_gnutls_x509_spki_deinit(gnutls_x509_spki_t spki)
{
}
static int compat_gnutls_x509_spki_set_rsa_oaep_params(gnutls_x509_spki_t spki, gnutls_digest_algorithm_t dig,
gnutls_datum_t *label)
{
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
}
static void compat_gnutls_x509_spki_set_rsa_pss_params(gnutls_x509_spki_t spki, gnutls_digest_algorithm_t dig,
unsigned int salt_size)
{
@ -444,6 +453,7 @@ static NTSTATUS gnutls_process_attach( void *args )
LOAD_FUNCPTR_OPT(gnutls_pubkey_verify_hash2)
LOAD_FUNCPTR_OPT(gnutls_x509_spki_deinit)
LOAD_FUNCPTR_OPT(gnutls_x509_spki_init)
LOAD_FUNCPTR_OPT(gnutls_x509_spki_set_rsa_oaep_params)
LOAD_FUNCPTR_OPT(gnutls_x509_spki_set_rsa_pss_params)
#undef LOAD_FUNCPTR_OPT
@ -2617,6 +2627,27 @@ static NTSTATUS key_asymmetric_duplicate( void *args )
return STATUS_SUCCESS;
}
static NTSTATUS privkey_set_rsa_oaep_params( gnutls_privkey_t key, gnutls_digest_algorithm_t dig, gnutls_datum_t *label )
{
gnutls_x509_spki_t spki;
int ret;
if (((ret = pgnutls_x509_spki_init( &spki ) < 0)))
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
}
pgnutls_x509_spki_set_rsa_oaep_params( spki, dig, label );
ret = pgnutls_privkey_set_spki( key, spki, 0 );
pgnutls_x509_spki_deinit( spki );
if (ret < 0)
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
}
return STATUS_SUCCESS;
}
static NTSTATUS key_asymmetric_decrypt( void *args )
{
const struct key_asymmetric_decrypt_params *params = args;
@ -2624,6 +2655,28 @@ static NTSTATUS key_asymmetric_decrypt( void *args )
NTSTATUS status = STATUS_SUCCESS;
int ret;
if (params->key->alg_id == ALG_ID_RSA && params->flags & BCRYPT_PAD_OAEP)
{
BCRYPT_OAEP_PADDING_INFO *pad = params->padding;
gnutls_digest_algorithm_t dig;
gnutls_datum_t label;
if (!pad || !pad->pszAlgId)
{
WARN( "padding info not found\n" );
return STATUS_INVALID_PARAMETER;
}
if ((dig = get_digest_from_id( pad->pszAlgId )) == GNUTLS_DIG_UNKNOWN)
{
FIXME( "hash algorithm %s not recognized\n", debugstr_w(pad->pszAlgId) );
return STATUS_NOT_SUPPORTED;
}
label.data = pad->pbLabel;
label.size = pad->cbLabel;
if ((status = privkey_set_rsa_oaep_params( key_data(params->key)->a.privkey, dig, &label ))) return status;
}
e.data = params->input;
e.size = params->input_len;
if ((ret = pgnutls_privkey_decrypt_data( key_data(params->key)->a.privkey, 0, &e, &d )))
@ -2634,12 +2687,33 @@ static NTSTATUS key_asymmetric_decrypt( void *args )
*params->ret_len = d.size;
if (params->output_len >= d.size) memcpy( params->output, d.data, *params->ret_len );
else status = STATUS_BUFFER_TOO_SMALL;
else if (params->output) status = STATUS_BUFFER_TOO_SMALL;
free( d.data );
return status;
}
static NTSTATUS pubkey_set_rsa_oaep_params( gnutls_pubkey_t key, gnutls_digest_algorithm_t dig, gnutls_datum_t *label )
{
gnutls_x509_spki_t spki;
int ret;
if (((ret = pgnutls_x509_spki_init( &spki ) < 0)))
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
}
pgnutls_x509_spki_set_rsa_oaep_params( spki, dig, label );
ret = pgnutls_pubkey_set_spki( key, spki, 0 );
pgnutls_x509_spki_deinit( spki );
if (ret < 0)
{
pgnutls_perror( ret );
return STATUS_INTERNAL_ERROR;
}
return STATUS_SUCCESS;
}
static NTSTATUS key_asymmetric_encrypt( void *args )
{
const struct key_asymmetric_encrypt_params *params = args;
@ -2649,6 +2723,28 @@ static NTSTATUS key_asymmetric_encrypt( void *args )
if (!key_data(params->key)->a.pubkey) return STATUS_INVALID_HANDLE;
if (params->key->alg_id == ALG_ID_RSA && params->flags & BCRYPT_PAD_OAEP)
{
BCRYPT_OAEP_PADDING_INFO *pad = params->padding;
gnutls_digest_algorithm_t dig;
gnutls_datum_t label;
if (!pad || !pad->pszAlgId || !pad->pbLabel)
{
WARN( "padding info not found\n" );
return STATUS_INVALID_PARAMETER;
}
if ((dig = get_digest_from_id( pad->pszAlgId )) == GNUTLS_DIG_UNKNOWN)
{
FIXME( "hash algorithm %s not recognized\n", debugstr_w(pad->pszAlgId) );
return STATUS_NOT_SUPPORTED;
}
label.data = pad->pbLabel;
label.size = pad->cbLabel;
if ((status = pubkey_set_rsa_oaep_params( key_data(params->key)->a.pubkey, dig, &label ))) return status;
}
d.data = params->input;
d.size = params->input_len;
if ((ret = pgnutls_pubkey_encrypt_data(key_data(params->key)->a.pubkey, 0, &d, &e)))
@ -2751,12 +2847,19 @@ struct key32
union padding
{
BCRYPT_OAEP_PADDING_INFO oaep;
BCRYPT_PKCS1_PADDING_INFO pkcs1;
BCRYPT_PSS_PADDING_INFO pss;
};
union padding32
{
struct
{
PTR32 pszAlgId;
PTR32 pbLabel;
ULONG cbLabel;
} oaep;
struct
{
PTR32 pszAlgId;
@ -2774,13 +2877,21 @@ static union padding *get_padding( union padding32 *padding32, union padding *pa
switch (flags)
{
case BCRYPT_PAD_OAEP:
padding->oaep.pszAlgId = ULongToPtr( padding32->oaep.pszAlgId );
padding->oaep.pbLabel = ULongToPtr( padding32->oaep.pbLabel );
padding->oaep.cbLabel = padding32->oaep.cbLabel;
return padding;
case BCRYPT_PAD_PKCS1:
padding->pkcs1.pszAlgId = ULongToPtr( padding32->pkcs1.pszAlgId );
return padding;
case BCRYPT_PAD_PSS:
padding->pss.pszAlgId = ULongToPtr( padding32->pss.pszAlgId );
padding->pss.cbSalt = padding32->pss.cbSalt;
return padding;
default:
break;
}
@ -2965,22 +3076,27 @@ static NTSTATUS wow64_key_asymmetric_decrypt( void *args )
PTR32 key;
PTR32 input;
ULONG input_len;
PTR32 padding;
PTR32 output;
ULONG output_len;
PTR32 ret_len;
ULONG flags;
} const *params32 = args;
NTSTATUS ret;
struct key key;
union padding padding;
struct key32 *key32 = ULongToPtr( params32->key );
struct key_asymmetric_decrypt_params params =
{
get_asymmetric_key( key32, &key ),
ULongToPtr(params32->input),
params32->input_len,
get_padding( ULongToPtr(params32->padding), &padding, params32->flags ),
ULongToPtr(params32->output),
params32->output_len,
ULongToPtr(params32->ret_len)
ULongToPtr(params32->ret_len),
params32->flags
};
ret = key_asymmetric_decrypt( &params );
@ -2995,22 +3111,27 @@ static NTSTATUS wow64_key_asymmetric_encrypt( void *args )
PTR32 key;
PTR32 input;
ULONG input_len;
PTR32 padding;
PTR32 output;
ULONG output_len;
PTR32 ret_len;
ULONG flags;
} const *params32 = args;
NTSTATUS ret;
struct key key;
union padding padding;
struct key32 *key32 = ULongToPtr( params32->key );
struct key_asymmetric_encrypt_params params =
{
get_asymmetric_key( key32, &key ),
ULongToPtr(params32->input),
params32->input_len,
get_padding( ULongToPtr(params32->padding), &padding, params32->flags ),
ULongToPtr(params32->output),
params32->output_len,
ULongToPtr(params32->ret_len)
ULongToPtr(params32->ret_len),
params32->flags
};
ret = key_asymmetric_encrypt( &params );

View file

@ -2444,20 +2444,16 @@ static const UCHAR rsa_encrypted_no_padding[] =
static void test_rsa_encrypt(void)
{
static UCHAR input[] = "Hello World!";
static UCHAR input_no_padding[64] = { 0 };
UCHAR encrypted[64], decrypted[64];
BCRYPT_ALG_HANDLE rsa = 0;
BCRYPT_KEY_HANDLE key = 0, key2;
NTSTATUS ret = 0;
DWORD encrypted_size = 60;
UCHAR *encrypted_a = NULL;
UCHAR *encrypted_b = NULL;
DWORD decrypted_size = 0;
UCHAR input[] = "Hello World!", input_no_padding[64] = { 0 }, encrypted[64], decrypted[64];
BCRYPT_ALG_HANDLE rsa;
BCRYPT_KEY_HANDLE key, key2;
NTSTATUS ret;
DWORD encrypted_size, decrypted_size;
UCHAR *encrypted_a = NULL, *encrypted_b = NULL;
BCRYPT_OAEP_PADDING_INFO oaep_pad;
oaep_pad.pszAlgId = BCRYPT_MD5_ALGORITHM;
oaep_pad.pbLabel = (PUCHAR)"test";
oaep_pad.pszAlgId = BCRYPT_SHA256_ALGORITHM;
oaep_pad.pbLabel = (UCHAR *)"test";
oaep_pad.cbLabel = 5;
ret = BCryptOpenAlgorithmProvider(&rsa, BCRYPT_RSA_ALGORITHM, NULL, 0);
@ -2478,10 +2474,11 @@ static void test_rsa_encrypt(void)
ret = BCryptImportKeyPair(rsa, NULL, BCRYPT_RSAPRIVATE_BLOB, &key, rsaPrivateBlob, sizeof(rsaPrivateBlob), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
todo_wine {
/* No padding */
todo_wine {
memset(input_no_padding, 0, sizeof(input_no_padding));
strcpy((char *)input_no_padding, "Hello World");
encrypted_size = 0;
ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_NONE);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
@ -2496,22 +2493,32 @@ static void test_rsa_encrypt(void)
ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_a, 12, &encrypted_size, BCRYPT_PAD_NONE);
ok(ret == STATUS_BUFFER_TOO_SMALL, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
}
ok(!memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs should be the same\n");
ok(!memcmp(encrypted_b, rsa_encrypted_no_padding, encrypted_size), "Data mismatch.\n");
BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_NONE);
todo_wine {
decrypted_size = 0;
ret = BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_NONE);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input_no_padding), "got %lu\n", decrypted_size);
BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_NONE);
ok(!memcmp(decrypted, input_no_padding, sizeof(input_no_padding)), "Decrypted output it's not what expected\n");
ret = BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_NONE);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input_no_padding), "got %lu\n", decrypted_size);
ok(!memcmp(decrypted, input_no_padding, sizeof(input_no_padding)), "unexpected output\n");
}
encrypted_size = 60;
/* PKCS1 Padding */
encrypted_size = 0;
ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
@ -2523,22 +2530,54 @@ static void test_rsa_encrypt(void)
ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
ok(memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs are the same\n");
BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_PKCS1);
decrypted_size = 0;
ret = BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input), "got size of %ld\n", decrypted_size);
BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_PKCS1);
ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n");
todo_wine {
encrypted_size = 60;
/* OAEP Padding */
ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_OAEP);
ret = BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input), "got size of %ld\n", decrypted_size);
ok(!memcmp(decrypted, input, sizeof(input)), "unexpected output\n");
ret = BCryptImportKeyPair(rsa, NULL, LEGACY_RSAPRIVATE_BLOB, &key2, (UCHAR *)&rsaLegacyPrivateBlob,
sizeof(rsaLegacyPrivateBlob), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptEncrypt(key2, input, sizeof(input), NULL, NULL, 0, encrypted, sizeof(encrypted),
&encrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
memset(decrypted, 0, sizeof(decrypted));
ret = BCryptDecrypt(key, encrypted, sizeof(encrypted), NULL, NULL, 0, decrypted, sizeof(decrypted),
&decrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input), "got size of %ld\n", decrypted_size);
ok(!memcmp(decrypted, input, sizeof(input)), "unexpected output\n");
BCryptDestroyKey(key2);
BCryptDestroyKey(key);
/* OAEP Padding */
ret = BCryptGenerateKeyPair(rsa, &key, 640 /* minimum size for sha256 hash */, 0);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ret = BCryptFinalizeKeyPair(key, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
todo_wine {
encrypted_size = 0;
ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_OAEP);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 80, "got size of %ld\n", encrypted_size);
encrypted_a = realloc(encrypted_a, encrypted_size);
memset(encrypted_a, 0, encrypted_size);
encrypted_b = realloc(encrypted_b, encrypted_size);
@ -2546,38 +2585,28 @@ static void test_rsa_encrypt(void)
ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 80, "got size of %ld\n", encrypted_size);
ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 80, "got size of %ld\n", encrypted_size);
ok(memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs are the same\n");
decrypted_size = 0;
memset(decrypted, 0, sizeof(decrypted));
BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_OAEP);
ret = BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_OAEP);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input), "got %lu\n", decrypted_size);
BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_OAEP);
ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n");
ret = BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_OAEP);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input), "got %lu\n", decrypted_size);
ok(!memcmp(decrypted, input, sizeof(input)), "unexpected output\n");
}
free(encrypted_a);
free(encrypted_b);
ret = BCryptImportKeyPair(rsa, NULL, LEGACY_RSAPRIVATE_BLOB, &key2,
(UCHAR *)&rsaLegacyPrivateBlob, sizeof(rsaLegacyPrivateBlob), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptEncrypt(key2, input, sizeof(input), NULL, NULL, 0,
encrypted, sizeof(encrypted), &encrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(encrypted_size == 64, "got size of %ld\n", encrypted_size);
memset(decrypted, 0, sizeof(decrypted));
ret = BCryptDecrypt(key, encrypted, sizeof(encrypted), NULL, NULL, 0,
decrypted, sizeof(decrypted), &decrypted_size, BCRYPT_PAD_PKCS1);
ok(ret == STATUS_SUCCESS, "got %lx\n", ret);
ok(decrypted_size == sizeof(input), "got size of %ld\n", decrypted_size);
ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n");
BCryptDestroyKey(key2);
BCryptDestroyKey(key);
if (pBCryptHash)

View file

@ -149,7 +149,7 @@ HRESULT CompCatCacheDaemon_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
This->IRunnableTask_iface.lpVtbl = &CompCatCacheDaemonVtbl;
This->refCount = 1;
InitializeCriticalSection(&This->cs);
InitializeCriticalSectionEx(&This->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": CompCatCacheDaemon.cs");
TRACE("returning %p\n", This);

View file

@ -626,7 +626,7 @@ HRESULT ProgressDialog_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
This->IProgressDialog_iface.lpVtbl = &ProgressDialogVtbl;
This->IOleWindow_iface.lpVtbl = &OleWindowVtbl;
This->refCount = 1;
InitializeCriticalSection(&This->cs);
InitializeCriticalSectionEx(&This->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ProgressDialog.cs");
TRACE("returning %p\n", This);

View file

@ -376,7 +376,7 @@ static struct apartment *apartment_construct(DWORD model)
apt->refs = 1;
apt->remunk_exported = FALSE;
apt->oidc = 1;
InitializeCriticalSection(&apt->cs);
InitializeCriticalSectionEx(&apt->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
apt->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": apartment");
apt->multi_threaded = !(model & COINIT_APARTMENTTHREADED);

View file

@ -1575,7 +1575,7 @@ static HRESULT proxy_manager_construct(
list_init(&This->entry);
list_init(&This->interfaces);
InitializeCriticalSection(&This->cs);
InitializeCriticalSectionEx(&This->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": proxy_manager");
/* the apartment the object was unmarshaled into */

View file

@ -187,7 +187,7 @@ static struct stub_manager *new_stub_manager(struct apartment *apt, IUnknown *ob
list_init(&sm->ifstubs);
InitializeCriticalSection(&sm->lock);
InitializeCriticalSectionEx(&sm->lock, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
sm->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": stub_manager");
IUnknown_AddRef(object);

View file

@ -813,7 +813,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
TRACE("Animate style %#lx, parent %p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
InitializeCriticalSection(&infoPtr->cs);
InitializeCriticalSectionEx(&infoPtr->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
infoPtr->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ANIMATE_INFO*->cs");
return TRUE;

View file

@ -763,106 +763,18 @@ HIMAGELIST WINAPI
ImageList_Create (INT cx, INT cy, UINT flags,
INT cInitial, INT cGrow)
{
HIMAGELIST himl;
INT nCount;
HBITMAP hbmTemp;
UINT ilc = (flags & 0xFE);
static const WORD aBitBlend25[] =
{0xAA, 0x00, 0x55, 0x00, 0xAA, 0x00, 0x55, 0x00};
static const WORD aBitBlend50[] =
{0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA};
IImageList2 *himl;
TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow);
if (cx < 0 || cy < 0) return NULL;
if (!((flags&ILC_COLORDDB) == ILC_COLORDDB) && (cx == 0 || cy == 0)) return NULL;
/* Create the IImageList interface for the image list */
if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl)))
if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList2, (void **)&himl)))
return NULL;
cGrow = (WORD)((max( cGrow, 1 ) + 3) & ~3);
if (IImageList2_Initialize(himl, cx, cy, flags, cInitial, cGrow) == S_OK)
return (HIMAGELIST)himl;
if (cGrow > 256)
{
/* Windows doesn't limit the size here, but X11 doesn't let us allocate such huge bitmaps */
WARN( "grow %d too large, limiting to 256\n", cGrow );
cGrow = 256;
}
himl->cx = cx;
himl->cy = cy;
himl->flags = flags;
himl->cMaxImage = cInitial + 1;
himl->cInitial = cInitial;
himl->cGrow = cGrow;
himl->clrFg = CLR_DEFAULT;
himl->clrBk = CLR_NONE;
himl->color_table_set = FALSE;
/* initialize overlay mask indices */
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1;
/* Create Image & Mask DCs */
himl->hdcImage = CreateCompatibleDC (0);
if (!himl->hdcImage)
goto cleanup;
if (himl->flags & ILC_MASK){
himl->hdcMask = CreateCompatibleDC(0);
if (!himl->hdcMask)
goto cleanup;
}
/* Default to ILC_COLOR4 if none of the ILC_COLOR* flags are specified */
if (ilc == ILC_COLOR)
{
ilc = ILC_COLOR4;
himl->flags |= ILC_COLOR4;
}
if (ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32)
himl->uBitsPixel = ilc;
else
himl->uBitsPixel = (UINT)GetDeviceCaps (himl->hdcImage, BITSPIXEL);
if (himl->cMaxImage > 0) {
himl->hbmImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage);
SelectObject(himl->hdcImage, himl->hbmImage);
} else
himl->hbmImage = 0;
if ((himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
SIZE sz;
imagelist_get_bitmap_size(himl, himl->cMaxImage, &sz);
himl->hbmMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
if (himl->hbmMask == 0) {
ERR("Error creating mask bitmap!\n");
goto cleanup;
}
SelectObject(himl->hdcMask, himl->hbmMask);
}
else
himl->hbmMask = 0;
himl->item_flags = Alloc( himl->cMaxImage * sizeof(*himl->item_flags) );
/* create blending brushes */
hbmTemp = CreateBitmap (8, 8, 1, 1, aBitBlend25);
himl->hbrBlend25 = CreatePatternBrush (hbmTemp);
DeleteObject (hbmTemp);
hbmTemp = CreateBitmap (8, 8, 1, 1, aBitBlend50);
himl->hbrBlend50 = CreatePatternBrush (hbmTemp);
DeleteObject (hbmTemp);
TRACE("created imagelist %p\n", himl);
return himl;
cleanup:
ImageList_Destroy(himl);
IImageList2_Release(himl);
return NULL;
}
@ -3721,8 +3633,99 @@ static HRESULT WINAPI ImageListImpl_GetStatistics(IImageList2 *iface, IMAGELISTS
static HRESULT WINAPI ImageListImpl_Initialize(IImageList2 *iface, INT cx, INT cy, UINT flags, INT initial, INT grow)
{
FIXME("(%p)->(%d %d %d %d %d): stub\n", iface, cx, cy, flags, initial, grow);
return E_NOTIMPL;
HIMAGELIST himl = impl_from_IImageList2(iface);
INT nCount;
HBITMAP hbmTemp;
UINT ilc = (flags & 0xFE);
static const WORD aBitBlend25[] =
{0xAA, 0x00, 0x55, 0x00, 0xAA, 0x00, 0x55, 0x00};
static const WORD aBitBlend50[] =
{0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA};
TRACE("(%p)->(%d %d %d %d %d)\n", iface, cx, cy, flags, initial, grow);
if (cx < 0 || cy < 0) return E_INVALIDARG;
if (!((flags&ILC_COLORDDB) == ILC_COLORDDB) && (cx == 0 || cy == 0)) return E_INVALIDARG;
grow = (WORD)((max( grow, 1 ) + 3) & ~3);
if (grow > 256)
{
/* Windows doesn't limit the size here, but X11 doesn't let us allocate such huge bitmaps */
WARN( "grow %d too large, limiting to 256\n", grow );
grow = 256;
}
himl->cx = cx;
himl->cy = cy;
himl->flags = flags;
himl->cMaxImage = initial + 1;
himl->cInitial = initial;
himl->cGrow = grow;
himl->clrFg = CLR_DEFAULT;
himl->clrBk = CLR_NONE;
himl->color_table_set = FALSE;
/* initialize overlay mask indices */
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1;
/* Create Image & Mask DCs */
himl->hdcImage = CreateCompatibleDC (0);
if (!himl->hdcImage)
return E_FAIL;
if (himl->flags & ILC_MASK){
himl->hdcMask = CreateCompatibleDC(0);
if (!himl->hdcMask)
return E_FAIL;
}
/* Default to ILC_COLOR4 if none of the ILC_COLOR* flags are specified */
if (ilc == ILC_COLOR)
{
ilc = ILC_COLOR4;
himl->flags |= ILC_COLOR4;
}
if (ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32)
himl->uBitsPixel = ilc;
else
himl->uBitsPixel = (UINT)GetDeviceCaps (himl->hdcImage, BITSPIXEL);
if (himl->cMaxImage > 0) {
himl->hbmImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage);
SelectObject(himl->hdcImage, himl->hbmImage);
} else
himl->hbmImage = 0;
if ((himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
SIZE sz;
imagelist_get_bitmap_size(himl, himl->cMaxImage, &sz);
himl->hbmMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
if (himl->hbmMask == 0) {
ERR("Error creating mask bitmap!\n");
return E_FAIL;
}
SelectObject(himl->hdcMask, himl->hbmMask);
}
else
himl->hbmMask = 0;
himl->item_flags = Alloc( himl->cMaxImage * sizeof(*himl->item_flags) );
/* create blending brushes */
hbmTemp = CreateBitmap (8, 8, 1, 1, aBitBlend25);
himl->hbrBlend25 = CreatePatternBrush (hbmTemp);
DeleteObject (hbmTemp);
hbmTemp = CreateBitmap (8, 8, 1, 1, aBitBlend50);
himl->hbrBlend50 = CreatePatternBrush (hbmTemp);
DeleteObject (hbmTemp);
TRACE("created imagelist %p\n", himl);
return S_OK;
}
static HRESULT WINAPI ImageListImpl_Replace2(IImageList2 *iface, INT i, HBITMAP image, HBITMAP mask, IUnknown *unk, DWORD flags)

View file

@ -1672,6 +1672,8 @@ static void test_iimagelist(void)
HIMAGELIST himl;
HRESULT hr;
ULONG ret;
HBITMAP hbm;
int ret2;
if (!pHIMAGELIST_QueryInterface)
{
@ -1741,7 +1743,48 @@ static void test_iimagelist(void)
win_skip("IImageList2 is not supported.\n");
return;
}
ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IImageList2_Initialize(imagelist, BMP_CX, BMP_CX, ILC_COLOR24, 1, 1);
ok(hr == S_OK, "got %#lx\n", hr);
check_iml_data((HIMAGELIST)imagelist, BMP_CX, BMP_CX, 0, 2, 1, ILC_COLOR24, "IImageList2 0");
hr = IImageList2_Remove(imagelist, 0);
ok(hr == E_INVALIDARG, "got %#lx\n", hr);
hr = IImageList2_Remove(imagelist, -1);
ok(hr == S_OK, "got %#lx\n", hr);
hbm = CreateBitmap(BMP_CX, BMP_CX, 1, 1, NULL);
ret2 = -1;
hr = IImageList2_Add(imagelist, hbm, 0, &ret2);
ok(hr == S_OK, "got %#lx\n", hr);
ok(ret2 == 0, "got %d\n", ret2);
check_iml_data((HIMAGELIST)imagelist, BMP_CX, BMP_CX, 1, 2, 4, ILC_COLOR24, "IImageList2 1");
ret2 = -1;
hr = IImageList2_Add(imagelist, hbm, 0, &ret2);
ok(hr == S_OK, "got %#lx\n", hr);
ok(ret2 == 1, "got %d\n", ret2);
check_iml_data((HIMAGELIST)imagelist, BMP_CX, BMP_CX, 2, 7, 4, ILC_COLOR24, "IImageList2 2");
hr = IImageList2_Remove(imagelist, 0);
ok(hr == S_OK, "got %#lx\n", hr);
check_iml_data((HIMAGELIST)imagelist, BMP_CX, BMP_CX, 1, 7, 4, ILC_COLOR24, "IImageList2 1");
hr = IImageList2_Remove(imagelist, -1);
ok(hr == S_OK, "got %#lx\n", hr);
check_iml_data((HIMAGELIST)imagelist, BMP_CX, BMP_CX, 0, 4, 1, ILC_COLOR24, "IImageList2 0");
hr = IImageList2_Remove(imagelist, 0);
ok(hr == E_INVALIDARG, "got %#lx\n", hr);
DeleteObject(hbm);
IImageList2_Release(imagelist);
}

View file

@ -469,6 +469,7 @@ static void test_monthcal(void)
ok(limits == GDTR_MIN, "got 0x%08lx\n", limits);
GetSystemTime(st);
st[0].wDay = 25;
st[1] = st[0];
st[1].wYear++;
r = SendMessageA(hwnd, MCM_SETRANGE, 0, (LPARAM)st);
@ -480,6 +481,7 @@ static void test_monthcal(void)
/* flags are 0, set min limit */
GetSystemTime(st);
st[0].wDay = 25;
st[1] = st[0];
st[1].wYear++;

View file

@ -978,10 +978,11 @@ static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg,
/***********************************************************************
* PRINTDLG_UpdatePrinterInfoTexts [internal]
*/
static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, const PRINTER_INFO_2A *pi)
static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, DWORD flags, const PRINTER_INFO_2A *pi)
{
char StatusMsg[256];
char ResourceString[256];
char printer_name[256];
int i;
/* Status Message */
@ -1004,6 +1005,17 @@ static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, const PRINTER_INFO_2A *p
SetDlgItemTextA(hDlg, stc12, StatusMsg);
/* set all other printer info texts */
if (flags & PD_PRINTSETUP)
{
DWORD dwBufLen = ARRAY_SIZE(printer_name);
GetDefaultPrinterA(printer_name, &dwBufLen);
}
else
{
/* FIXME: Windows decorates the printer name with text like 'System Printer' or 'on <port>'. */
lstrcpynA(printer_name, pi->pPrinterName, ARRAY_SIZE(printer_name));
}
SetDlgItemTextA(hDlg, stc1, printer_name);
SetDlgItemTextA(hDlg, stc11, pi->pDriverName);
if (pi->pLocation != NULL && pi->pLocation[0] != '\0')
@ -1014,11 +1026,12 @@ static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, const PRINTER_INFO_2A *p
return;
}
static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *pi)
static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, DWORD flags, const PRINTER_INFO_2W *pi)
{
WCHAR StatusMsg[256];
WCHAR ResourceString[256];
int i;
WCHAR printer_name[256];
int i;
/* Status Message */
StatusMsg[0]='\0';
@ -1040,6 +1053,17 @@ static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *p
SetDlgItemTextW(hDlg, stc12, StatusMsg);
/* set all other printer info texts */
if (flags & PD_PRINTSETUP)
{
DWORD dwBufLen = ARRAY_SIZE(printer_name);
GetDefaultPrinterW(printer_name, &dwBufLen);
}
else
{
/* FIXME: Windows decorates the printer name with text like 'System Printer' or 'on <port>'. */
lstrcpynW(printer_name, pi->pPrinterName, ARRAY_SIZE(printer_name));
}
SetDlgItemTextW(hDlg, stc1, printer_name);
SetDlgItemTextW(hDlg, stc11, pi->pDriverName);
if (pi->pLocation != NULL && pi->pLocation[0] != '\0')
SetDlgItemTextW(hDlg, stc14, pi->pLocation);
@ -1081,7 +1105,7 @@ static BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name, PRINT_PTRA *PrintStru
}
ClosePrinter(hprn);
PRINTDLG_UpdatePrinterInfoTextsA(hDlg, PrintStructures->lpPrinterInfo);
PRINTDLG_UpdatePrinterInfoTextsA(hDlg, lppd->Flags, PrintStructures->lpPrinterInfo);
free(PrintStructures->lpDevMode);
PrintStructures->lpDevMode = NULL;
@ -1229,7 +1253,7 @@ static BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name, PRINT_PTRA *PrintStru
if(IsDefault)
SendMessageA(hQuality, CB_SETCURSEL, Index, 0);
SendMessageA(hQuality, CB_SETITEMDATA, Index, MAKELONG(dpiX,dpiY));
SendMessageA(hQuality, CB_SETITEMDATA, Index, MAKELONG(Resolutions[i], Resolutions[i+1]));
}
free(Resolutions);
}
@ -1288,7 +1312,7 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name,
}
ClosePrinter(hprn);
PRINTDLG_UpdatePrinterInfoTextsW(hDlg, PrintStructures->lpPrinterInfo);
PRINTDLG_UpdatePrinterInfoTextsW(hDlg, lppd->Flags, PrintStructures->lpPrinterInfo);
free(PrintStructures->lpDevMode);
PrintStructures->lpDevMode = NULL;
@ -1386,6 +1410,61 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name,
if (lppd->Flags & PD_HIDEPRINTTOFILE)
ShowWindow(GetDlgItem(hDlg, chx1), SW_HIDE);
/* Fill print quality combo, PrintDlg16 */
if (GetDlgItem(hDlg, cmb1))
{
DWORD num_resolutions = DeviceCapabilitiesW(PrintStructures->lpPrinterInfo->pPrinterName,
PrintStructures->lpPrinterInfo->pPortName,
DC_ENUMRESOLUTIONS, NULL, lpdm);
if (num_resolutions != -1)
{
HWND quality = GetDlgItem(hDlg, cmb1);
LONG* resolutions;
WCHAR buf[255];
DWORD i;
int dpiX, dpiY;
HDC printer = CreateDCW(PrintStructures->lpPrinterInfo->pDriverName,
PrintStructures->lpPrinterInfo->pPrinterName,
0, lpdm);
resolutions = malloc(num_resolutions * sizeof(LONG) * 2);
DeviceCapabilitiesW(PrintStructures->lpPrinterInfo->pPrinterName,
PrintStructures->lpPrinterInfo->pPortName,
DC_ENUMRESOLUTIONS, (LPWSTR)resolutions, lpdm);
dpiX = GetDeviceCaps(printer, LOGPIXELSX);
dpiY = GetDeviceCaps(printer, LOGPIXELSY);
DeleteDC(printer);
SendMessageW(quality, CB_RESETCONTENT, 0, 0);
for (i = 0; i < (num_resolutions * 2); i += 2)
{
BOOL is_default = FALSE;
LRESULT index;
if (resolutions[i] == resolutions[i+1])
{
if (dpiX == resolutions[i])
is_default = TRUE;
swprintf(buf, sizeof(buf), L"%ld dpi", resolutions[i]);
} else
{
if (dpiX == resolutions[i] && dpiY == resolutions[i+1])
is_default = TRUE;
swprintf(buf, sizeof(buf), L"%ld dpi x %ld dpi", resolutions[i], resolutions[i+1]);
}
index = SendMessageW(quality, CB_ADDSTRING, 0, (LPARAM)buf);
if (is_default)
SendMessageW(quality, CB_SETCURSEL, index, 0);
SendMessageW(quality, CB_SETITEMDATA, index, MAKELONG(resolutions[i], resolutions[i+1]));
}
free(resolutions);
}
}
} else { /* PD_PRINTSETUP */
BOOL bPortrait = (lpdm->dmOrientation == DMORIENT_PORTRAIT);
@ -1761,8 +1840,8 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam,
case cmb4: /* Printer combobox */
if (HIWORD(wParam)==CBN_SELCHANGE) {
char *PrinterName;
INT index = SendDlgItemMessageW(hDlg, LOWORD(wParam), CB_GETCURSEL, 0, 0);
INT length = SendDlgItemMessageW(hDlg, LOWORD(wParam), CB_GETLBTEXTLEN, index, 0);
INT index = SendDlgItemMessageA(hDlg, LOWORD(wParam), CB_GETCURSEL, 0, 0);
INT length = SendDlgItemMessageA(hDlg, LOWORD(wParam), CB_GETLBTEXTLEN, index, 0);
PrinterName = malloc(length + 1);
SendDlgItemMessageA(hDlg, LOWORD(wParam), CB_GETLBTEXT, index, (LPARAM)PrinterName);
PRINTDLG_ChangePrinterA(hDlg, PrinterName, PrintStructures);
@ -1909,7 +1988,10 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam,
}
break;
case cmb1: /* Printer Combobox in PRINT SETUP */
case cmb1: /* Printer Combobox in PRINT SETUP, quality combobox in PRINT16 */
if (PrinterComboID != LOWORD(wParam)) {
break;
}
/* FALLTHROUGH */
case cmb4: /* Printer combobox */
if (HIWORD(wParam)==CBN_SELCHANGE) {

View file

@ -268,7 +268,7 @@
@ cdecl _scalb(double long)
@ cdecl _searchenv(str str ptr)
@ cdecl _seterrormode(long)
@ cdecl -norelay _setjmp(ptr) MSVCRT__setjmp
@ cdecl -norelay _setjmp(ptr)
@ cdecl _setmode(long long)
@ stub _setsystime(ptr long)
@ cdecl _sleep(long)
@ -434,7 +434,7 @@
@ cdecl -arch=win64 localtime(ptr) _localtime64
@ cdecl log(double)
@ cdecl log10(double)
@ cdecl longjmp(ptr long) MSVCRT_longjmp
@ cdecl longjmp(ptr long)
@ cdecl malloc(long)
@ cdecl mblen(ptr long)
@ cdecl mbstowcs(ptr str long)

View file

@ -111,8 +111,6 @@ static DWORD encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep,
i = 0;
while (div > 0 && ptr < end)
{
if (i && i % 64 == 0)
ptr += stradd(ptr, end, sep, strlen(sep));
/* first char is the first 6 bits of the first byte*/
chunk[0] = b64[ ( d[0] >> 2) & 0x3f ];
/* second char is the last 2 bits of the first byte and the first 4
@ -127,6 +125,9 @@ static DWORD encodeBase64A(const BYTE *in_buf, int in_len, LPCSTR sep,
i += 4;
d += 3;
div--;
if (i && i % 64 == 0)
ptr += stradd(ptr, end, sep, strlen(sep));
}
switch(pad_bytes)
@ -393,11 +394,6 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
i = 0;
while (div > 0)
{
if (i && i % 64 == 0)
{
lstrcpyW(ptr, sep);
ptr += lstrlenW(sep);
}
/* first char is the first 6 bits of the first byte*/
*ptr++ = b64[ ( d[0] >> 2) & 0x3f ];
/* second char is the last 2 bits of the first byte and the first 4
@ -411,6 +407,12 @@ static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
i += 4;
d += 3;
div--;
if (i && i % 64 == 0)
{
lstrcpyW(ptr, sep);
ptr += lstrlenW(sep);
}
}
switch(pad_bytes)

View file

@ -478,7 +478,7 @@ WINECRYPT_CERTSTORE *CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv,
{
memset(store, 0, sizeof(WINE_COLLECTIONSTORE));
CRYPT_InitStore(&store->hdr, dwFlags, StoreTypeCollection, &CollectionStoreVtbl);
InitializeCriticalSection(&store->cs);
InitializeCriticalSectionEx(&store->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
store->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PWINE_COLLECTIONSTORE->cs");
list_init(&store->stores);
}

View file

@ -125,7 +125,7 @@ HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName,
ret->name = CryptMemAlloc(strlen(pszFuncName) + 1);
if (ret->name)
{
InitializeCriticalSection(&ret->cs);
InitializeCriticalSectionEx(&ret->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": OIDFunctionSet.cs");
list_init(&ret->functions);
strcpy(ret->name, pszFuncName);

View file

@ -46,7 +46,7 @@ CONTEXT_PROPERTY_LIST *ContextPropertyList_Create(void)
if (list)
{
InitializeCriticalSection(&list->cs);
InitializeCriticalSectionEx(&list->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
list->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PCONTEXT_PROPERTY_LIST->cs");
list_init(&list->properties);
}

View file

@ -545,7 +545,7 @@ WINECRYPT_CERTSTORE *CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
regInfo->dwOpenFlags = dwFlags;
regInfo->memStore = memStore;
regInfo->key = key;
InitializeCriticalSection(&regInfo->cs);
InitializeCriticalSectionEx(&regInfo->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
regInfo->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PWINE_REGSTOREINFO->cs");
list_init(&regInfo->certsToDelete);
list_init(&regInfo->crlsToDelete);

View file

@ -388,7 +388,7 @@ static WINECRYPT_CERTSTORE *CRYPT_MemOpenStore(HCRYPTPROV hCryptProv,
{
memset(store, 0, sizeof(WINE_MEMSTORE));
CRYPT_InitStore(&store->hdr, dwFlags, StoreTypeMem, &MemStoreVtbl);
InitializeCriticalSection(&store->cs);
InitializeCriticalSectionEx(&store->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
store->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ContextList.cs");
list_init(&store->certs);
list_init(&store->crls);

View file

@ -57,6 +57,8 @@ static const BYTE toEncode4[] =
static const BYTE toEncode5[] =
"abcdefghijlkmnopqrstuvwxyz01234567890ABCDEFGHI";
static const BYTE toEncode6[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
static const struct BinTests tests[] = {
{ toEncode1, sizeof(toEncode1), "AA==\r\n", },
{ toEncode2, sizeof(toEncode2), "AQI=\r\n", },
@ -69,6 +71,9 @@ static const struct BinTests tests[] = {
"SElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODkwAA==\r\n" },
{ toEncode5, sizeof(toEncode5),
"YWJjZGVmZ2hpamxrbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5MEFCQ0RFRkdISQA=\r\n" },
{ toEncode6, sizeof(toEncode6),
"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\r\n"
"YQA=\r\n" },
};
static const struct BinTests testsNoCR[] = {
@ -83,6 +88,9 @@ static const struct BinTests testsNoCR[] = {
"SElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODkwAA==\n" },
{ toEncode5, sizeof(toEncode5),
"YWJjZGVmZ2hpamxrbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5MEFCQ0RFRkdISQA=\n" },
{ toEncode6, sizeof(toEncode6),
"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\n"
"YQA=\n" },
};
static WCHAR *strdupAtoW(const char *str)

View file

@ -355,7 +355,7 @@ static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_oper
if ((impl->invoker = invoker)) IUnknown_AddRef( impl->invoker );
if ((impl->param = param)) IUnknown_AddRef( impl->param );
InitializeCriticalSection( &impl->cs );
InitializeCriticalSectionEx( &impl->cs, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO );
impl->cs.DebugInfo->Spare[0] = (DWORD_PTR)( __FILE__ ": async_info.cs" );
*out = &impl->IWineAsyncInfoImpl_iface;

View file

@ -3204,6 +3204,7 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target,
D3D11_RASTERIZER_DESC rs_desc;
D3D11_BUFFER_DESC buffer_desc;
struct d2d_factory *factory;
ID3D10Blob *compiled;
unsigned int i;
HRESULT hr;
@ -3472,468 +3473,208 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target,
" * float2(transform_rtx.w, transform_rty.w);\n"
" o.position = float4(position + float2(-1.0f, 1.0f), 0.0f, 1.0f);\n"
"}\n";
static const DWORD ps_code[] =
{
#if 0
#define BRUSH_TYPE_SOLID 0
#define BRUSH_TYPE_LINEAR 1
#define BRUSH_TYPE_RADIAL 2
#define BRUSH_TYPE_BITMAP 3
#define BRUSH_TYPE_COUNT 4
bool outline;
bool is_arc;
struct brush
{
uint type;
float opacity;
float4 data[3];
} colour_brush, opacity_brush;
SamplerState s0, s1;
Texture2D t0, t1;
Buffer<float4> b0, b1;
struct input
{
float2 p : WORLD_POSITION;
float4 b : BEZIER;
nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;
};
float4 sample_gradient(Buffer<float4> gradient, uint stop_count, float position)
{
float4 c_low, c_high;
float p_low, p_high;
uint i;
p_low = gradient.Load(0).x;
c_low = gradient.Load(1);
c_high = c_low;
if (position < p_low)
return c_low;
for (i = 1; i < stop_count; ++i)
{
p_high = gradient.Load(i * 2).x;
c_high = gradient.Load(i * 2 + 1);
if (position >= p_low && position <= p_high)
return lerp(c_low, c_high, (position - p_low) / (p_high - p_low));
p_low = p_high;
c_low = c_high;
}
return c_high;
}
float4 brush_linear(struct brush brush, Buffer<float4> gradient, float2 position)
{
float2 start, end, v_p, v_q;
uint stop_count;
float p;
start = brush.data[0].xy;
end = brush.data[0].zw;
stop_count = asuint(brush.data[1].x);
v_p = position - start;
v_q = end - start;
p = dot(v_q, v_p) / dot(v_q, v_q);
return sample_gradient(gradient, stop_count, p);
}
float4 brush_radial(struct brush brush, Buffer<float4> gradient, float2 position)
{
float2 centre, offset, ra, rb, v_p, v_q, r;
float b, c, l, t;
uint stop_count;
centre = brush.data[0].xy;
offset = brush.data[0].zw;
ra = brush.data[1].xy;
rb = brush.data[1].zw;
stop_count = asuint(brush.data[2].x);
/* Project onto ra, rb. */
r = float2(dot(ra, ra), dot(rb, rb));
v_p = position - (centre + offset);
v_p = float2(dot(v_p, ra), dot(v_p, rb)) / r;
v_q = float2(dot(offset, ra), dot(offset, rb)) / r;
/* ‖t·p̂ + q⃑‖ = 1
* (t· + q⃑) · (t· + q⃑) = 1
* t² + 2·(·q⃑)·t + (q⃑·q⃑) = 1
*
* b = ·q⃑
* c = q⃑·q⃑ - 1
* t = -b + (b² - c) */
l = length(v_p);
b = dot(v_p, v_q) / l;
c = dot(v_q, v_q) - 1.0;
t = -b + sqrt(b * b - c);
return sample_gradient(gradient, stop_count, l / t);
}
float4 brush_bitmap(struct brush brush, Texture2D t, SamplerState s, float2 position)
{
float3 transform[2];
bool ignore_alpha;
float2 texcoord;
float4 colour;
transform[0] = brush.data[0].xyz;
transform[1] = brush.data[1].xyz;
ignore_alpha = asuint(brush.data[1].w);
texcoord.x = dot(position.xy, transform[0].xy) + transform[0].z;
texcoord.y = dot(position.xy, transform[1].xy) + transform[1].z;
colour = t.Sample(s, texcoord);
if (ignore_alpha)
colour.a = 1.0;
return colour;
}
float4 sample_brush(struct brush brush, Texture2D t, SamplerState s, Buffer<float4> b, float2 position)
{
if (brush.type == BRUSH_TYPE_SOLID)
return brush.data[0] * brush.opacity;
if (brush.type == BRUSH_TYPE_LINEAR)
return brush_linear(brush, b, position) * brush.opacity;
if (brush.type == BRUSH_TYPE_RADIAL)
return brush_radial(brush, b, position) * brush.opacity;
if (brush.type == BRUSH_TYPE_BITMAP)
return brush_bitmap(brush, t, s, position) * brush.opacity;
return float4(0.0, 0.0, 0.0, brush.opacity);
}
float4 main(struct input i) : SV_Target
{
float4 colour;
colour = sample_brush(colour_brush, t0, s0, b0, i.p);
if (opacity_brush.type < BRUSH_TYPE_COUNT)
colour *= sample_brush(opacity_brush, t1, s1, b1, i.p).a;
if (outline)
{
float2 du, dv, df;
float4 uv;
/* Evaluate the implicit form of the curve (u² - v = 0
* for Béziers, u² + v² - 1 = 0 for arcs) in texture
* space, using the screen-space partial derivatives
* to convert the calculated distance to object space.
*
* d(x, y) = |f(x, y)| / f(x, y)
* = |f(x, y)| / ((f/x)² + (f/y)²)
*
* For Béziers:
* f(x, y) = u(x, y)² - v(x, y)
* f/x = 2u · u/x - v/x
* f/y = 2u · u/y - v/y
*
* For arcs:
* f(x, y) = u(x, y)² + v(x, y)² - 1
* f/x = 2u · u/x + 2v · v/x
* f/y = 2u · u/y + 2v · v/y */
uv = i.b;
du = float2(ddx(uv.x), ddy(uv.x));
dv = float2(ddx(uv.y), ddy(uv.y));
if (!is_arc)
{
df = 2.0f * uv.x * du - dv;
clip(dot(df, uv.zw));
clip(length(mul(i.stroke_transform, df)) - abs(uv.x * uv.x - uv.y));
}
else
{
df = 2.0f * uv.x * du + 2.0f * uv.y * dv;
clip(dot(df, uv.zw));
clip(length(mul(i.stroke_transform, df)) - abs(uv.x * uv.x + uv.y * uv.y - 1.0f));
}
}
else
{
/* Evaluate the implicit form of the curve in texture space.
* "i.b.z" determines which side of the curve is shaded. */
if (!is_arc)
{
clip((i.b.x * i.b.x - i.b.y) * i.b.z);
}
else
{
clip((i.b.x * i.b.x + i.b.y * i.b.y - 1.0) * i.b.z);
}
}
return colour;
}
#endif
0x43425844, 0xa8fee730, 0x92fa2196, 0xaf9f3eff, 0x888d4048, 0x00000001, 0x00002000, 0x00000003,
0x0000002c, 0x000000c4, 0x000000f8, 0x4e475349, 0x00000090, 0x00000004, 0x00000008, 0x00000068,
0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000303, 0x00000077, 0x00000000, 0x00000000,
0x00000003, 0x00000001, 0x00000f0f, 0x0000007e, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
0x00000303, 0x0000007e, 0x00000001, 0x00000000, 0x00000003, 0x00000003, 0x00000303, 0x4c524f57,
0x4f505f44, 0x49544953, 0x42004e4f, 0x45495a45, 0x54530052, 0x454b4f52, 0x4152545f, 0x4f46534e,
0xab004d52, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000,
0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00001f00,
0x00000040, 0x000007c0, 0x04000059, 0x00208e46, 0x00000000, 0x00000009, 0x0300005a, 0x00106000,
0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555,
0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04000858, 0x00107000, 0x00000002, 0x00005555,
0x04000858, 0x00107000, 0x00000003, 0x00005555, 0x03001062, 0x00101032, 0x00000000, 0x03001062,
0x001010f2, 0x00000001, 0x03000862, 0x00101032, 0x00000002, 0x03000862, 0x00101032, 0x00000003,
0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x0000000a, 0x09000038, 0x001000f2, 0x00000000,
0x00208556, 0x00000000, 0x00000001, 0x00208e46, 0x00000000, 0x00000002, 0x0404001f, 0x0020800a,
0x00000000, 0x00000001, 0x08000020, 0x00100012, 0x00000001, 0x0020800a, 0x00000000, 0x00000001,
0x00004001, 0x00000001, 0x0304001f, 0x0010000a, 0x00000001, 0x09000000, 0x00100062, 0x00000001,
0x00101106, 0x00000000, 0x80208106, 0x00000041, 0x00000000, 0x00000002, 0x0a000000, 0x00100032,
0x00000002, 0x80208046, 0x00000041, 0x00000000, 0x00000002, 0x00208ae6, 0x00000000, 0x00000002,
0x0700000f, 0x00100022, 0x00000001, 0x00100046, 0x00000002, 0x00100596, 0x00000001, 0x0700000f,
0x00100042, 0x00000001, 0x00100046, 0x00000002, 0x00100046, 0x00000002, 0x0700000e, 0x00100022,
0x00000001, 0x0010001a, 0x00000001, 0x0010002a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000002,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000002, 0x0a00002d,
0x001000f2, 0x00000003, 0x00004002, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00107e46,
0x00000002, 0x0700001d, 0x00100042, 0x00000001, 0x0010001a, 0x00000001, 0x0010000a, 0x00000002,
0x0304001f, 0x0010002a, 0x00000001, 0x05000036, 0x001000f2, 0x00000004, 0x00100e46, 0x00000003,
0x05000036, 0x001000f2, 0x00000005, 0x00100e46, 0x00000003, 0x05000036, 0x001000f2, 0x00000006,
0x00100e46, 0x00000003, 0x05000036, 0x00100042, 0x00000001, 0x0010000a, 0x00000002, 0x05000036,
0x00100082, 0x00000001, 0x00004001, 0x00000001, 0x05000036, 0x00100022, 0x00000002, 0x00004001,
0x00000000, 0x01000030, 0x08000050, 0x00100042, 0x00000002, 0x0010003a, 0x00000001, 0x0020800a,
0x00000000, 0x00000003, 0x05000036, 0x00100022, 0x00000002, 0x00004001, 0x00000000, 0x03040003,
0x0010002a, 0x00000002, 0x07000029, 0x00100042, 0x00000002, 0x0010003a, 0x00000001, 0x00004001,
0x00000001, 0x0700002d, 0x001000f2, 0x00000007, 0x00100aa6, 0x00000002, 0x00107e46, 0x00000002,
0x0700001e, 0x00100042, 0x00000002, 0x0010002a, 0x00000002, 0x00004001, 0x00000001, 0x0700002d,
0x001000f2, 0x00000008, 0x00100aa6, 0x00000002, 0x00107e46, 0x00000002, 0x0700001d, 0x00100042,
0x00000002, 0x0010001a, 0x00000001, 0x0010002a, 0x00000001, 0x0700001d, 0x00100082, 0x00000002,
0x0010000a, 0x00000007, 0x0010001a, 0x00000001, 0x07000001, 0x00100042, 0x00000002, 0x0010003a,
0x00000002, 0x0010002a, 0x00000002, 0x0304001f, 0x0010002a, 0x00000002, 0x08000000, 0x00100082,
0x00000002, 0x8010002a, 0x00000041, 0x00000001, 0x0010001a, 0x00000001, 0x08000000, 0x00100022,
0x00000007, 0x8010002a, 0x00000041, 0x00000001, 0x0010000a, 0x00000007, 0x0700000e, 0x00100082,
0x00000002, 0x0010003a, 0x00000002, 0x0010001a, 0x00000007, 0x08000000, 0x001000f2, 0x00000009,
0x80100e46, 0x00000041, 0x00000005, 0x00100e46, 0x00000008, 0x09000032, 0x001000f2, 0x00000009,
0x00100ff6, 0x00000002, 0x00100e46, 0x00000009, 0x00100e46, 0x00000005, 0x05000036, 0x001000f2,
0x00000006, 0x00100e46, 0x00000008, 0x05000036, 0x00100022, 0x00000002, 0x00004001, 0xffffffff,
0x05000036, 0x001000f2, 0x00000004, 0x00100e46, 0x00000009, 0x01000002, 0x01000015, 0x05000036,
0x001000f2, 0x00000005, 0x00100e46, 0x00000008, 0x05000036, 0x00100042, 0x00000001, 0x0010000a,
0x00000007, 0x0700001e, 0x00100082, 0x00000001, 0x0010003a, 0x00000001, 0x00004001, 0x00000001,
0x05000036, 0x001000f2, 0x00000006, 0x00100e46, 0x00000008, 0x05000036, 0x00100022, 0x00000002,
0x0010002a, 0x00000002, 0x01000016, 0x09000037, 0x001000f2, 0x00000003, 0x00100556, 0x00000002,
0x00100e46, 0x00000004, 0x00100e46, 0x00000006, 0x01000015, 0x08000038, 0x001000f2, 0x00000000,
0x00100e46, 0x00000003, 0x00208556, 0x00000000, 0x00000001, 0x01000015, 0x0300001f, 0x0010000a,
0x00000001, 0x08000020, 0x00100012, 0x00000001, 0x0020800a, 0x00000000, 0x00000001, 0x00004001,
0x00000002, 0x0304001f, 0x0010000a, 0x00000001, 0x0900000f, 0x00100012, 0x00000002, 0x00208046,
0x00000000, 0x00000003, 0x00208046, 0x00000000, 0x00000003, 0x0900000f, 0x00100022, 0x00000002,
0x00208ae6, 0x00000000, 0x00000003, 0x00208ae6, 0x00000000, 0x00000003, 0x09000000, 0x00100062,
0x00000001, 0x00208ba6, 0x00000000, 0x00000002, 0x00208106, 0x00000000, 0x00000002, 0x08000000,
0x00100062, 0x00000001, 0x80100656, 0x00000041, 0x00000001, 0x00101106, 0x00000000, 0x0800000f,
0x00100012, 0x00000003, 0x00100596, 0x00000001, 0x00208046, 0x00000000, 0x00000003, 0x0800000f,
0x00100022, 0x00000003, 0x00100596, 0x00000001, 0x00208ae6, 0x00000000, 0x00000003, 0x0700000e,
0x00100062, 0x00000001, 0x00100106, 0x00000003, 0x00100106, 0x00000002, 0x0900000f, 0x00100012,
0x00000003, 0x00208ae6, 0x00000000, 0x00000002, 0x00208046, 0x00000000, 0x00000003, 0x0900000f,
0x00100022, 0x00000003, 0x00208ae6, 0x00000000, 0x00000002, 0x00208ae6, 0x00000000, 0x00000003,
0x0700000e, 0x00100032, 0x00000002, 0x00100046, 0x00000003, 0x00100046, 0x00000002, 0x0700000f,
0x00100082, 0x00000001, 0x00100596, 0x00000001, 0x00100596, 0x00000001, 0x0500004b, 0x00100082,
0x00000001, 0x0010003a, 0x00000001, 0x0700000f, 0x00100022, 0x00000001, 0x00100596, 0x00000001,
0x00100046, 0x00000002, 0x0700000e, 0x00100022, 0x00000001, 0x0010001a, 0x00000001, 0x0010003a,
0x00000001, 0x0700000f, 0x00100042, 0x00000001, 0x00100046, 0x00000002, 0x00100046, 0x00000002,
0x07000000, 0x00100042, 0x00000001, 0x0010002a, 0x00000001, 0x00004001, 0xbf800000, 0x0a000032,
0x00100042, 0x00000001, 0x0010001a, 0x00000001, 0x0010001a, 0x00000001, 0x8010002a, 0x00000041,
0x00000001, 0x0500004b, 0x00100042, 0x00000001, 0x0010002a, 0x00000001, 0x08000000, 0x00100022,
0x00000001, 0x0010002a, 0x00000001, 0x8010001a, 0x00000041, 0x00000001, 0x0700000e, 0x00100022,
0x00000001, 0x0010003a, 0x00000001, 0x0010001a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000002,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000002, 0x0a00002d,
0x001000f2, 0x00000003, 0x00004002, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00107e46,
0x00000002, 0x0700001d, 0x00100042, 0x00000001, 0x0010001a, 0x00000001, 0x0010000a, 0x00000002,
0x0304001f, 0x0010002a, 0x00000001, 0x05000036, 0x001000f2, 0x00000004, 0x00100e46, 0x00000003,
0x05000036, 0x001000f2, 0x00000005, 0x00100e46, 0x00000003, 0x05000036, 0x001000f2, 0x00000006,
0x00100e46, 0x00000003, 0x05000036, 0x00100042, 0x00000001, 0x0010000a, 0x00000002, 0x05000036,
0x00100082, 0x00000001, 0x00004001, 0x00000001, 0x05000036, 0x00100022, 0x00000002, 0x00004001,
0x00000000, 0x01000030, 0x08000050, 0x00100042, 0x00000002, 0x0010003a, 0x00000001, 0x0020800a,
0x00000000, 0x00000004, 0x05000036, 0x00100022, 0x00000002, 0x00004001, 0x00000000, 0x03040003,
0x0010002a, 0x00000002, 0x07000029, 0x00100042, 0x00000002, 0x0010003a, 0x00000001, 0x00004001,
0x00000001, 0x0700002d, 0x001000f2, 0x00000007, 0x00100aa6, 0x00000002, 0x00107e46, 0x00000002,
0x0700001e, 0x00100042, 0x00000002, 0x0010002a, 0x00000002, 0x00004001, 0x00000001, 0x0700002d,
0x001000f2, 0x00000008, 0x00100aa6, 0x00000002, 0x00107e46, 0x00000002, 0x0700001d, 0x00100042,
0x00000002, 0x0010001a, 0x00000001, 0x0010002a, 0x00000001, 0x0700001d, 0x00100082, 0x00000002,
0x0010000a, 0x00000007, 0x0010001a, 0x00000001, 0x07000001, 0x00100042, 0x00000002, 0x0010003a,
0x00000002, 0x0010002a, 0x00000002, 0x0304001f, 0x0010002a, 0x00000002, 0x08000000, 0x00100082,
0x00000002, 0x8010002a, 0x00000041, 0x00000001, 0x0010001a, 0x00000001, 0x08000000, 0x00100022,
0x00000007, 0x8010002a, 0x00000041, 0x00000001, 0x0010000a, 0x00000007, 0x0700000e, 0x00100082,
0x00000002, 0x0010003a, 0x00000002, 0x0010001a, 0x00000007, 0x08000000, 0x001000f2, 0x00000009,
0x80100e46, 0x00000041, 0x00000005, 0x00100e46, 0x00000008, 0x09000032, 0x001000f2, 0x00000009,
0x00100ff6, 0x00000002, 0x00100e46, 0x00000009, 0x00100e46, 0x00000005, 0x05000036, 0x001000f2,
0x00000006, 0x00100e46, 0x00000008, 0x05000036, 0x00100022, 0x00000002, 0x00004001, 0xffffffff,
0x05000036, 0x001000f2, 0x00000004, 0x00100e46, 0x00000009, 0x01000002, 0x01000015, 0x05000036,
0x001000f2, 0x00000005, 0x00100e46, 0x00000008, 0x05000036, 0x00100042, 0x00000001, 0x0010000a,
0x00000007, 0x0700001e, 0x00100082, 0x00000001, 0x0010003a, 0x00000001, 0x00004001, 0x00000001,
0x05000036, 0x001000f2, 0x00000006, 0x00100e46, 0x00000008, 0x05000036, 0x00100022, 0x00000002,
0x0010002a, 0x00000002, 0x01000016, 0x09000037, 0x001000f2, 0x00000003, 0x00100556, 0x00000002,
0x00100e46, 0x00000004, 0x00100e46, 0x00000006, 0x01000015, 0x08000038, 0x001000f2, 0x00000000,
0x00100e46, 0x00000003, 0x00208556, 0x00000000, 0x00000001, 0x01000015, 0x0300001f, 0x0010000a,
0x00000001, 0x08000020, 0x00100012, 0x00000001, 0x0020800a, 0x00000000, 0x00000001, 0x00004001,
0x00000003, 0x0304001f, 0x0010000a, 0x00000001, 0x0800000f, 0x00100022, 0x00000001, 0x00101046,
0x00000000, 0x00208046, 0x00000000, 0x00000002, 0x08000000, 0x00100012, 0x00000002, 0x0010001a,
0x00000001, 0x0020802a, 0x00000000, 0x00000002, 0x0800000f, 0x00100022, 0x00000001, 0x00101046,
0x00000000, 0x00208046, 0x00000000, 0x00000003, 0x08000000, 0x00100022, 0x00000002, 0x0010001a,
0x00000001, 0x0020802a, 0x00000000, 0x00000003, 0x09000045, 0x001000f2, 0x00000002, 0x00100046,
0x00000002, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0a000037, 0x00100082, 0x00000002,
0x0020803a, 0x00000000, 0x00000003, 0x00004001, 0x3f800000, 0x0010003a, 0x00000002, 0x08000038,
0x001000f2, 0x00000000, 0x00100e46, 0x00000002, 0x00208556, 0x00000000, 0x00000001, 0x01000015,
0x05000036, 0x00100012, 0x00000002, 0x00004001, 0x00000000, 0x06000036, 0x00100082, 0x00000002,
0x0020801a, 0x00000000, 0x00000001, 0x09000037, 0x001000f2, 0x00000000, 0x00100006, 0x00000001,
0x00100e46, 0x00000000, 0x00100c06, 0x00000002, 0x01000015, 0x01000015, 0x01000015, 0x0800004f,
0x00100012, 0x00000001, 0x0020800a, 0x00000000, 0x00000005, 0x00004001, 0x00000004, 0x0304001f,
0x0010000a, 0x00000001, 0x09000038, 0x00100012, 0x00000001, 0x0020801a, 0x00000000, 0x00000005,
0x0020803a, 0x00000000, 0x00000006, 0x0404001f, 0x0020800a, 0x00000000, 0x00000005, 0x08000020,
0x00100022, 0x00000001, 0x0020800a, 0x00000000, 0x00000005, 0x00004001, 0x00000001, 0x0304001f,
0x0010001a, 0x00000001, 0x09000000, 0x001000c2, 0x00000001, 0x00101406, 0x00000000, 0x80208406,
0x00000041, 0x00000000, 0x00000006, 0x0a000000, 0x00100032, 0x00000002, 0x80208046, 0x00000041,
0x00000000, 0x00000006, 0x00208ae6, 0x00000000, 0x00000006, 0x0700000f, 0x00100042, 0x00000001,
0x00100046, 0x00000002, 0x00100ae6, 0x00000001, 0x0700000f, 0x00100082, 0x00000001, 0x00100046,
0x00000002, 0x00100046, 0x00000002, 0x0700000e, 0x00100042, 0x00000001, 0x0010002a, 0x00000001,
0x0010003a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000002, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000003, 0x0a00002d, 0x001000f2, 0x00000003, 0x00004002,
0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00107e46, 0x00000003, 0x0700001d, 0x00100082,
0x00000001, 0x0010002a, 0x00000001, 0x0010000a, 0x00000002, 0x0304001f, 0x0010003a, 0x00000001,
0x05000036, 0x00100082, 0x00000001, 0x0010003a, 0x00000003, 0x05000036, 0x00100062, 0x00000002,
0x00100ff6, 0x00000003, 0x05000036, 0x00100082, 0x00000002, 0x0010000a, 0x00000002, 0x08000036,
0x00100032, 0x00000003, 0x00004002, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x01000030,
0x08000050, 0x00100042, 0x00000003, 0x0010000a, 0x00000003, 0x0020800a, 0x00000000, 0x00000007,
0x05000036, 0x00100022, 0x00000003, 0x00004001, 0x00000000, 0x03040003, 0x0010002a, 0x00000003,
0x07000029, 0x00100042, 0x00000003, 0x0010000a, 0x00000003, 0x00004001, 0x00000001, 0x0700002d,
0x001000f2, 0x00000004, 0x00100aa6, 0x00000003, 0x00107e46, 0x00000003, 0x0700001e, 0x00100042,
0x00000003, 0x0010002a, 0x00000003, 0x00004001, 0x00000001, 0x0700002d, 0x001000f2, 0x00000005,
0x00100aa6, 0x00000003, 0x00107e46, 0x00000003, 0x0700001d, 0x00100042, 0x00000003, 0x0010002a,
0x00000001, 0x0010003a, 0x00000002, 0x0700001d, 0x00100022, 0x00000004, 0x0010000a, 0x00000004,
0x0010002a, 0x00000001, 0x07000001, 0x00100042, 0x00000003, 0x0010002a, 0x00000003, 0x0010001a,
0x00000004, 0x0304001f, 0x0010002a, 0x00000003, 0x08000000, 0x00100022, 0x00000004, 0x0010002a,
0x00000001, 0x8010003a, 0x00000041, 0x00000002, 0x08000000, 0x00100042, 0x00000004, 0x8010003a,
0x00000041, 0x00000002, 0x0010000a, 0x00000004, 0x0700000e, 0x00100022, 0x00000004, 0x0010001a,
0x00000004, 0x0010002a, 0x00000004, 0x08000000, 0x00100042, 0x00000004, 0x8010001a, 0x00000041,
0x00000002, 0x0010003a, 0x00000005, 0x09000032, 0x00100022, 0x00000004, 0x0010001a, 0x00000004,
0x0010002a, 0x00000004, 0x0010001a, 0x00000002, 0x05000036, 0x00100042, 0x00000002, 0x0010003a,
0x00000005, 0x05000036, 0x00100022, 0x00000003, 0x00004001, 0xffffffff, 0x05000036, 0x00100082,
0x00000001, 0x0010001a, 0x00000004, 0x01000002, 0x01000015, 0x05000036, 0x00100022, 0x00000002,
0x0010003a, 0x00000005, 0x05000036, 0x00100082, 0x00000002, 0x0010000a, 0x00000004, 0x0700001e,
0x00100012, 0x00000003, 0x0010000a, 0x00000003, 0x00004001, 0x00000001, 0x05000036, 0x00100042,
0x00000002, 0x0010003a, 0x00000005, 0x05000036, 0x00100032, 0x00000003, 0x00100086, 0x00000003,
0x01000016, 0x09000037, 0x00100042, 0x00000001, 0x0010001a, 0x00000003, 0x0010003a, 0x00000001,
0x0010002a, 0x00000002, 0x01000012, 0x05000036, 0x00100042, 0x00000001, 0x0010003a, 0x00000003,
0x01000015, 0x08000038, 0x00100012, 0x00000001, 0x0010002a, 0x00000001, 0x0020801a, 0x00000000,
0x00000005, 0x01000015, 0x0300001f, 0x0010001a, 0x00000001, 0x08000020, 0x00100022, 0x00000001,
0x0020800a, 0x00000000, 0x00000005, 0x00004001, 0x00000002, 0x0304001f, 0x0010001a, 0x00000001,
0x0900000f, 0x00100012, 0x00000002, 0x00208046, 0x00000000, 0x00000007, 0x00208046, 0x00000000,
0x00000007, 0x0900000f, 0x00100022, 0x00000002, 0x00208ae6, 0x00000000, 0x00000007, 0x00208ae6,
0x00000000, 0x00000007, 0x09000000, 0x001000c2, 0x00000001, 0x00208ea6, 0x00000000, 0x00000006,
0x00208406, 0x00000000, 0x00000006, 0x08000000, 0x001000c2, 0x00000001, 0x80100ea6, 0x00000041,
0x00000001, 0x00101406, 0x00000000, 0x0800000f, 0x00100012, 0x00000003, 0x00100ae6, 0x00000001,
0x00208046, 0x00000000, 0x00000007, 0x0800000f, 0x00100022, 0x00000003, 0x00100ae6, 0x00000001,
0x00208ae6, 0x00000000, 0x00000007, 0x0700000e, 0x001000c2, 0x00000001, 0x00100406, 0x00000003,
0x00100406, 0x00000002, 0x0900000f, 0x00100012, 0x00000003, 0x00208ae6, 0x00000000, 0x00000006,
0x00208046, 0x00000000, 0x00000007, 0x0900000f, 0x00100022, 0x00000003, 0x00208ae6, 0x00000000,
0x00000006, 0x00208ae6, 0x00000000, 0x00000007, 0x0700000e, 0x00100032, 0x00000002, 0x00100046,
0x00000003, 0x00100046, 0x00000002, 0x0700000f, 0x00100042, 0x00000002, 0x00100ae6, 0x00000001,
0x00100ae6, 0x00000001, 0x0500004b, 0x00100042, 0x00000002, 0x0010002a, 0x00000002, 0x0700000f,
0x00100042, 0x00000001, 0x00100ae6, 0x00000001, 0x00100046, 0x00000002, 0x0700000e, 0x00100042,
0x00000001, 0x0010002a, 0x00000001, 0x0010002a, 0x00000002, 0x0700000f, 0x00100082, 0x00000001,
0x00100046, 0x00000002, 0x00100046, 0x00000002, 0x07000000, 0x00100082, 0x00000001, 0x0010003a,
0x00000001, 0x00004001, 0xbf800000, 0x0a000032, 0x00100082, 0x00000001, 0x0010002a, 0x00000001,
0x0010002a, 0x00000001, 0x8010003a, 0x00000041, 0x00000001, 0x0500004b, 0x00100082, 0x00000001,
0x0010003a, 0x00000001, 0x08000000, 0x00100042, 0x00000001, 0x0010003a, 0x00000001, 0x8010002a,
0x00000041, 0x00000001, 0x0700000e, 0x00100042, 0x00000001, 0x0010002a, 0x00000002, 0x0010002a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000002, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000003, 0x0a00002d, 0x001000f2, 0x00000003, 0x00004002, 0x00000001,
0x00000001, 0x00000001, 0x00000001, 0x00107e46, 0x00000003, 0x0700001d, 0x00100082, 0x00000001,
0x0010002a, 0x00000001, 0x0010000a, 0x00000002, 0x0304001f, 0x0010003a, 0x00000001, 0x05000036,
0x00100082, 0x00000001, 0x0010003a, 0x00000003, 0x05000036, 0x00100062, 0x00000002, 0x00100ff6,
0x00000003, 0x05000036, 0x00100082, 0x00000002, 0x0010000a, 0x00000002, 0x08000036, 0x00100032,
0x00000003, 0x00004002, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x01000030, 0x08000050,
0x00100042, 0x00000003, 0x0010000a, 0x00000003, 0x0020800a, 0x00000000, 0x00000008, 0x05000036,
0x00100022, 0x00000003, 0x00004001, 0x00000000, 0x03040003, 0x0010002a, 0x00000003, 0x07000029,
0x00100042, 0x00000003, 0x0010000a, 0x00000003, 0x00004001, 0x00000001, 0x0700002d, 0x001000f2,
0x00000004, 0x00100aa6, 0x00000003, 0x00107e46, 0x00000003, 0x0700001e, 0x00100042, 0x00000003,
0x0010002a, 0x00000003, 0x00004001, 0x00000001, 0x0700002d, 0x001000f2, 0x00000005, 0x00100aa6,
0x00000003, 0x00107e46, 0x00000003, 0x0700001d, 0x00100042, 0x00000003, 0x0010002a, 0x00000001,
0x0010003a, 0x00000002, 0x0700001d, 0x00100022, 0x00000004, 0x0010000a, 0x00000004, 0x0010002a,
0x00000001, 0x07000001, 0x00100042, 0x00000003, 0x0010002a, 0x00000003, 0x0010001a, 0x00000004,
0x0304001f, 0x0010002a, 0x00000003, 0x08000000, 0x00100022, 0x00000004, 0x0010002a, 0x00000001,
0x8010003a, 0x00000041, 0x00000002, 0x08000000, 0x00100042, 0x00000004, 0x8010003a, 0x00000041,
0x00000002, 0x0010000a, 0x00000004, 0x0700000e, 0x00100022, 0x00000004, 0x0010001a, 0x00000004,
0x0010002a, 0x00000004, 0x08000000, 0x00100042, 0x00000004, 0x8010001a, 0x00000041, 0x00000002,
0x0010003a, 0x00000005, 0x09000032, 0x00100022, 0x00000004, 0x0010001a, 0x00000004, 0x0010002a,
0x00000004, 0x0010001a, 0x00000002, 0x05000036, 0x00100042, 0x00000002, 0x0010003a, 0x00000005,
0x05000036, 0x00100022, 0x00000003, 0x00004001, 0xffffffff, 0x05000036, 0x00100082, 0x00000001,
0x0010001a, 0x00000004, 0x01000002, 0x01000015, 0x05000036, 0x00100022, 0x00000002, 0x0010003a,
0x00000005, 0x05000036, 0x00100082, 0x00000002, 0x0010000a, 0x00000004, 0x0700001e, 0x00100012,
0x00000003, 0x0010000a, 0x00000003, 0x00004001, 0x00000001, 0x05000036, 0x00100042, 0x00000002,
0x0010003a, 0x00000005, 0x05000036, 0x00100032, 0x00000003, 0x00100086, 0x00000003, 0x01000016,
0x09000037, 0x00100042, 0x00000001, 0x0010001a, 0x00000003, 0x0010003a, 0x00000001, 0x0010002a,
0x00000002, 0x01000012, 0x05000036, 0x00100042, 0x00000001, 0x0010003a, 0x00000003, 0x01000015,
0x08000038, 0x00100012, 0x00000001, 0x0010002a, 0x00000001, 0x0020801a, 0x00000000, 0x00000005,
0x01000015, 0x0300001f, 0x0010001a, 0x00000001, 0x08000020, 0x00100022, 0x00000001, 0x0020800a,
0x00000000, 0x00000005, 0x00004001, 0x00000003, 0x0304001f, 0x0010001a, 0x00000001, 0x0800000f,
0x00100042, 0x00000001, 0x00101046, 0x00000000, 0x00208046, 0x00000000, 0x00000006, 0x08000000,
0x00100012, 0x00000002, 0x0010002a, 0x00000001, 0x0020802a, 0x00000000, 0x00000006, 0x0800000f,
0x00100042, 0x00000001, 0x00101046, 0x00000000, 0x00208046, 0x00000000, 0x00000007, 0x08000000,
0x00100022, 0x00000002, 0x0010002a, 0x00000001, 0x0020802a, 0x00000000, 0x00000007, 0x09000045,
0x001000f2, 0x00000002, 0x00100046, 0x00000002, 0x00107e46, 0x00000001, 0x00106000, 0x00000001,
0x0a000037, 0x00100042, 0x00000001, 0x0020803a, 0x00000000, 0x00000007, 0x00004001, 0x3f800000,
0x0010003a, 0x00000002, 0x08000038, 0x00100012, 0x00000001, 0x0010002a, 0x00000001, 0x0020801a,
0x00000000, 0x00000005, 0x01000015, 0x0a000037, 0x00100012, 0x00000001, 0x0010001a, 0x00000001,
0x0010000a, 0x00000001, 0x0020801a, 0x00000000, 0x00000005, 0x01000015, 0x01000015, 0x01000015,
0x07000038, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, 0x00000001, 0x01000012,
0x05000036, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x01000015, 0x0404001f, 0x0020800a,
0x00000000, 0x00000000, 0x0500000b, 0x00100032, 0x00000000, 0x00101046, 0x00000001, 0x0500000c,
0x001000c2, 0x00000000, 0x00101406, 0x00000001, 0x08000027, 0x00100012, 0x00000001, 0x0020801a,
0x00000000, 0x00000000, 0x00004001, 0x00000000, 0x0500003b, 0x00100022, 0x00000001, 0x0010000a,
0x00000001, 0x07000000, 0x001000c2, 0x00000001, 0x00101406, 0x00000001, 0x00101406, 0x00000001,
0x07000038, 0x001000f2, 0x00000002, 0x00100d86, 0x00000000, 0x00100fa6, 0x00000001, 0x0a000032,
0x00100032, 0x00000000, 0x00100aa6, 0x00000001, 0x00100086, 0x00000000, 0x801005d6, 0x00000041,
0x00000000, 0x0700000f, 0x00100042, 0x00000000, 0x00100046, 0x00000000, 0x00101ae6, 0x00000001,
0x07000031, 0x00100042, 0x00000000, 0x0010002a, 0x00000000, 0x00004001, 0x00000000, 0x07000001,
0x00100042, 0x00000000, 0x0010001a, 0x00000001, 0x0010002a, 0x00000000, 0x0304000d, 0x0010002a,
0x00000000, 0x07000038, 0x00100062, 0x00000000, 0x00100556, 0x00000000, 0x00101106, 0x00000003,
0x09000032, 0x00100032, 0x00000000, 0x00101046, 0x00000002, 0x00100006, 0x00000000, 0x00100596,
0x00000000, 0x0700000f, 0x00100012, 0x00000000, 0x00100046, 0x00000000, 0x00100046, 0x00000000,
0x0500004b, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x07000038, 0x00100062, 0x00000000,
0x00101106, 0x00000001, 0x00101106, 0x00000001, 0x0a000032, 0x00100082, 0x00000000, 0x0010100a,
0x00000001, 0x0010100a, 0x00000001, 0x8010101a, 0x00000041, 0x00000001, 0x08000000, 0x00100012,
0x00000000, 0x8010003a, 0x000000c1, 0x00000000, 0x0010000a, 0x00000000, 0x07000031, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x00000000, 0x07000001, 0x00100012, 0x00000000,
0x0010001a, 0x00000001, 0x0010000a, 0x00000000, 0x0304000d, 0x0010000a, 0x00000000, 0x07000000,
0x00100092, 0x00000000, 0x00100ea6, 0x00000002, 0x00100406, 0x00000002, 0x0700000f, 0x00100022,
0x00000001, 0x001000c6, 0x00000000, 0x00101ae6, 0x00000001, 0x07000031, 0x00100022, 0x00000001,
0x0010001a, 0x00000001, 0x00004001, 0x00000000, 0x07000001, 0x00100022, 0x00000001, 0x0010000a,
0x00000001, 0x0010001a, 0x00000001, 0x0304000d, 0x0010001a, 0x00000001, 0x07000038, 0x00100062,
0x00000001, 0x00100ff6, 0x00000000, 0x00101106, 0x00000003, 0x09000032, 0x00100092, 0x00000000,
0x00101406, 0x00000002, 0x00100006, 0x00000000, 0x00100956, 0x00000001, 0x0700000f, 0x00100012,
0x00000000, 0x001000c6, 0x00000000, 0x001000c6, 0x00000000, 0x0500004b, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x07000000, 0x00100022, 0x00000000, 0x0010002a, 0x00000000, 0x0010001a,
0x00000000, 0x07000000, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x00004001, 0xbf800000,
0x08000000, 0x00100012, 0x00000000, 0x8010001a, 0x000000c1, 0x00000000, 0x0010000a, 0x00000000,
0x07000031, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x00004001, 0x00000000, 0x07000001,
0x00100012, 0x00000000, 0x0010000a, 0x00000001, 0x0010000a, 0x00000000, 0x0304000d, 0x0010000a,
0x00000000, 0x01000012, 0x08000027, 0x00100012, 0x00000000, 0x0020801a, 0x00000000, 0x00000000,
0x00004001, 0x00000000, 0x0500003b, 0x00100022, 0x00000000, 0x0010000a, 0x00000000, 0x07000038,
0x001000c2, 0x00000000, 0x00101406, 0x00000001, 0x00101406, 0x00000001, 0x0a000032, 0x00100012,
0x00000001, 0x0010100a, 0x00000001, 0x0010100a, 0x00000001, 0x8010101a, 0x00000041, 0x00000001,
0x07000038, 0x00100012, 0x00000001, 0x0010000a, 0x00000001, 0x0010102a, 0x00000001, 0x07000031,
0x00100012, 0x00000001, 0x0010000a, 0x00000001, 0x00004001, 0x00000000, 0x07000001, 0x00100022,
0x00000000, 0x0010001a, 0x00000000, 0x0010000a, 0x00000001, 0x0304000d, 0x0010001a, 0x00000000,
0x07000000, 0x00100022, 0x00000000, 0x0010003a, 0x00000000, 0x0010002a, 0x00000000, 0x07000000,
0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x00004001, 0xbf800000, 0x07000038, 0x00100022,
0x00000000, 0x0010001a, 0x00000000, 0x0010102a, 0x00000001, 0x07000031, 0x00100022, 0x00000000,
0x0010001a, 0x00000000, 0x00004001, 0x00000000, 0x07000001, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010001a, 0x00000000, 0x0304000d, 0x0010000a, 0x00000000, 0x01000015, 0x0100003e,
};
static const char ps_code[] =
"#define BRUSH_TYPE_SOLID 0\n"
"#define BRUSH_TYPE_LINEAR 1\n"
"#define BRUSH_TYPE_RADIAL 2\n"
"#define BRUSH_TYPE_BITMAP 3\n"
"#define BRUSH_TYPE_COUNT 4\n"
"\n"
"bool outline;\n"
"bool is_arc;\n"
"struct brush\n"
"{\n"
" uint type;\n"
" float opacity;\n"
" float4 data[3];\n"
"} colour_brush, opacity_brush;\n"
"\n"
"SamplerState s0, s1;\n"
"Texture2D t0, t1;\n"
"Buffer<float4> b0, b1;\n"
"\n"
"struct input\n"
"{\n"
" float2 p : WORLD_POSITION;\n"
" float4 b : BEZIER;\n"
" nointerpolation float2x2 stroke_transform : STROKE_TRANSFORM;\n"
"};\n"
"\n"
"float4 sample_gradient(Buffer<float4> gradient, uint stop_count, float position)\n"
"{\n"
" float4 c_low, c_high;\n"
" float p_low, p_high;\n"
" uint i;\n"
"\n"
" p_low = gradient.Load(0).x;\n"
" c_low = gradient.Load(1);\n"
" c_high = c_low;\n"
"\n"
" if (position < p_low)\n"
" return c_low;\n"
"\n"
" for (i = 1; i < stop_count; ++i)\n"
" {\n"
" p_high = gradient.Load(i * 2).x;\n"
" c_high = gradient.Load(i * 2 + 1);\n"
"\n"
" if (position >= p_low && position <= p_high)\n"
" return lerp(c_low, c_high, (position - p_low) / (p_high - p_low));\n"
"\n"
" p_low = p_high;\n"
" c_low = c_high;\n"
" }\n"
"\n"
" return c_high;\n"
"}\n"
"\n"
"float4 brush_linear(struct brush brush, Buffer<float4> gradient, float2 position)\n"
"{\n"
" float2 start, end, v_p, v_q;\n"
" uint stop_count;\n"
" float p;\n"
"\n"
" start = brush.data[0].xy;\n"
" end = brush.data[0].zw;\n"
" stop_count = asuint(brush.data[1].x);\n"
"\n"
" v_p = position - start;\n"
" v_q = end - start;\n"
" p = dot(v_q, v_p) / dot(v_q, v_q);\n"
"\n"
" return sample_gradient(gradient, stop_count, p);\n"
"}\n"
"\n"
"float4 brush_radial(struct brush brush, Buffer<float4> gradient, float2 position)\n"
"{\n"
" float2 centre, offset, ra, rb, v_p, v_q, r;\n"
" float b, c, l, t;\n"
" uint stop_count;\n"
"\n"
" centre = brush.data[0].xy;\n"
" offset = brush.data[0].zw;\n"
" ra = brush.data[1].xy;\n"
" rb = brush.data[1].zw;\n"
" stop_count = asuint(brush.data[2].x);\n"
"\n"
" /* Project onto ra, rb. */\n"
" r = float2(dot(ra, ra), dot(rb, rb));\n"
" v_p = position - (centre + offset);\n"
" v_p = float2(dot(v_p, ra), dot(v_p, rb)) / r;\n"
" v_q = float2(dot(offset, ra), dot(offset, rb)) / r;\n"
"\n"
" /* ‖t·p̂ + q⃑‖ = 1\n"
" * (t·p̂ + q⃑) · (t·p̂ + q⃑) = 1\n"
" * t² + 2·(p̂·q⃑)·t + (q⃑·q⃑) = 1\n"
" *\n"
" * b = p̂·q⃑\n"
" * c = q⃑·q⃑ - 1\n"
" * t = -b + √(b² - c) */\n"
" l = length(v_p);\n"
" b = dot(v_p, v_q) / l;\n"
" c = dot(v_q, v_q) - 1.0;\n"
" t = -b + sqrt(b * b - c);\n"
"\n"
" return sample_gradient(gradient, stop_count, l / t);\n"
"}\n"
"\n"
"float4 brush_bitmap(struct brush brush, Texture2D t, SamplerState s, float2 position)\n"
"{\n"
" float3 transform[2];\n"
" bool ignore_alpha;\n"
" float2 texcoord;\n"
" float4 colour;\n"
"\n"
" transform[0] = brush.data[0].xyz;\n"
" transform[1] = brush.data[1].xyz;\n"
" ignore_alpha = asuint(brush.data[1].w);\n"
"\n"
" texcoord.x = dot(position.xy, transform[0].xy) + transform[0].z;\n"
" texcoord.y = dot(position.xy, transform[1].xy) + transform[1].z;\n"
" colour = t.Sample(s, texcoord);\n"
" if (ignore_alpha)\n"
" colour.a = 1.0;\n"
" return colour;\n"
"}\n"
"\n"
"float4 sample_brush(struct brush brush, Texture2D t, SamplerState s, Buffer<float4> b, float2 position)\n"
"{\n"
" if (brush.type == BRUSH_TYPE_SOLID)\n"
" return brush.data[0] * brush.opacity;\n"
" if (brush.type == BRUSH_TYPE_LINEAR)\n"
" return brush_linear(brush, b, position) * brush.opacity;\n"
" if (brush.type == BRUSH_TYPE_RADIAL)\n"
" return brush_radial(brush, b, position) * brush.opacity;\n"
" if (brush.type == BRUSH_TYPE_BITMAP)\n"
" return brush_bitmap(brush, t, s, position) * brush.opacity;\n"
" return float4(0.0, 0.0, 0.0, brush.opacity);\n"
"}\n"
"\n"
"float4 main(struct input i) : SV_Target\n"
"{\n"
" float4 colour;\n"
"\n"
" colour = sample_brush(colour_brush, t0, s0, b0, i.p);\n"
" if (opacity_brush.type < BRUSH_TYPE_COUNT)\n"
" colour *= sample_brush(opacity_brush, t1, s1, b1, i.p).a;\n"
"\n"
" if (outline)\n"
" {\n"
" float2 du, dv, df;\n"
" float4 uv;\n"
"\n"
" /* Evaluate the implicit form of the curve (u² - v = 0\n"
" * for Béziers, u² + v² - 1 = 0 for arcs) in texture\n"
" * space, using the screen-space partial derivatives\n"
" * to convert the calculated distance to object space.\n"
" *\n"
" * d(x, y) = |f(x, y)| / ‖∇f(x, y)‖\n"
" * = |f(x, y)| / √((∂f/∂x)² + (∂f/∂y)²)\n"
" *\n"
" * For Béziers:\n"
" * f(x, y) = u(x, y)² - v(x, y)\n"
" * ∂f/∂x = 2u · ∂u/∂x - ∂v/∂x\n"
" * ∂f/∂y = 2u · ∂u/∂y - ∂v/∂y\n"
" *\n"
" * For arcs:\n"
" * f(x, y) = u(x, y)² + v(x, y)² - 1\n"
" * ∂f/∂x = 2u · ∂u/∂x + 2v · ∂v/∂x\n"
" * ∂f/∂y = 2u · ∂u/∂y + 2v · ∂v/∂y */\n"
" uv = i.b;\n"
" du = float2(ddx(uv.x), ddy(uv.x));\n"
" dv = float2(ddx(uv.y), ddy(uv.y));\n"
"\n"
" if (!is_arc)\n"
" {\n"
" df = 2.0f * uv.x * du - dv;\n"
"\n"
" clip(dot(df, uv.zw));\n"
" clip(length(mul(i.stroke_transform, df)) - abs(uv.x * uv.x - uv.y));\n"
" }\n"
" else\n"
" {\n"
" df = 2.0f * uv.x * du + 2.0f * uv.y * dv;\n"
"\n"
" clip(dot(df, uv.zw));\n"
" clip(length(mul(i.stroke_transform, df)) - abs(uv.x * uv.x + uv.y * uv.y - 1.0f));\n"
" }\n"
" }\n"
" else\n"
" {\n"
" /* Evaluate the implicit form of the curve in texture space.\n"
" * \"i.b.z\" determines which side of the curve is shaded. */\n"
" if (!is_arc)\n"
" {\n"
" clip((i.b.x * i.b.x - i.b.y) * i.b.z);\n"
" }\n"
" else\n"
" {\n"
" clip((i.b.x * i.b.x + i.b.y * i.b.y - 1.0) * i.b.z);\n"
" }\n"
" }\n"
"\n"
" return colour;\n"
"}\n";
static const struct shape_info
{
enum d2d_shape_type shape_type;
@ -4005,7 +3746,6 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target,
for (i = 0; i < ARRAY_SIZE(shape_info); ++i)
{
const struct shape_info *si = &shape_info[i];
ID3D10Blob *compiled;
if (FAILED(hr = D3DCompile(si->vs_code, si->vs_code_size, si->name, NULL, NULL,
"main", "vs_4_0", 0, 0, &compiled, NULL)))
@ -4048,13 +3788,23 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target,
goto err;
}
if (FAILED(hr = ID3D11Device1_CreatePixelShader(render_target->d3d_device,
ps_code, sizeof(ps_code), NULL, &render_target->ps)))
if (FAILED(hr = D3DCompile(ps_code, sizeof(ps_code) - 1, "ps", NULL, NULL, "main", "ps_4_0", 0, 0, &compiled, NULL)))
{
WARN("Failed to create pixel shader, hr %#lx.\n", hr);
WARN("Failed to compile the pixel shader, hr %#lx.\n", hr);
goto err;
}
if (FAILED(hr = ID3D11Device1_CreatePixelShader(render_target->d3d_device,
ID3D10Blob_GetBufferPointer(compiled), ID3D10Blob_GetBufferSize(compiled),
NULL, &render_target->ps)))
{
WARN("Failed to create pixel shader, hr %#lx.\n", hr);
ID3D10Blob_Release(compiled);
goto err;
}
ID3D10Blob_Release(compiled);
buffer_desc.ByteWidth = sizeof(struct d2d_ps_cb);
buffer_desc.Usage = D3D11_USAGE_DYNAMIC;
buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
@ -4224,7 +3974,6 @@ HRESULT d2d_d3d_create_render_target(struct d2d_device *device, IDXGISurface *su
{
WARN("Failed to create target bitmap, hr %#lx.\n", hr);
IUnknown_Release(&object->IUnknown_iface);
free(object);
return hr;
}

View file

@ -211,7 +211,7 @@ static HRESULT STDMETHODCALLTYPE builtin_factory_stub(IUnknown **effect_impl)
return S_OK;
}
static const WCHAR * const _2d_affine_transform_description =
static const WCHAR _2d_affine_transform_description[] =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='2D Affine Transform'/> \
@ -223,7 +223,7 @@ L"<?xml version='1.0'?> \
</Inputs> \
</Effect>";
static const WCHAR * const _3d_perspective_transform_description =
static const WCHAR _3d_perspective_transform_description[] =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='3D Perspective Transform'/> \
@ -235,7 +235,7 @@ L"<?xml version='1.0'?>
</Inputs> \
</Effect>";
static const WCHAR * const composite_description =
static const WCHAR composite_description[] =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='Composite'/> \
@ -248,7 +248,7 @@ L"<?xml version='1.0'?> \
</Inputs> \
</Effect>";
static const WCHAR * const crop_description =
static const WCHAR crop_description[] =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='Crop'/> \
@ -260,7 +260,7 @@ L"<?xml version='1.0'?> \
</Inputs> \
</Effect>";
static const WCHAR * const shadow_description =
static const WCHAR shadow_description[] =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='Shadow'/> \
@ -272,7 +272,7 @@ L"<?xml version='1.0'?> \
</Inputs> \
</Effect>";
static const WCHAR * const grayscale_description =
static const WCHAR grayscale_description[] =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='Grayscale'/> \
@ -361,25 +361,25 @@ static HRESULT d2d_effect_properties_internal_add(struct d2d_effect_properties *
{
static const UINT32 sizes[] =
{
0, /* D2D1_PROPERTY_TYPE_UNKNOWN */
0, /* D2D1_PROPERTY_TYPE_STRING */
sizeof(BOOL), /* D2D1_PROPERTY_TYPE_BOOL */
sizeof(UINT32), /* D2D1_PROPERTY_TYPE_UINT32 */
sizeof(INT32), /* D2D1_PROPERTY_TYPE_INT32 */
sizeof(float), /* D2D1_PROPERTY_TYPE_FLOAT */
2 * sizeof(float), /* D2D1_PROPERTY_TYPE_VECTOR2 */
3 * sizeof(float), /* D2D1_PROPERTY_TYPE_VECTOR3 */
4 * sizeof(float), /* D2D1_PROPERTY_TYPE_VECTOR4 */
0, /* FIXME: D2D1_PROPERTY_TYPE_BLOB */
sizeof(void *), /* D2D1_PROPERTY_TYPE_IUNKNOWN */
sizeof(UINT32), /* D2D1_PROPERTY_TYPE_ENUM */
sizeof(UINT32), /* D2D1_PROPERTY_TYPE_ARRAY */
sizeof(CLSID), /* D2D1_PROPERTY_TYPE_CLSID */
6 * sizeof(float), /* D2D1_PROPERTY_TYPE_MATRIX_3X2 */
12 * sizeof(float), /* D2D1_PROPERTY_TYPE_MATRIX_4X3 */
16 * sizeof(float), /* D2D1_PROPERTY_TYPE_MATRIX_4X4 */
20 * sizeof(float), /* D2D1_PROPERTY_TYPE_MATRIX_5X4 */
sizeof(void *), /* D2D1_PROPERTY_TYPE_COLOR_CONTEXT */
[D2D1_PROPERTY_TYPE_UNKNOWN] = 0,
[D2D1_PROPERTY_TYPE_STRING] = 0,
[D2D1_PROPERTY_TYPE_BOOL] = sizeof(BOOL),
[D2D1_PROPERTY_TYPE_UINT32] = sizeof(UINT32),
[D2D1_PROPERTY_TYPE_INT32] = sizeof(INT32),
[D2D1_PROPERTY_TYPE_FLOAT] = sizeof(float),
[D2D1_PROPERTY_TYPE_VECTOR2] = sizeof(D2D_VECTOR_2F),
[D2D1_PROPERTY_TYPE_VECTOR3] = sizeof(D2D_VECTOR_3F),
[D2D1_PROPERTY_TYPE_VECTOR4] = sizeof(D2D_VECTOR_4F),
[D2D1_PROPERTY_TYPE_BLOB] = 0 /* FIXME */,
[D2D1_PROPERTY_TYPE_IUNKNOWN] = sizeof(IUnknown *),
[D2D1_PROPERTY_TYPE_ENUM] = sizeof(UINT32),
[D2D1_PROPERTY_TYPE_ARRAY] = sizeof(UINT32),
[D2D1_PROPERTY_TYPE_CLSID] = sizeof(CLSID),
[D2D1_PROPERTY_TYPE_MATRIX_3X2] = sizeof(D2D_MATRIX_3X2_F),
[D2D1_PROPERTY_TYPE_MATRIX_4X3] = sizeof(D2D_MATRIX_4X3_F),
[D2D1_PROPERTY_TYPE_MATRIX_4X4] = sizeof(D2D_MATRIX_4X4_F),
[D2D1_PROPERTY_TYPE_MATRIX_5X4] = sizeof(D2D_MATRIX_5X4_F),
[D2D1_PROPERTY_TYPE_COLOR_CONTEXT] = sizeof(ID2D1ColorContext *),
};
struct d2d_effect_property *p;
HRESULT hr;
@ -813,7 +813,7 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadPixelShader(ID2D1EffectC
TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
iface, debugstr_guid(shader_id), buffer, buffer_size);
if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
if (d2d_device_is_shader_loaded(effect_context->device_context->device, shader_id))
return S_OK;
if (FAILED(hr = ID3D11Device1_CreatePixelShader(effect_context->device_context->d3d_device,
@ -839,7 +839,7 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1Effect
TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
iface, debugstr_guid(shader_id), buffer, buffer_size);
if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
if (d2d_device_is_shader_loaded(effect_context->device_context->device, shader_id))
return S_OK;
if (FAILED(hr = ID3D11Device1_CreateVertexShader(effect_context->device_context->d3d_device,
@ -865,7 +865,7 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadComputeShader(ID2D1Effec
TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
iface, debugstr_guid(shader_id), buffer, buffer_size);
if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
if (d2d_device_is_shader_loaded(effect_context->device_context->device, shader_id))
return S_OK;
if (FAILED(hr = ID3D11Device1_CreateComputeShader(effect_context->device_context->d3d_device,

View file

@ -677,25 +677,25 @@ static HRESULT parse_effect_get_property_type(IXmlReader *reader, D2D1_PROPERTY_
{
static const WCHAR *types[] =
{
L"", /* D2D1_PROPERTY_TYPE_UNKNOWN */
L"string", /* D2D1_PROPERTY_TYPE_STRING */
L"bool", /* D2D1_PROPERTY_TYPE_BOOL */
L"uint32", /* D2D1_PROPERTY_TYPE_UINT32 */
L"int32", /* D2D1_PROPERTY_TYPE_INT32 */
L"float", /* D2D1_PROPERTY_TYPE_FLOAT */
L"vector2", /* D2D1_PROPERTY_TYPE_VECTOR2 */
L"vector3", /* D2D1_PROPERTY_TYPE_VECTOR3 */
L"vector4", /* D2D1_PROPERTY_TYPE_VECTOR4 */
L"blob", /* D2D1_PROPERTY_TYPE_BLOB */
L"iunknown", /* D2D1_PROPERTY_TYPE_IUNKNOWN */
L"enum", /* D2D1_PROPERTY_TYPE_ENUM */
L"array", /* D2D1_PROPERTY_TYPE_ARRAY */
L"clsid", /* D2D1_PROPERTY_TYPE_CLSID */
L"matrix3x2", /* D2D1_PROPERTY_TYPE_MATRIX_3X2 */
L"matrix4x3", /* D2D1_PROPERTY_TYPE_MATRIX_4X3 */
L"matrix4x4", /* D2D1_PROPERTY_TYPE_MATRIX_4X4 */
L"matrix5x4", /* D2D1_PROPERTY_TYPE_MATRIX_5X4 */
L"colorcontext", /* D2D1_PROPERTY_TYPE_COLOR_CONTEXT */
[D2D1_PROPERTY_TYPE_UNKNOWN] = L"",
[D2D1_PROPERTY_TYPE_STRING] = L"string",
[D2D1_PROPERTY_TYPE_BOOL] = L"bool",
[D2D1_PROPERTY_TYPE_UINT32] = L"uint32",
[D2D1_PROPERTY_TYPE_INT32] = L"int32",
[D2D1_PROPERTY_TYPE_FLOAT] = L"float",
[D2D1_PROPERTY_TYPE_VECTOR2] = L"vector2",
[D2D1_PROPERTY_TYPE_VECTOR3] = L"vector3",
[D2D1_PROPERTY_TYPE_VECTOR4] = L"vector4",
[D2D1_PROPERTY_TYPE_BLOB] = L"blob",
[D2D1_PROPERTY_TYPE_IUNKNOWN] = L"iunknown",
[D2D1_PROPERTY_TYPE_ENUM] = L"enum",
[D2D1_PROPERTY_TYPE_ARRAY] = L"array",
[D2D1_PROPERTY_TYPE_CLSID] = L"clsid",
[D2D1_PROPERTY_TYPE_MATRIX_3X2] = L"matrix3x2",
[D2D1_PROPERTY_TYPE_MATRIX_4X3] = L"matrix4x3",
[D2D1_PROPERTY_TYPE_MATRIX_4X4] = L"matrix4x4",
[D2D1_PROPERTY_TYPE_MATRIX_5X4] = L"matrix5x4",
[D2D1_PROPERTY_TYPE_COLOR_CONTEXT] = L"colorcontext",
};
unsigned int i;
WCHAR *value;

View file

@ -1,5 +1,5 @@
TESTDLL = d2d1.dll
IMPORTS = d2d1 d3d10_1 d3d11 dwrite dxguid uuid user32 advapi32 ole32 gdi32
IMPORTS = d2d1 d3d10_1 d3d11 dwrite dxguid uuid user32 advapi32 ole32 gdi32 d3dcompiler
SOURCES = \
d2d1.c

View file

@ -20,6 +20,7 @@
#include <limits.h>
#include <math.h>
#include <float.h>
#include "d3dcompiler.h"
#include "d2d1_3.h"
#include "d2d1effectauthor.h"
#include "d3d11.h"
@ -247,38 +248,17 @@ L"<?xml version='1.0'?> \
</Effect> \
";
static const DWORD test_vs[] =
{
#if 0
void main(float4 pos : Position, out float4 output : SV_Position)
{
output = pos;
}
#endif
0x43425844, 0xa84b398b, 0xc4047d32, 0xc19c67bb, 0x4644285e, 0x00000001, 0x000000d8, 0x00000003,
0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x69736f50, 0x6e6f6974, 0xababab00,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003,
0x00000000, 0x0000000f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x52444853, 0x0000003c, 0x00010040,
0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001,
0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e,
};
static const char test_vs_code[] =
"void main(float4 pos : Position, out float4 output : SV_Position)\n"
"{\n"
" output = pos;\n"
"}";
static const DWORD test_ps[] =
{
#if 0
float4 main() : SV_Target
{
return float4(0.1, 0.2, 0.3, 0.4);
}
#endif
0x43425844, 0xf34300ae, 0x22fc6d56, 0x5cca66fa, 0x86ae3266, 0x00000001, 0x000000b0, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e,
0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 0x3dcccccd,
0x3e4ccccd, 0x3e99999a, 0x3ecccccd, 0x0100003e,
};
static const char test_ps_code[] =
"float4 main() : SV_Target\n"
"{\n"
" return float4(0.1, 0.2, 0.3, 0.4);\n"
"}";
static HRESULT (WINAPI *pD2D1CreateDevice)(IDXGIDevice *dxgi_device,
const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device);
@ -377,10 +357,12 @@ struct expected_geometry_figure
struct effect_impl
{
ID2D1EffectImpl ID2D1EffectImpl_iface;
ID2D1DrawTransform ID2D1DrawTransform_iface;
LONG refcount;
UINT integer;
ID2D1EffectContext *effect_context;
ID2D1TransformGraph *transform_graph;
ID2D1DrawInfo *draw_info;
};
static void queue_d3d1x_test(void (*test)(BOOL d3d11), BOOL d3d11)
@ -10822,7 +10804,7 @@ static void test_mt_factory(BOOL d3d11)
ID2D1Multithread_Enter(multithread);
thread = CreateThread(NULL, 0, mt_factory_test_thread_draw_func, ctx.rt, 0, NULL);
ok(!!thread, "Failed to create a thread.\n");
ret = WaitForSingleObject(thread, 1000);
ret = WaitForSingleObject(thread, 5000);
ok(ret == WAIT_OBJECT_0, "Didn't expect timeout.\n");
ID2D1Multithread_Leave(multithread);
WaitForSingleObject(thread, INFINITE);
@ -11114,8 +11096,15 @@ static inline struct effect_impl *impl_from_ID2D1EffectImpl(ID2D1EffectImpl *ifa
return CONTAINING_RECORD(iface, struct effect_impl, ID2D1EffectImpl_iface);
}
static inline struct effect_impl *impl_from_ID2D1DrawTransform(ID2D1DrawTransform *iface)
{
return CONTAINING_RECORD(iface, struct effect_impl, ID2D1DrawTransform_iface);
}
static HRESULT STDMETHODCALLTYPE effect_impl_QueryInterface(ID2D1EffectImpl *iface, REFIID iid, void **out)
{
struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface);
if (IsEqualGUID(iid, &IID_ID2D1EffectImpl)
|| IsEqualGUID(iid, &IID_IUnknown))
{
@ -11123,6 +11112,14 @@ static HRESULT STDMETHODCALLTYPE effect_impl_QueryInterface(ID2D1EffectImpl *ifa
*out = iface;
return S_OK;
}
else if (IsEqualGUID(iid, &IID_ID2D1DrawTransform)
|| IsEqualGUID(iid, &IID_ID2D1Transform)
|| IsEqualGUID(iid, &IID_ID2D1TransformNode))
{
ID2D1EffectImpl_AddRef(iface);
*out = &effect_impl->ID2D1DrawTransform_iface;
return S_OK;
}
*out = NULL;
return E_NOINTERFACE;
@ -11144,6 +11141,8 @@ static ULONG STDMETHODCALLTYPE effect_impl_Release(ID2D1EffectImpl *iface)
{
if (effect_impl->effect_context)
ID2D1EffectContext_Release(effect_impl->effect_context);
if (effect_impl->draw_info)
ID2D1DrawInfo_Release(effect_impl->draw_info);
free(effect_impl);
}
@ -11525,6 +11524,7 @@ static void test_effect_context(BOOL d3d11)
struct d2d1_test_context ctx;
ID2D1Factory1 *factory;
ID2D1Device *device;
ID3D10Blob *vs, *ps;
ULONG refcount;
BOOL loaded;
HRESULT hr;
@ -11540,6 +11540,14 @@ static void test_effect_context(BOOL d3d11)
return;
}
hr = D3DCompile(test_vs_code, sizeof(test_vs_code) - 1, "test_vs", NULL, NULL,
"main", "vs_4_0", 0, 0, &vs, NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = D3DCompile(test_ps_code, sizeof(test_ps_code) - 1, "test_ps", NULL, NULL,
"main", "ps_4_0", 0, 0, &ps, NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
binding.propertyName = L"Context";
binding.setFunction = NULL;
binding.getFunction = effect_impl_get_context;
@ -11562,26 +11570,26 @@ static void test_effect_context(BOOL d3d11)
ok(!loaded, "Unexpected shader loaded state.\n");
hr = ID2D1EffectContext_LoadVertexShader(effect_context,
&GUID_TestVertexShader, (const BYTE *)test_ps, sizeof(test_ps));
&GUID_TestVertexShader, ID3D10Blob_GetBufferPointer(ps), ID3D10Blob_GetBufferSize(ps));
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1EffectContext_LoadVertexShader(effect_context,
&GUID_TestVertexShader, (const BYTE *)test_vs, sizeof(test_vs));
&GUID_TestVertexShader, ID3D10Blob_GetBufferPointer(vs), ID3D10Blob_GetBufferSize(vs));
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
loaded = ID2D1EffectContext_IsShaderLoaded(effect_context, &GUID_TestVertexShader);
ok(loaded, "Unexpected shader loaded state.\n");
hr = ID2D1EffectContext_LoadVertexShader(effect_context,
&GUID_TestVertexShader, (const BYTE *)test_ps, sizeof(test_ps));
&GUID_TestVertexShader, ID3D10Blob_GetBufferPointer(ps), ID3D10Blob_GetBufferSize(ps));
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1EffectContext_LoadVertexShader(effect_context,
&GUID_TestVertexShader, (const BYTE *)test_vs, sizeof(test_vs));
&GUID_TestVertexShader, ID3D10Blob_GetBufferPointer(vs), ID3D10Blob_GetBufferSize(vs));
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1EffectContext_LoadPixelShader(effect_context,
&GUID_TestPixelShader, (const BYTE *)test_vs, sizeof(test_vs));
&GUID_TestPixelShader, ID3D10Blob_GetBufferPointer(vs), ID3D10Blob_GetBufferSize(vs));
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1EffectContext_LoadPixelShader(effect_context,
&GUID_TestPixelShader, (const BYTE *)test_ps, sizeof(test_ps));
&GUID_TestPixelShader, ID3D10Blob_GetBufferPointer(ps), ID3D10Blob_GetBufferSize(ps));
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
loaded = ID2D1EffectContext_IsShaderLoaded(effect_context, &GUID_TestPixelShader);
ok(loaded, "Unexpected shader loaded state.\n");
@ -11642,6 +11650,10 @@ static void test_effect_context(BOOL d3d11)
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ID3D10Blob_Release(vs);
ID3D10Blob_Release(ps);
release_test_context(&ctx);
}
@ -14254,6 +14266,224 @@ static void test_dc_target_is_supported(BOOL d3d11)
release_test_context(&ctx);
}
static HRESULT STDMETHODCALLTYPE ps_effect_impl_Initialize(ID2D1EffectImpl *iface,
ID2D1EffectContext *context, ID2D1TransformGraph *graph)
{
static const char ps_code[] =
"float4 main() : sv_target\n"
"{\n"
" return float4(0.1, 0.2, 0.3, 0.4);\n"
"}";
struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface);
ID3D10Blob *blob;
HRESULT hr;
effect_impl->effect_context = context;
ID2D1EffectContext_AddRef(effect_impl->effect_context);
hr = D3DCompile(ps_code, strlen(ps_code), "test_ps", NULL, NULL, "main",
"ps_4_0", 0, 0, &blob, NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr = ID2D1EffectContext_LoadPixelShader(context, &GUID_TestPixelShader,
ID3D10Blob_GetBufferPointer(blob), ID3D10Blob_GetBufferSize(blob))))
{
hr = ID2D1TransformGraph_SetSingleTransformNode(graph,
(ID2D1TransformNode *)&effect_impl->ID2D1DrawTransform_iface);
}
ID3D10Blob_Release(blob);
return hr;
}
static const ID2D1EffectImplVtbl ps_effect_impl_vtbl =
{
effect_impl_QueryInterface,
effect_impl_AddRef,
effect_impl_Release,
ps_effect_impl_Initialize,
effect_impl_PrepareForRender,
effect_impl_SetGraph,
};
static HRESULT STDMETHODCALLTYPE effect_impl_draw_transform_QueryInterface(
ID2D1DrawTransform *iface, REFIID iid, void **out)
{
struct effect_impl *effect_impl = impl_from_ID2D1DrawTransform(iface);
return ID2D1EffectImpl_QueryInterface(&effect_impl->ID2D1EffectImpl_iface, iid, out);
}
static ULONG STDMETHODCALLTYPE effect_impl_draw_transform_AddRef(ID2D1DrawTransform *iface)
{
struct effect_impl *effect_impl = impl_from_ID2D1DrawTransform(iface);
return ID2D1EffectImpl_AddRef(&effect_impl->ID2D1EffectImpl_iface);
}
static ULONG STDMETHODCALLTYPE effect_impl_draw_transform_Release(ID2D1DrawTransform *iface)
{
struct effect_impl *effect_impl = impl_from_ID2D1DrawTransform(iface);
return ID2D1EffectImpl_Release(&effect_impl->ID2D1EffectImpl_iface);
}
static UINT32 STDMETHODCALLTYPE effect_impl_draw_transform_GetInputCount(ID2D1DrawTransform *iface)
{
return 1;
}
static HRESULT STDMETHODCALLTYPE effect_impl_draw_transform_MapOutputRectToInputRects(
ID2D1DrawTransform *iface, const D2D1_RECT_L *output_rect, D2D1_RECT_L *input_rects,
UINT32 input_rect_count)
{
if (input_rect_count != 1)
return E_INVALIDARG;
input_rects[0] = *output_rect;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE effect_impl_draw_transform_MapInputRectsToOutputRect(
ID2D1DrawTransform *iface, const D2D1_RECT_L *input_rects, const D2D1_RECT_L *input_opaque_rects,
UINT32 input_rect_count, D2D1_RECT_L *output_rect, D2D1_RECT_L *output_opaque_rect)
{
if (input_rect_count != 1)
return E_INVALIDARG;
*output_rect = input_rects[0];
memset(output_opaque_rect, 0, sizeof(*output_opaque_rect));
return S_OK;
}
static HRESULT STDMETHODCALLTYPE effect_impl_draw_transform_MapInvalidRect(
ID2D1DrawTransform *iface, UINT32 index, D2D1_RECT_L input_rect, D2D1_RECT_L *output_rect)
{
ok(0, "Unexpected call.\n");
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE effect_impl_draw_transform_SetDrawInfo(ID2D1DrawTransform *iface,
ID2D1DrawInfo *info)
{
return ID2D1DrawInfo_SetPixelShader(info, &GUID_TestPixelShader, 0);
}
static const ID2D1DrawTransformVtbl ps_effect_draw_transform_vtbl =
{
effect_impl_draw_transform_QueryInterface,
effect_impl_draw_transform_AddRef,
effect_impl_draw_transform_Release,
effect_impl_draw_transform_GetInputCount,
effect_impl_draw_transform_MapOutputRectToInputRects,
effect_impl_draw_transform_MapInputRectsToOutputRect,
effect_impl_draw_transform_MapInvalidRect,
effect_impl_draw_transform_SetDrawInfo,
};
static HRESULT STDMETHODCALLTYPE ps_effect_impl_create(IUnknown **effect_impl)
{
struct effect_impl *object;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
object->ID2D1EffectImpl_iface.lpVtbl = &ps_effect_impl_vtbl;
object->ID2D1DrawTransform_iface.lpVtbl = &ps_effect_draw_transform_vtbl;
object->refcount = 1;
*effect_impl = (IUnknown *)&object->ID2D1EffectImpl_iface;
return S_OK;
}
static void test_effect_custom_pixel_shader(BOOL d3d11)
{
static const WCHAR *description =
L"<?xml version='1.0'?> \
<Effect> \
<Property name='DisplayName' type='string' value='PSEffect'/> \
<Property name='Author' type='string' value='The Wine Project'/> \
<Property name='Category' type='string' value='Test'/> \
<Property name='Description' type='string' value='Test effect.'/> \
<Inputs> \
<Input name='Source'/> \
</Inputs> \
</Effect> \
";
D2D1_BITMAP_PROPERTIES1 bitmap_desc;
DWORD colour, expected_colour;
struct d2d1_test_context ctx;
struct resource_readback rb;
ID2D1DeviceContext *context;
D2D1_SIZE_U input_size;
ID2D1Factory1 *factory;
ID2D1Bitmap1 *bitmap;
ID2D1Effect *effect;
ID2D1Image *output;
DWORD pixel;
HRESULT hr;
if (!init_test_context(&ctx, d3d11))
return;
context = ctx.context;
factory = ctx.factory1;
if (!factory)
{
win_skip("ID2D1Factory1 is not supported.\n");
release_test_context(&ctx);
return;
}
hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, description, NULL,
0, ps_effect_impl_create);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_TestEffect, &effect);
todo_wine
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (FAILED(hr))
{
release_test_context(&ctx);
return;
}
set_size_u(&input_size, 1, 1);
pixel = 0xabcd00ff;
bitmap_desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
bitmap_desc.dpiX = 96.0f;
bitmap_desc.dpiY = 96.0f;
bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_NONE;
bitmap_desc.colorContext = NULL;
hr = ID2D1DeviceContext_CreateBitmap(context, input_size, &pixel, sizeof(pixel),
&bitmap_desc, &bitmap);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ID2D1Effect_SetInput(effect, 0, (ID2D1Image *)bitmap, FALSE);
ID2D1Effect_GetOutput(effect, &output);
ID2D1DeviceContext_BeginDraw(context);
ID2D1DeviceContext_Clear(context, 0);
ID2D1DeviceContext_DrawImage(context, output, NULL, NULL, 0, 0);
hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
get_surface_readback(&ctx, &rb);
colour = get_readback_colour(&rb, 0, 0);
expected_colour = 0x661a334c;
todo_wine ok(compare_colour(colour, expected_colour, 1),
"Got unexpected colour %#lx, expected %#lx.\n", colour, expected_colour);
release_resource_readback(&rb);
ID2D1Image_Release(output);
ID2D1Bitmap1_Release(bitmap);
ID2D1Effect_Release(effect);
release_test_context(&ctx);
}
START_TEST(d2d1)
{
HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll");
@ -14343,6 +14573,7 @@ START_TEST(d2d1)
queue_test(test_image_bounds);
queue_test(test_bitmap_map);
queue_test(test_bitmap_create);
queue_test(test_effect_custom_pixel_shader);
run_queued_tests();
}

View file

@ -1,11 +1,12 @@
MODULE = d3d10.dll
IMPORTLIB = d3d10
IMPORTS = uuid d3d10core d3dcompiler dxgi wined3d
IMPORTS = uuid d3d10core d3dcompiler_39 dxgi wined3d
EXTRADEFS = -DD3D_COMPILER_VERSION=0
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
SOURCES = \
blob.c \
d3d10_main.c \
effect.c \
reflection.c \

View file

@ -239,7 +239,7 @@ HRESULT WINAPI D3D10CompileEffectFromMemory(void *data, SIZE_T data_size, const
data, data_size, wine_dbgstr_a(filename), defines, include,
hlsl_flags, fx_flags, effect, errors);
return D3DCompile(data, data_size, filename, defines, include,
return D3DCompileFromMemory(data, data_size, filename, defines, include,
NULL, "fx_4_0", hlsl_flags, fx_flags, effect, errors);
}

View file

@ -315,4 +315,12 @@ HRESULT d3d10_effect_parse(struct d3d10_effect *effect, const void *data, SIZE_T
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device);
/* d3dcompiler_39 function prototypes */
HRESULT WINAPI D3DCompileFromMemory(const void *data, SIZE_T data_size, const char *filename,
const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages);
HRESULT WINAPI D3DDisassembleCode(const void *data, SIZE_T data_size,
UINT flags, const char *comments, ID3DBlob **disassembly);
#endif /* __WINE_D3D10_PRIVATE_H */

View file

@ -26,8 +26,7 @@ HRESULT WINAPI D3D10CompileShader(const char *data, SIZE_T data_size, const char
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entrypoint,
const char *profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages)
{
/* Forward to d3dcompiler */
return D3DCompile(data, data_size, filename, defines, include,
return D3DCompileFromMemory(data, data_size, filename, defines, include,
entrypoint, profile, flags, 0, shader, error_messages);
}
@ -37,5 +36,5 @@ HRESULT WINAPI D3D10DisassembleShader(const void *data, SIZE_T data_size,
TRACE("data %p, data_size %#Ix, color_code %#x, comments %p, disassembly %p.\n",
data, data_size, color_code, comments, disassembly);
return D3DDisassemble(data, data_size, color_code ? D3D_DISASM_ENABLE_COLOR_CODE : 0, comments, disassembly);
return D3DDisassembleCode(data, data_size, color_code ? D3D_DISASM_ENABLE_COLOR_CODE : 0, comments, disassembly);
}

View file

@ -9875,6 +9875,90 @@ static void test_effect_fx_4_1_blend_state(void)
ok(!refcount, "Device has %lu references left.\n", refcount);
}
static void test_effect_compiler(void)
{
static char empty_effect[] =
"technique10 {};";
static char empty_buffer[] =
"cbuffer cb1 { float4 m1; }\n"
"cbuffer cb2 { }\n"
"technique10 {};";
D3D10_EFFECT_VARIABLE_DESC var_desc;
ID3D10EffectConstantBuffer *cb;
D3D10_EFFECT_DESC desc;
ID3D10Device *device;
ID3D10Effect *effect;
ID3D10Blob *blob;
HRESULT hr;
if (!(device = create_device()))
{
skip("Failed to create device, skipping tests.\n");
return;
}
hr = D3D10CompileEffectFromMemory(empty_effect, sizeof(empty_effect), NULL, NULL, NULL, 0, 0,
&blob, NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ID3D10Effect_GetDesc(effect, &desc);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(desc.Techniques == 1, "Unexpected technique count %u.\n", desc.Techniques);
todo_wine
ok(desc.ConstantBuffers == 1, "Unexpected buffer count %u.\n", desc.ConstantBuffers);
cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
hr = cb->lpVtbl->GetDesc(cb, &var_desc);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
ok(!strcmp(var_desc.Name, "$Globals"), "Unexpected variable name %s.\n", var_desc.Name);
ID3D10Effect_Release(effect);
ID3D10Blob_Release(blob);
/* Empty user buffers. */
hr = D3D10CompileEffectFromMemory(empty_buffer, sizeof(empty_buffer), NULL, NULL, NULL, 0, 0,
&blob, NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = ID3D10Effect_GetDesc(effect, &desc);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(desc.Techniques == 1, "Unexpected technique count %u.\n", desc.Techniques);
todo_wine
ok(desc.ConstantBuffers == 3, "Unexpected buffer count %u.\n", desc.ConstantBuffers);
cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
hr = cb->lpVtbl->GetDesc(cb, &var_desc);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(!strcmp(var_desc.Name, "$Globals"), "Unexpected variable name %s.\n", var_desc.Name);
cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 1);
hr = cb->lpVtbl->GetDesc(cb, &var_desc);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
ok(!strcmp(var_desc.Name, "cb1"), "Unexpected variable name %s.\n", var_desc.Name);
cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 2);
hr = cb->lpVtbl->GetDesc(cb, &var_desc);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
ok(!strcmp(var_desc.Name, "cb2"), "Unexpected variable name %s.\n", var_desc.Name);
ID3D10Effect_Release(effect);
ID3D10Blob_Release(blob);
ID3D10Device_Release(device);
}
START_TEST(effect)
{
test_effect_constant_buffer_type();
@ -9903,4 +9987,5 @@ START_TEST(effect)
test_effect_value_expression();
test_effect_fx_4_1();
test_effect_fx_4_1_blend_state();
test_effect_compiler();
}

View file

@ -1039,6 +1039,44 @@ static void test_fx_4_1_blend_state(void)
ok(!refcount, "Device has %lu references left.\n", refcount);
}
static void test_shader_profiles(void)
{
const char *profile;
profile = D3D10GetVertexShaderProfile(NULL);
ok(!strcmp(profile, "vs_4_0"), "Unexpected profile %s.\n", profile);
profile = D3D10GetGeometryShaderProfile(NULL);
ok(!strcmp(profile, "gs_4_0"), "Unexpected profile %s.\n", profile);
profile = D3D10GetPixelShaderProfile(NULL);
ok(!strcmp(profile, "ps_4_0"), "Unexpected profile %s.\n", profile);
}
static void test_compile_effect(void)
{
char default_bs_source[] = "BlendState default_blend_state {};";
char bs_source2[] =
"BlendState blend_state\n"
"{\n"
" srcblend[0] = zero;\n"
"};";
ID3D10Blob *blob;
HRESULT hr;
hr = D3D10CompileEffectFromMemory(default_bs_source, strlen(default_bs_source),
NULL, NULL, NULL, 0, 0, &blob, NULL);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ID3D10Blob_Release(blob);
/* Compilation fails due to 10.1 feature incompatibility with fx_4_0 profile. */
hr = D3D10CompileEffectFromMemory(bs_source2, strlen(bs_source2), NULL, NULL, NULL,
0, 0, &blob, NULL);
ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
}
START_TEST(d3d10_1)
{
test_create_device();
@ -1047,4 +1085,6 @@ START_TEST(d3d10_1)
test_create_blend_state();
test_getdc();
test_fx_4_1_blend_state();
test_shader_profiles();
test_compile_effect();
}

View file

@ -35611,6 +35611,559 @@ static void test_stencil_export(void)
release_test_context(&test_context);
}
static void test_high_resource_count(void)
{
D3D11_TEXTURE2D_DESC texture_desc = {0};
struct d3d11_test_context test_context;
D3D11_SAMPLER_DESC sampler_desc = {0};
D3D11_BUFFER_DESC buffer_desc = {0};
ID3D11ShaderResourceView *srvs[100];
ID3D11Texture2D *textures[50], *rt;
D3D11_MAPPED_SUBRESOURCE map_desc;
ID3D11SamplerState *samplers[2];
ID3D11DeviceContext *context;
ID3D11RenderTargetView *rtv;
ID3D11Buffer *buffers[50];
ID3D11PixelShader *ps;
ID3D11Device *device;
float *data_ptr;
HRESULT hr;
static const struct vec4 expect = {1274.0f, 637.0f, 1225.0f, 0.0f};
static const struct vec4 expect2 = {1274.0f, 637.0f, 1325.0f, 0.0f};
static const DWORD ps_code[] =
{
#if 0
Texture2D<float> tex[50];
Buffer<float> buf[50];
SamplerState point_sampler, linear_sampler;
float4 main() : SV_Target
{
float4 ret = 0;
for (uint i = 0; i < 50; ++i)
{
ret.x += tex[i].Sample(point_sampler, 0.5);
ret.y += tex[i].Sample(linear_sampler, 0.5);
ret.z += buf[i].Load(0);
}
return ret;
}
#endif
0x43425844, 0xa909dad8, 0x13f3f278, 0x34767ac9, 0x7c08344c, 0x00000001, 0x000031a8, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00003130, 0x00000040, 0x00000c4c,
0x0300005a, 0x00106000, 0x00000000, 0x0300005a, 0x00106000, 0x00000001, 0x04001858, 0x00107000,
0x00000000, 0x00005555, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x04001858, 0x00107000,
0x00000002, 0x00005555, 0x04001858, 0x00107000, 0x00000003, 0x00005555, 0x04001858, 0x00107000,
0x00000004, 0x00005555, 0x04001858, 0x00107000, 0x00000005, 0x00005555, 0x04001858, 0x00107000,
0x00000006, 0x00005555, 0x04001858, 0x00107000, 0x00000007, 0x00005555, 0x04001858, 0x00107000,
0x00000008, 0x00005555, 0x04001858, 0x00107000, 0x00000009, 0x00005555, 0x04001858, 0x00107000,
0x0000000a, 0x00005555, 0x04001858, 0x00107000, 0x0000000b, 0x00005555, 0x04001858, 0x00107000,
0x0000000c, 0x00005555, 0x04001858, 0x00107000, 0x0000000d, 0x00005555, 0x04001858, 0x00107000,
0x0000000e, 0x00005555, 0x04001858, 0x00107000, 0x0000000f, 0x00005555, 0x04001858, 0x00107000,
0x00000010, 0x00005555, 0x04001858, 0x00107000, 0x00000011, 0x00005555, 0x04001858, 0x00107000,
0x00000012, 0x00005555, 0x04001858, 0x00107000, 0x00000013, 0x00005555, 0x04001858, 0x00107000,
0x00000014, 0x00005555, 0x04001858, 0x00107000, 0x00000015, 0x00005555, 0x04001858, 0x00107000,
0x00000016, 0x00005555, 0x04001858, 0x00107000, 0x00000017, 0x00005555, 0x04001858, 0x00107000,
0x00000018, 0x00005555, 0x04001858, 0x00107000, 0x00000019, 0x00005555, 0x04001858, 0x00107000,
0x0000001a, 0x00005555, 0x04001858, 0x00107000, 0x0000001b, 0x00005555, 0x04001858, 0x00107000,
0x0000001c, 0x00005555, 0x04001858, 0x00107000, 0x0000001d, 0x00005555, 0x04001858, 0x00107000,
0x0000001e, 0x00005555, 0x04001858, 0x00107000, 0x0000001f, 0x00005555, 0x04001858, 0x00107000,
0x00000020, 0x00005555, 0x04001858, 0x00107000, 0x00000021, 0x00005555, 0x04001858, 0x00107000,
0x00000022, 0x00005555, 0x04001858, 0x00107000, 0x00000023, 0x00005555, 0x04001858, 0x00107000,
0x00000024, 0x00005555, 0x04001858, 0x00107000, 0x00000025, 0x00005555, 0x04001858, 0x00107000,
0x00000026, 0x00005555, 0x04001858, 0x00107000, 0x00000027, 0x00005555, 0x04001858, 0x00107000,
0x00000028, 0x00005555, 0x04001858, 0x00107000, 0x00000029, 0x00005555, 0x04001858, 0x00107000,
0x0000002a, 0x00005555, 0x04001858, 0x00107000, 0x0000002b, 0x00005555, 0x04001858, 0x00107000,
0x0000002c, 0x00005555, 0x04001858, 0x00107000, 0x0000002d, 0x00005555, 0x04001858, 0x00107000,
0x0000002e, 0x00005555, 0x04001858, 0x00107000, 0x0000002f, 0x00005555, 0x04001858, 0x00107000,
0x00000030, 0x00005555, 0x04001858, 0x00107000, 0x00000031, 0x00005555, 0x04000858, 0x00107000,
0x00000032, 0x00005555, 0x04000858, 0x00107000, 0x00000033, 0x00005555, 0x04000858, 0x00107000,
0x00000034, 0x00005555, 0x04000858, 0x00107000, 0x00000035, 0x00005555, 0x04000858, 0x00107000,
0x00000036, 0x00005555, 0x04000858, 0x00107000, 0x00000037, 0x00005555, 0x04000858, 0x00107000,
0x00000038, 0x00005555, 0x04000858, 0x00107000, 0x00000039, 0x00005555, 0x04000858, 0x00107000,
0x0000003a, 0x00005555, 0x04000858, 0x00107000, 0x0000003b, 0x00005555, 0x04000858, 0x00107000,
0x0000003c, 0x00005555, 0x04000858, 0x00107000, 0x0000003d, 0x00005555, 0x04000858, 0x00107000,
0x0000003e, 0x00005555, 0x04000858, 0x00107000, 0x0000003f, 0x00005555, 0x04000858, 0x00107000,
0x00000040, 0x00005555, 0x04000858, 0x00107000, 0x00000041, 0x00005555, 0x04000858, 0x00107000,
0x00000042, 0x00005555, 0x04000858, 0x00107000, 0x00000043, 0x00005555, 0x04000858, 0x00107000,
0x00000044, 0x00005555, 0x04000858, 0x00107000, 0x00000045, 0x00005555, 0x04000858, 0x00107000,
0x00000046, 0x00005555, 0x04000858, 0x00107000, 0x00000047, 0x00005555, 0x04000858, 0x00107000,
0x00000048, 0x00005555, 0x04000858, 0x00107000, 0x00000049, 0x00005555, 0x04000858, 0x00107000,
0x0000004a, 0x00005555, 0x04000858, 0x00107000, 0x0000004b, 0x00005555, 0x04000858, 0x00107000,
0x0000004c, 0x00005555, 0x04000858, 0x00107000, 0x0000004d, 0x00005555, 0x04000858, 0x00107000,
0x0000004e, 0x00005555, 0x04000858, 0x00107000, 0x0000004f, 0x00005555, 0x04000858, 0x00107000,
0x00000050, 0x00005555, 0x04000858, 0x00107000, 0x00000051, 0x00005555, 0x04000858, 0x00107000,
0x00000052, 0x00005555, 0x04000858, 0x00107000, 0x00000053, 0x00005555, 0x04000858, 0x00107000,
0x00000054, 0x00005555, 0x04000858, 0x00107000, 0x00000055, 0x00005555, 0x04000858, 0x00107000,
0x00000056, 0x00005555, 0x04000858, 0x00107000, 0x00000057, 0x00005555, 0x04000858, 0x00107000,
0x00000058, 0x00005555, 0x04000858, 0x00107000, 0x00000059, 0x00005555, 0x04000858, 0x00107000,
0x0000005a, 0x00005555, 0x04000858, 0x00107000, 0x0000005b, 0x00005555, 0x04000858, 0x00107000,
0x0000005c, 0x00005555, 0x04000858, 0x00107000, 0x0000005d, 0x00005555, 0x04000858, 0x00107000,
0x0000005e, 0x00005555, 0x04000858, 0x00107000, 0x0000005f, 0x00005555, 0x04000858, 0x00107000,
0x00000060, 0x00005555, 0x04000858, 0x00107000, 0x00000061, 0x00005555, 0x04000858, 0x00107000,
0x00000062, 0x00005555, 0x04000858, 0x00107000, 0x00000063, 0x00005555, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000002, 0x0c000045, 0x001000f2, 0x00000000, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000001, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000000, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000003, 0x00106000,
0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000004, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000005, 0x00106000, 0x00000000, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000006,
0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000007, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000008, 0x00106000, 0x00000000,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000009, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000000a, 0x00106000, 0x00000000, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000000b, 0x00106000,
0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x0000000c, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000000d, 0x00106000, 0x00000000, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000000e,
0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x0000000f, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000010, 0x00106000, 0x00000000,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000011, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000012, 0x00106000, 0x00000000, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000013, 0x00106000,
0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000014, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000015, 0x00106000, 0x00000000, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000016,
0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000017, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000018, 0x00106000, 0x00000000,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000019, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000001a, 0x00106000, 0x00000000, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000001b, 0x00106000,
0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x0000001c, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000001d, 0x00106000, 0x00000000, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000001e,
0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x0000001f, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000020, 0x00106000, 0x00000000,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000021, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000022, 0x00106000, 0x00000000, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000023, 0x00106000,
0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000024, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000025, 0x00106000, 0x00000000, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000026,
0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000027, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000028, 0x00106000, 0x00000000,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000029, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000002a, 0x00106000, 0x00000000, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000002b, 0x00106000,
0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x0000002c, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000002d, 0x00106000, 0x00000000, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000002e,
0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x0000002f, 0x00106000, 0x00000000, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000030, 0x00106000, 0x00000000,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000031, 0x00106000, 0x00000000, 0x07000000, 0x00102012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000000, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000001,
0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000003, 0x00106000, 0x00000001,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000004, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000005, 0x00106000, 0x00000001, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000006, 0x00106000,
0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000007, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000008, 0x00106000, 0x00000001, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000009,
0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x0000000a, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000000b, 0x00106000, 0x00000001,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x0000000c, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000000d, 0x00106000, 0x00000001, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000000e, 0x00106000,
0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x0000000f, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000010, 0x00106000, 0x00000001, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000011,
0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000012, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000013, 0x00106000, 0x00000001,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000014, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000015, 0x00106000, 0x00000001, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000016, 0x00106000,
0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000017, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000018, 0x00106000, 0x00000001, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000019,
0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x0000001a, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000001b, 0x00106000, 0x00000001,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x0000001c, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000001d, 0x00106000, 0x00000001, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000001e, 0x00106000,
0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x0000001f, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000020, 0x00106000, 0x00000001, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000021,
0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000022, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000023, 0x00106000, 0x00000001,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000024, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000025, 0x00106000, 0x00000001, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000026, 0x00106000,
0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000027, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000028, 0x00106000, 0x00000001, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000029,
0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000,
0x00000000, 0x00107e46, 0x0000002a, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002,
0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000002b, 0x00106000, 0x00000001,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045,
0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46,
0x0000002c, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000002d, 0x00106000, 0x00000001, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001,
0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000002e, 0x00106000,
0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000,
0x00107e46, 0x0000002f, 0x00106000, 0x00000001, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2, 0x00000001, 0x00004002, 0x3f000000,
0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000030, 0x00106000, 0x00000001, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0c000045, 0x001000f2,
0x00000001, 0x00004002, 0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000031,
0x00106000, 0x00000001, 0x07000000, 0x00102022, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000032, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000033, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000034, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000035, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2,
0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000036,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d,
0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000037, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000038, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000039, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000003a, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000003b, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000003c, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000003d, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2,
0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000003e,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d,
0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46,
0x0000003f, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000040, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000041, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000042, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000043, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000044, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000045, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2,
0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000046,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d,
0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000047, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000048, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000049, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000004a, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000004b, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000004c, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000004d, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2,
0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000004e,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d,
0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46,
0x0000004f, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000050, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000051, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000052, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000053, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000054, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000055, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2,
0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000056,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d,
0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46,
0x00000057, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000058, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000059, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x0000005a, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000005b, 0x07000000, 0x00100012, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000005c, 0x07000000, 0x00100012,
0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000005d, 0x07000000,
0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2,
0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x0000005e,
0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x0a00002d,
0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00107e46,
0x0000005f, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a, 0x00000001,
0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00107e46, 0x00000060, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0010000a,
0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00107e46, 0x00000061, 0x07000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00107e46, 0x00000062, 0x07000000, 0x00100012, 0x00000000, 0x0010000a,
0x00000000, 0x0010000a, 0x00000001, 0x0a00002d, 0x001000f2, 0x00000001, 0x00004002, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00107e46, 0x00000063, 0x07000000, 0x00102042, 0x00000000,
0x0010000a, 0x00000000, 0x0010000a, 0x00000001, 0x05000036, 0x00102082, 0x00000000, 0x00004001,
0x00000000, 0x0100003e,
};
if (!init_test_context(&test_context, NULL))
return;
device = test_context.device;
context = test_context.immediate_context;
hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps);
ok(hr == S_OK, "Failed to create pixel shader, hr %#lx.\n", hr);
texture_desc.Width = 16;
texture_desc.Height = 16;
texture_desc.MipLevels = 1;
texture_desc.ArraySize = 1;
texture_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
texture_desc.SampleDesc.Count = 1;
texture_desc.Usage = D3D11_USAGE_DEFAULT;
texture_desc.BindFlags = D3D11_BIND_RENDER_TARGET;
hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &rt);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)rt, NULL, &rtv);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
for (unsigned int i = 0; i < ARRAY_SIZE(textures); ++i)
{
float data[2] = {0.0f, i + 1};
D3D11_SUBRESOURCE_DATA data_desc = {data, sizeof(data), sizeof(data)};
texture_desc.Width = 2;
texture_desc.Height = 1;
texture_desc.MipLevels = 1;
texture_desc.ArraySize = 1;
texture_desc.Format = DXGI_FORMAT_R32_FLOAT;
texture_desc.SampleDesc.Count = 1;
texture_desc.Usage = D3D11_USAGE_DEFAULT;
texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
hr = ID3D11Device_CreateTexture2D(device, &texture_desc, &data_desc, &textures[i]);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)textures[i], NULL, &srvs[i]);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
}
for (unsigned int i = 0; i < ARRAY_SIZE(buffers); ++i)
{
float data[2] = {i + 1, 0.0f};
D3D11_SUBRESOURCE_DATA data_desc = {data, sizeof(data), sizeof(data)};
D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc;
buffer_desc.ByteWidth = sizeof(data);
buffer_desc.Usage = D3D11_USAGE_DYNAMIC;
buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
buffer_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &data_desc, &buffers[i]);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
srv_desc.Format = DXGI_FORMAT_R32_FLOAT;
srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
srv_desc.Buffer.FirstElement = 0;
srv_desc.Buffer.NumElements = 2;
hr = ID3D11Device_CreateShaderResourceView(device,
(ID3D11Resource *)buffers[i], &srv_desc, &srvs[ARRAY_SIZE(textures) + i]);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
}
sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;
sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
sampler_desc.MaxLOD = FLT_MAX;
hr = ID3D11Device_CreateSamplerState(device, &sampler_desc, &samplers[0]);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
hr = ID3D11Device_CreateSamplerState(device, &sampler_desc, &samplers[1]);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ID3D11DeviceContext_OMSetRenderTargets(context, 1, &rtv, NULL);
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
/* Deliberately make the bindings mismatch, to test that we handle NULL
* and unrelated bindings correctly. */
ID3D11DeviceContext_PSSetShaderResources(context, 1, ARRAY_SIZE(srvs) - 2, &srvs[1]);
ID3D11DeviceContext_PSSetShaderResources(context, ARRAY_SIZE(srvs) + 1, 1, &srvs[0]);
ID3D11DeviceContext_PSSetShaderResources(context, ARRAY_SIZE(srvs) + 2, 1, &srvs[ARRAY_SIZE(srvs) - 1]);
ID3D11DeviceContext_PSSetSamplers(context, 0, 2, samplers);
draw_quad(&test_context);
check_texture_vec4(rt, &expect, 0);
/* Discard the data in one of the buffers and draw again. */
hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)buffers[1], 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
data_ptr = map_desc.pData;
data_ptr[0] = 102.0f;
data_ptr[1] = 0.0f;
ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)buffers[1], 0);
draw_quad(&test_context);
check_texture_vec4(rt, &expect2, 0);
ID3D11Texture2D_Release(rt);
ID3D11RenderTargetView_Release(rtv);
for (unsigned int i = 0; i < ARRAY_SIZE(srvs); ++i)
ID3D11ShaderResourceView_Release(srvs[i]);
for (unsigned int i = 0; i < ARRAY_SIZE(buffers); ++i)
ID3D11Buffer_Release(buffers[i]);
for (unsigned int i = 0; i < ARRAY_SIZE(textures); ++i)
ID3D11Texture2D_Release(textures[i]);
for (unsigned int i = 0; i < ARRAY_SIZE(samplers); ++i)
ID3D11SamplerState_Release(samplers[i]);
ID3D11PixelShader_Release(ps);
release_test_context(&test_context);
}
START_TEST(d3d11)
{
unsigned int argc, i;
@ -35809,6 +36362,7 @@ START_TEST(d3d11)
queue_test(test_keyed_mutex);
queue_test(test_clear_during_render);
queue_test(test_stencil_export);
queue_test(test_high_resource_count);
run_queued_tests();

View file

@ -29,6 +29,7 @@
*/
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <math.h>
@ -107,6 +108,18 @@ static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, floa
&& compare_float(vec->w, w, ulps);
}
static uint32_t float_to_int(float f)
{
union
{
uint32_t u;
float f;
} u;
u.f = f;
return u.u;
}
static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER9 *identifier)
{
return !strcmp(identifier->Driver, "d3d10warp.dll");
@ -1667,16 +1680,17 @@ static void color_fill_test(void)
{D3DPOOL_MANAGED, 0, D3DERR_INVALIDCALL},
{D3DPOOL_SCRATCH, 0, D3DERR_INVALIDCALL},
};
enum format_flags
{
CHECK_FILL_VALUE = 0x1,
BLOCKS = 0x2,
FLOAT_VALUES = 0x4,
};
static const struct
{
D3DFORMAT format;
const char *name;
enum
{
CHECK_FILL_VALUE = 0x1,
BLOCKS = 0x2,
FLOAT_VALUES = 0x4,
} flags;
enum format_flags flags;
unsigned int fill_i[4];
float fill_f[4];
}
@ -3366,7 +3380,7 @@ static void generate_bumpmap_textures(IDirect3DDevice9 *device) {
for (y = 0; y < 128; ++y)
{
if(i)
{ /* Set up black texture with 2x2 texel white spot in the middle */
{
DWORD *ptr = (DWORD *)(((BYTE *)locked_rect.pBits) + (y * locked_rect.Pitch));
for (x = 0; x < 128; ++x)
{
@ -3510,10 +3524,10 @@ static void texbem_test(void)
generate_bumpmap_textures(device);
IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT00, *(LPDWORD)&bumpenvmat[0]);
IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT01, *(LPDWORD)&bumpenvmat[1]);
IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT10, *(LPDWORD)&bumpenvmat[2]);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT11, *(LPDWORD)&bumpenvmat[3]);
IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT00, float_to_int(bumpenvmat[0]));
IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT01, float_to_int(bumpenvmat[1]));
IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT10, float_to_int(bumpenvmat[2]));
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT11, float_to_int(bumpenvmat[3]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, NULL);
@ -3664,24 +3678,24 @@ static void texbem_test(void)
bumpenvmat[0] =-1.0; bumpenvmat[2] = 2.0;
bumpenvmat[1] = 0.0; bumpenvmat[3] = 0.0;
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT00, *(LPDWORD)&bumpenvmat[0]);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT00, float_to_int(bumpenvmat[0]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT01, *(LPDWORD)&bumpenvmat[1]);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT01, float_to_int(bumpenvmat[1]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT10, *(LPDWORD)&bumpenvmat[2]);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT10, float_to_int(bumpenvmat[2]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT11, *(LPDWORD)&bumpenvmat[3]);
hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_BUMPENVMAT11, float_to_int(bumpenvmat[3]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
bumpenvmat[0] = 1.5; bumpenvmat[2] = 0.0;
bumpenvmat[1] = 0.0; bumpenvmat[3] = 0.5;
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT00, *(LPDWORD)&bumpenvmat[0]);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT00, float_to_int(bumpenvmat[0]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT01, *(LPDWORD)&bumpenvmat[1]);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT01, float_to_int(bumpenvmat[1]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT10, *(LPDWORD)&bumpenvmat[2]);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT10, float_to_int(bumpenvmat[2]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT11, *(LPDWORD)&bumpenvmat[3]);
hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_BUMPENVMAT11, float_to_int(bumpenvmat[3]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
@ -11027,13 +11041,13 @@ static void fixed_function_bumpmap_test(void)
/* Generate the textures */
generate_bumpmap_textures(device);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT00, *(LPDWORD)&bumpenvmat[0]);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT00, float_to_int(bumpenvmat[0]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT01, *(LPDWORD)&bumpenvmat[1]);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT01, float_to_int(bumpenvmat[1]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT10, *(LPDWORD)&bumpenvmat[2]);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT10, float_to_int(bumpenvmat[2]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT11, *(LPDWORD)&bumpenvmat[3]);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVMAT11, float_to_int(bumpenvmat[3]));
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_BUMPENVMAP);
@ -23249,16 +23263,17 @@ static void test_texture_blending(void)
DWORD value;
};
enum texture_stage_texture
{
TEXTURE_INVALID,
TEXTURE_NONE,
TEXTURE_BUMPMAP,
TEXTURE_RED,
};
struct texture_stage
{
enum
{
TEXTURE_INVALID,
TEXTURE_NONE,
TEXTURE_BUMPMAP,
TEXTURE_RED,
}
texture;
enum texture_stage_texture texture;
struct texture_stage_state state[20];
};
@ -26438,16 +26453,23 @@ static void test_desktop_window(void)
device = create_device(d3d, GetDesktopWindow(), GetDesktopWindow(), TRUE);
ok(!!device, "Failed to create a D3D device.\n");
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
color = getPixelColor(device, 1, 1);
ok(color == 0x00ff0000, "Got unexpected color 0x%08x.\n", color);
if (device)
{
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0);
ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr);
color = getPixelColor(device, 1, 1);
ok(color == 0x00ff0000, "Got unexpected color 0x%08x.\n", color);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#lx.\n", hr);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#lx.\n", hr);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
}
else
{
skip("Failed to create a D3D device for the desktop window, skipping tests.\n");
}
/* test device with NULL HWND */
device = create_device(d3d, NULL, NULL, TRUE);

View file

@ -1,4 +1,5 @@
MODULE = d3dcompiler_39.dll
IMPORTLIB = d3dcompiler_39
IMPORTS = wined3d
EXTRADEFS = -DD3D_COMPILER_VERSION=39
PARENTSRC = ../d3dcompiler_43

View file

@ -397,29 +397,12 @@ HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filena
return hr;
}
HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *entry_point,
const char *profile, UINT flags, UINT effect_flags, UINT secondary_flags,
const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader_blob,
ID3DBlob **messages_blob)
static enum vkd3d_shader_target_type get_target_for_profile(const char *profile)
{
struct d3dcompiler_include_from_file include_from_file;
struct vkd3d_shader_preprocess_info preprocess_info;
struct vkd3d_shader_hlsl_source_info hlsl_info;
struct vkd3d_shader_compile_option options[3];
struct vkd3d_shader_compile_info compile_info;
struct vkd3d_shader_compile_option *option;
struct vkd3d_shader_code byte_code;
const D3D_SHADER_MACRO *macro;
size_t profile_len, i;
char *messages;
HRESULT hr;
int ret;
static const char * const d3dbc_profiles[] =
{
"fx_2_",
"ps.1.",
"ps.2.",
"ps.3.",
@ -439,6 +422,50 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
"tx_1_",
};
static const char * const fx_profiles[] =
{
"fx_2_0",
"fx_4_0",
"fx_4_1",
"fx_5_0",
};
profile_len = strlen(profile);
for (i = 0; i < ARRAY_SIZE(d3dbc_profiles); ++i)
{
size_t len = strlen(d3dbc_profiles[i]);
if (len <= profile_len && !memcmp(profile, d3dbc_profiles[i], len))
return VKD3D_SHADER_TARGET_D3D_BYTECODE;
}
for (i = 0; i < ARRAY_SIZE(fx_profiles); ++i)
{
if (!strcmp(profile, fx_profiles[i]))
return VKD3D_SHADER_TARGET_FX;
}
return VKD3D_SHADER_TARGET_DXBC_TPF;
}
HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *entry_point,
const char *profile, UINT flags, UINT effect_flags, UINT secondary_flags,
const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader_blob,
ID3DBlob **messages_blob)
{
struct d3dcompiler_include_from_file include_from_file;
struct vkd3d_shader_preprocess_info preprocess_info;
struct vkd3d_shader_hlsl_source_info hlsl_info;
struct vkd3d_shader_compile_option options[4];
struct vkd3d_shader_compile_info compile_info;
struct vkd3d_shader_compile_option *option;
struct vkd3d_shader_code byte_code;
const D3D_SHADER_MACRO *macro;
char *messages;
HRESULT hr;
int ret;
TRACE("data %p, data_size %Iu, filename %s, macros %p, include %p, entry_point %s, "
"profile %s, flags %#x, effect_flags %#x, secondary_flags %#x, secondary_data %p, "
"secondary_data_size %Iu, shader_blob %p, messages_blob %p.\n",
@ -453,8 +480,11 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
include = &include_from_file.ID3DInclude_iface;
}
if (flags & ~(D3DCOMPILE_DEBUG | D3DCOMPILE_PACK_MATRIX_ROW_MAJOR | D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR))
if (flags & ~(D3DCOMPILE_DEBUG | D3DCOMPILE_PACK_MATRIX_ROW_MAJOR | D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
| D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY))
{
FIXME("Ignoring flags %#x.\n", flags);
}
if (effect_flags)
FIXME("Ignoring effect flags %#x.\n", effect_flags);
if (secondary_flags)
@ -474,24 +504,12 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
compile_info.source.code = data;
compile_info.source.size = data_size;
compile_info.source_type = VKD3D_SHADER_SOURCE_HLSL;
compile_info.target_type = VKD3D_SHADER_TARGET_DXBC_TPF;
compile_info.target_type = get_target_for_profile(profile);
compile_info.options = options;
compile_info.option_count = 1;
compile_info.log_level = VKD3D_SHADER_LOG_INFO;
compile_info.source_name = filename;
profile_len = strlen(profile);
for (i = 0; i < ARRAY_SIZE(d3dbc_profiles); ++i)
{
size_t len = strlen(d3dbc_profiles[i]);
if (len <= profile_len && !memcmp(profile, d3dbc_profiles[i], len))
{
compile_info.target_type = VKD3D_SHADER_TARGET_D3D_BYTECODE;
break;
}
}
preprocess_info.type = VKD3D_SHADER_STRUCTURE_TYPE_PREPROCESS_INFO;
preprocess_info.next = &hlsl_info;
preprocess_info.macros = (const struct vkd3d_shader_macro *)macros;
@ -532,6 +550,13 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
option->value = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_COLUMN_MAJOR;
}
if (flags & D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY)
{
option = &options[compile_info.option_count++];
option->name = VKD3D_SHADER_COMPILE_OPTION_BACKWARD_COMPATIBILITY;
option->value = VKD3D_SHADER_COMPILE_OPTION_BACKCOMPAT_MAP_SEMANTIC_NAMES;
}
ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages);
if (ret)
@ -576,6 +601,20 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen
return S_OK;
}
/* Unlike other effect profiles fx_4_x is using DXBC container. */
if (!strcmp(profile, "fx_4_0") || !strcmp(profile, "fx_4_1"))
{
struct vkd3d_shader_dxbc_section_desc section = { .tag = TAG_FX10, .data = byte_code };
struct vkd3d_shader_code dxbc;
ret = vkd3d_shader_serialize_dxbc(1, &section, &dxbc, NULL);
vkd3d_shader_free_shader_code(&byte_code);
if (ret)
return hresult_from_vkd3d_result(ret);
byte_code = dxbc;
}
if (SUCCEEDED(hr = D3DCreateBlob(byte_code.size, shader_blob)))
memcpy(ID3D10Blob_GetBufferPointer(*shader_blob), byte_code.code, byte_code.size);
@ -735,6 +774,12 @@ end:
return hr;
}
HRESULT WINAPI D3DCreateLinker(ID3D11Linker **linker)
{
FIXME("linker %p stub!\n", linker);
return E_NOTIMPL;
}
HRESULT WINAPI D3DLoadModule(const void *data, SIZE_T size, ID3D11Module **module)
{
FIXME("data %p, size %Iu, module %p stub!\n", data, size, module);

View file

@ -523,6 +523,7 @@ void SlDeleteShader(struct bwriter_shader *shader);
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
#define TAG_Aon9 MAKE_TAG('A', 'o', 'n', '9')
#define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
#define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define TAG_OSG5 MAKE_TAG('O', 'S', 'G', '5')

View file

@ -622,7 +622,7 @@ static void test_sampling(void)
draw_quad(&test_context, ps_code);
v = get_color_vec4(&test_context, 0, 0);
todo_wine ok(compare_vec4(&v, 0.25f, 0.0f, 0.25f, 0.0f, 0),
ok(compare_vec4(&v, 0.25f, 0.0f, 0.25f, 0.0f, 0),
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
ID3D10Blob_Release(ps_code);

View file

@ -5,7 +5,7 @@
@ stub D3DCompressShaders
@ stdcall D3DCreateBlob(long ptr)
@ stub D3DCreateFunctionLinkingGraph
@ stub D3DCreateLinker
@ stdcall D3DCreateLinker(ptr)
@ stub D3DDecompressShaders
@ stdcall D3DDisassemble(ptr long long ptr ptr)
@ stub D3DDisassemble10Effect(ptr long ptr)

View file

@ -4375,11 +4375,10 @@ static void test_create_effect_from_memory(void)
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromMemory(test_fx_source, strlen(test_fx_source) + 1, NULL, NULL, NULL, "fx_4_0",
0x0, 0x0, device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!errors, "Got unexpected errors %p.\n", errors);
todo_wine ok(!!effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
if (hr == S_OK)
effect->lpVtbl->Release(effect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!errors, "Got unexpected errors %p.\n", errors);
ok(!!effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
@ -4465,21 +4464,19 @@ static void test_create_effect_from_file(void)
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromFileW(path, NULL, NULL, "fx_4_0", 0x0, 0x0,
device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!errors, "Got unexpected errors %p.\n", errors);
todo_wine ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
if (hr == S_OK)
effect->lpVtbl->Release(effect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!errors, "Got unexpected errors %p.\n", errors);
ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
effect->lpVtbl->Release(effect);
errors = (ID3D10Blob *)0xdeadbeef;
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromFileA(get_str_a(path), NULL, NULL, "fx_4_0", 0x0, 0x0,
device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!errors, "Got unexpected errors %p.\n", errors);
todo_wine ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
if (hr == S_OK)
effect->lpVtbl->Release(effect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!errors, "Got unexpected errors %p.\n", errors);
ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
effect->lpVtbl->Release(effect);
delete_file(test_file_name);
@ -4584,21 +4581,19 @@ static void test_create_effect_from_resource(void)
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromResourceW(resource_module, test_resource_name, NULL, NULL, NULL, "fx_4_0",
0, 0, device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!errors, "Got unexpected errors %p.\n", errors);
todo_wine ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
if (hr == S_OK)
effect->lpVtbl->Release(effect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!errors, "Got unexpected errors %p.\n", errors);
ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
effect->lpVtbl->Release(effect);
errors = (ID3D10Blob *)0xdeadbeef;
effect = (ID3D10Effect *)0xdeadbeef;
hr = D3DX10CreateEffectFromResourceA(resource_module, get_str_a(test_resource_name), NULL, NULL, NULL, "fx_4_0",
0, 0, device, NULL, NULL, &effect, &errors, NULL);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!errors, "Got unexpected errors %p.\n", errors);
todo_wine ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
if (hr == S_OK)
effect->lpVtbl->Release(effect);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!errors, "Got unexpected errors %p.\n", errors);
ok(effect && effect != (ID3D10Effect *)0xdeadbeef, "Got unexpected effect %p.\n", effect);
effect->lpVtbl->Release(effect);
delete_resource_module(test_resource_name, resource_module);

View file

@ -1875,6 +1875,210 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
}
}
static HRESULT d3dx_image_decompress(const void *memory, uint32_t row_pitch, const RECT *rect,
const RECT *unaligned_rect, const struct volume *size, const struct pixel_format_desc *desc,
void **out_memory, uint32_t *out_row_pitch, RECT *out_rect, const struct pixel_format_desc **out_desc)
{
void (*fetch_dxt_texel)(int srcRowStride, const BYTE *pixdata, int i, int j, void *texel);
const struct pixel_format_desc *uncompressed_desc = NULL;
uint32_t x, y, tmp_pitch;
BYTE *uncompressed_mem;
switch (desc->format)
{
case D3DFMT_DXT1:
uncompressed_desc = get_format_info(D3DFMT_A8B8G8R8);
fetch_dxt_texel = fetch_2d_texel_rgba_dxt1;
break;
case D3DFMT_DXT2:
case D3DFMT_DXT3:
uncompressed_desc = get_format_info(D3DFMT_A8B8G8R8);
fetch_dxt_texel = fetch_2d_texel_rgba_dxt3;
break;
case D3DFMT_DXT4:
case D3DFMT_DXT5:
uncompressed_desc = get_format_info(D3DFMT_A8B8G8R8);
fetch_dxt_texel = fetch_2d_texel_rgba_dxt5;
break;
default:
FIXME("Unexpected compressed texture format %u.\n", desc->format);
return E_NOTIMPL;
}
if (!(uncompressed_mem = malloc(size->width * size->height * size->depth * uncompressed_desc->bytes_per_pixel)))
return E_OUTOFMEMORY;
if (unaligned_rect && EqualRect(rect, unaligned_rect))
goto exit;
TRACE("Decompressing image.\n");
tmp_pitch = row_pitch * desc->block_width / desc->block_byte_count;
for (y = 0; y < size->height; ++y)
{
BYTE *ptr = &uncompressed_mem[y * size->width * uncompressed_desc->bytes_per_pixel];
for (x = 0; x < size->width; ++x)
{
const POINT pt = { x, y };
if (!PtInRect(unaligned_rect, pt))
fetch_dxt_texel(tmp_pitch, (BYTE *)memory, x + rect->left, y + rect->top, ptr);
ptr += uncompressed_desc->bytes_per_pixel;
}
}
exit:
*out_memory = uncompressed_mem;
*out_row_pitch = size->width * uncompressed_desc->bytes_per_pixel;
if (unaligned_rect)
*out_rect = *unaligned_rect;
else
SetRect(out_rect, 0, 0, size->width, size->height);
*out_desc = uncompressed_desc;
return S_OK;
}
static void set_volume_struct(struct volume *volume, uint32_t width, uint32_t height, uint32_t depth)
{
volume->width = width;
volume->height = height;
volume->depth = depth;
}
static HRESULT d3dx_load_image_from_memory(void *dst_memory, uint32_t dst_row_pitch, const struct pixel_format_desc *dst_desc,
const PALETTEENTRY *dst_palette, const RECT *dst_rect, const RECT *dst_rect_aligned, const void *src_memory,
uint32_t src_row_pitch, const struct pixel_format_desc *src_desc, const PALETTEENTRY *src_palette, const RECT *src_rect,
uint32_t filter_flags, uint32_t color_key)
{
struct volume src_size, dst_size, dst_size_aligned;
const BYTE *src_memory_offset = src_memory;
HRESULT hr = S_OK;
TRACE("dst_memory %p, dst_row_pitch %d, dst_desc %p, dst_palette %p, dst_rect %s, dst_rect_aligned %s, src_memory %p, "
"src_row_pitch %d, src_desc %p, src_palette %p, src_rect %s, filter %#x, color_key 0x%08x.\n",
dst_memory, dst_row_pitch, dst_desc, dst_palette, wine_dbgstr_rect(dst_rect), wine_dbgstr_rect(dst_rect_aligned),
src_memory, src_row_pitch, src_desc, src_palette, wine_dbgstr_rect(src_rect), filter_flags, color_key);
set_volume_struct(&src_size, (src_rect->right - src_rect->left), (src_rect->bottom - src_rect->top), 1);
set_volume_struct(&dst_size, (dst_rect->right - dst_rect->left), (dst_rect->bottom - dst_rect->top), 1);
set_volume_struct(&dst_size_aligned, (dst_rect_aligned->right - dst_rect_aligned->left),
(dst_rect_aligned->bottom - dst_rect_aligned->top), 1);
src_memory_offset += (src_rect->top / src_desc->block_height) * src_row_pitch;
src_memory_offset += (src_rect->left / src_desc->block_width) * src_desc->block_byte_count;
/* Everything matches, simply copy the pixels. */
if (src_desc->format == dst_desc->format
&& dst_size.width == src_size.width
&& dst_size.height == src_size.height
&& color_key == 0
&& !(src_rect->left & (src_desc->block_width - 1))
&& !(src_rect->top & (src_desc->block_height - 1))
&& !(dst_rect->left & (dst_desc->block_width - 1))
&& !(dst_rect->top & (dst_desc->block_height - 1)))
{
TRACE("Simple copy.\n");
copy_pixels(src_memory_offset, src_row_pitch, 0, dst_memory, dst_row_pitch, 0, &src_size, src_desc);
return S_OK;
}
/* Stretching or format conversion. */
if (!is_conversion_from_supported(src_desc)
|| !is_conversion_to_supported(dst_desc))
{
FIXME("Unsupported format conversion %#x -> %#x.\n", src_desc->format, dst_desc->format);
return E_NOTIMPL;
}
/*
* If the source is a compressed image, we need to decompress it first
* before doing any modifications.
*/
if (src_desc->type == FORMAT_DXT)
{
const struct pixel_format_desc *uncompressed_desc;
uint32_t uncompressed_row_pitch;
void *uncompressed_mem = NULL;
RECT uncompressed_rect;
hr = d3dx_image_decompress(src_memory, src_row_pitch, src_rect, NULL, &src_size, src_desc,
&uncompressed_mem, &uncompressed_row_pitch, &uncompressed_rect, &uncompressed_desc);
if (SUCCEEDED(hr))
{
hr = d3dx_load_image_from_memory(dst_memory, dst_row_pitch, dst_desc, dst_palette, dst_rect, dst_rect_aligned,
uncompressed_mem, uncompressed_row_pitch, uncompressed_desc, src_palette, &uncompressed_rect,
filter_flags, color_key);
}
free(uncompressed_mem);
return hr;
}
/* Same as the above, need to decompress the destination prior to modifying. */
if (dst_desc->type == FORMAT_DXT)
{
const struct pixel_format_desc *uncompressed_desc;
uint32_t uncompressed_row_pitch;
void *uncompressed_mem = NULL;
BYTE *uncompressed_mem_offset;
RECT uncompressed_rect;
hr = d3dx_image_decompress(dst_memory, dst_row_pitch, dst_rect_aligned, dst_rect, &dst_size_aligned, dst_desc,
&uncompressed_mem, &uncompressed_row_pitch, &uncompressed_rect, &uncompressed_desc);
if (FAILED(hr))
return hr;
uncompressed_mem_offset = (BYTE *)uncompressed_mem + (dst_rect->top - dst_rect_aligned->top) * uncompressed_row_pitch
+ (dst_rect->left - dst_rect_aligned->left) * uncompressed_desc->bytes_per_pixel;
hr = d3dx_load_image_from_memory(uncompressed_mem_offset, uncompressed_row_pitch, uncompressed_desc, dst_palette,
&uncompressed_rect, &uncompressed_rect, src_memory, src_row_pitch, src_desc, src_palette,
src_rect, filter_flags, color_key);
if (SUCCEEDED(hr))
{
GLenum gl_format = 0;
TRACE("Compressing DXTn surface.\n");
switch (dst_desc->format)
{
case D3DFMT_DXT1:
gl_format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
break;
case D3DFMT_DXT2:
case D3DFMT_DXT3:
gl_format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
break;
case D3DFMT_DXT4:
case D3DFMT_DXT5:
gl_format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
default:
ERR("Unexpected destination compressed format %u.\n", dst_desc->format);
}
tx_compress_dxtn(4, dst_size_aligned.width, dst_size_aligned.height, uncompressed_mem, gl_format,
dst_memory, dst_row_pitch);
}
free(uncompressed_mem);
return hr;
}
if ((filter_flags & 0xf) == D3DX_FILTER_NONE)
{
convert_argb_pixels(src_memory_offset, src_row_pitch, 0, &src_size, src_desc,
dst_memory, dst_row_pitch, 0, &dst_size, dst_desc, color_key, src_palette);
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
{
if ((filter_flags & 0xf) != D3DX_FILTER_POINT)
FIXME("Unhandled filter %#x.\n", filter_flags);
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
point_filter_argb_pixels(src_memory_offset, src_row_pitch, 0, &src_size, src_desc, dst_memory, dst_row_pitch, 0,
&dst_size, dst_desc, color_key, src_palette);
}
return hr;
}
/************************************************************
* D3DXLoadSurfaceFromMemory
*
@ -1913,7 +2117,6 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
DWORD filter, D3DCOLOR color_key)
{
const struct pixel_format_desc *srcformatdesc, *destformatdesc;
struct volume src_size, dst_size, dst_size_aligned;
RECT dst_rect_temp, dst_rect_aligned;
IDirect3DSurface9 *surface;
D3DSURFACE_DESC surfdesc;
@ -1945,10 +2148,6 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
return E_NOTIMPL;
}
src_size.width = src_rect->right - src_rect->left;
src_size.height = src_rect->bottom - src_rect->top;
src_size.depth = 1;
IDirect3DSurface9_GetDesc(dst_surface, &surfdesc);
destformatdesc = get_format_info(surfdesc.Format);
if (!dst_rect)
@ -1987,172 +2186,16 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
dst_rect_aligned.bottom = min((dst_rect_aligned.bottom + destformatdesc->block_height - 1)
& ~(destformatdesc->block_height - 1), surfdesc.Height);
dst_size.width = dst_rect->right - dst_rect->left;
dst_size.height = dst_rect->bottom - dst_rect->top;
dst_size.depth = 1;
dst_size_aligned.width = dst_rect_aligned.right - dst_rect_aligned.left;
dst_size_aligned.height = dst_rect_aligned.bottom - dst_rect_aligned.top;
dst_size_aligned.depth = 1;
if (filter == D3DX_DEFAULT)
filter = D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER;
if (FAILED(hr = lock_surface(dst_surface, &dst_rect_aligned, &lockrect, &surface, TRUE)))
return hr;
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
&& dst_size.height == src_size.height
&& color_key == 0
&& !(src_rect->left & (srcformatdesc->block_width - 1))
&& !(src_rect->top & (srcformatdesc->block_height - 1))
&& !(dst_rect->left & (destformatdesc->block_width - 1))
&& !(dst_rect->top & (destformatdesc->block_height - 1)))
{
TRACE("Simple copy.\n");
copy_pixels(src_memory, src_pitch, 0, lockrect.pBits, lockrect.Pitch, 0,
&src_size, srcformatdesc);
}
else /* Stretching or format conversion. */
{
const struct pixel_format_desc *dst_format;
DWORD *src_uncompressed = NULL;
BYTE *dst_uncompressed = NULL;
unsigned int dst_pitch;
BYTE *dst_mem;
if (!is_conversion_from_supported(srcformatdesc)
|| !is_conversion_to_supported(destformatdesc))
{
FIXME("Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.Format);
unlock_surface(dst_surface, &dst_rect_aligned, surface, FALSE);
return E_NOTIMPL;
}
if (srcformatdesc->type == FORMAT_DXT)
{
void (*fetch_dxt_texel)(int srcRowStride, const BYTE *pixdata,
int i, int j, void *texel);
unsigned int x, y;
src_pitch = src_pitch * srcformatdesc->block_width / srcformatdesc->block_byte_count;
src_uncompressed = malloc(src_size.width * src_size.height * sizeof(DWORD));
if (!src_uncompressed)
{
unlock_surface(dst_surface, &dst_rect_aligned, surface, FALSE);
return E_OUTOFMEMORY;
}
switch(src_format)
{
case D3DFMT_DXT1:
fetch_dxt_texel = fetch_2d_texel_rgba_dxt1;
break;
case D3DFMT_DXT2:
case D3DFMT_DXT3:
fetch_dxt_texel = fetch_2d_texel_rgba_dxt3;
break;
case D3DFMT_DXT4:
case D3DFMT_DXT5:
fetch_dxt_texel = fetch_2d_texel_rgba_dxt5;
break;
default:
FIXME("Unexpected compressed texture format %u.\n", src_format);
fetch_dxt_texel = NULL;
}
TRACE("Uncompressing DXTn surface.\n");
for (y = 0; y < src_size.height; ++y)
{
DWORD *ptr = &src_uncompressed[y * src_size.width];
for (x = 0; x < src_size.width; ++x)
{
fetch_dxt_texel(src_pitch, src_memory, x + src_rect->left, y + src_rect->top, ptr);
++ptr;
}
}
src_memory = src_uncompressed;
src_pitch = src_size.width * sizeof(DWORD);
srcformatdesc = get_format_info(D3DFMT_A8B8G8R8);
}
if (destformatdesc->type == FORMAT_DXT)
{
BOOL dst_misaligned = dst_rect->left != dst_rect_aligned.left
|| dst_rect->top != dst_rect_aligned.top
|| dst_rect->right != dst_rect_aligned.right
|| dst_rect->bottom != dst_rect_aligned.bottom;
size_t dst_uncompressed_size = dst_size_aligned.width * dst_size_aligned.height * sizeof(DWORD);
dst_uncompressed = malloc(dst_uncompressed_size);
if (!dst_uncompressed)
{
free(src_uncompressed);
unlock_surface(dst_surface, &dst_rect_aligned, surface, FALSE);
return E_OUTOFMEMORY;
}
if (dst_misaligned) memset(dst_uncompressed, 0, dst_uncompressed_size);
dst_pitch = dst_size_aligned.width * sizeof(DWORD);
dst_format = get_format_info(D3DFMT_A8B8G8R8);
dst_mem = dst_uncompressed + (dst_rect->top - dst_rect_aligned.top) * dst_pitch
+ (dst_rect->left - dst_rect_aligned.left) * sizeof(DWORD);
}
else
{
dst_mem = lockrect.pBits;
dst_pitch = lockrect.Pitch;
dst_format = destformatdesc;
}
if ((filter & 0xf) == D3DX_FILTER_NONE)
{
convert_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
dst_mem, dst_pitch, 0, &dst_size, dst_format, color_key, src_palette);
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
{
if ((filter & 0xf) != D3DX_FILTER_POINT)
FIXME("Unhandled filter %#lx.\n", filter);
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
point_filter_argb_pixels(src_memory, src_pitch, 0, &src_size, srcformatdesc,
dst_mem, dst_pitch, 0, &dst_size, dst_format, color_key, src_palette);
}
free(src_uncompressed);
if (dst_uncompressed)
{
GLenum gl_format = 0;
TRACE("Compressing DXTn surface.\n");
switch(surfdesc.Format)
{
case D3DFMT_DXT1:
gl_format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
break;
case D3DFMT_DXT2:
case D3DFMT_DXT3:
gl_format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
break;
case D3DFMT_DXT4:
case D3DFMT_DXT5:
gl_format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
default:
ERR("Unexpected destination compressed format %u.\n", surfdesc.Format);
}
tx_compress_dxtn(4, dst_size_aligned.width, dst_size_aligned.height,
dst_uncompressed, gl_format, lockrect.pBits,
lockrect.Pitch);
free(dst_uncompressed);
}
}
hr = d3dx_load_image_from_memory(lockrect.pBits, lockrect.Pitch, destformatdesc, dst_palette, dst_rect,
&dst_rect_aligned, src_memory, src_pitch, srcformatdesc, src_palette, src_rect, filter, color_key);
if (FAILED(hr))
WARN("d3dx_load_image_from_memory failed with hr %#lx\n", hr);
return unlock_surface(dst_surface, &dst_rect_aligned, surface, TRUE);
}

View file

@ -257,12 +257,7 @@ static void test_create_effect_and_pool(IDirect3DDevice9 *device)
ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
todo_wine ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
if (FAILED(hr))
{
skip("Failed to compile effect, skipping test.\n");
return;
}
ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
ok(hr == E_NOINTERFACE, "QueryInterface failed, got %lx, expected %lx (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
@ -8047,8 +8042,6 @@ static void test_create_effect_from_file(void)
trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
ID3DXBuffer_Release(messages);
}
if (effect)
effect->lpVtbl->Release(effect);
delete_file("effect1.fx");
delete_file("effect2.fx");

View file

@ -23,6 +23,7 @@
#include "wine/test.h"
#include "d3dx9tex.h"
#include "resources.h"
#include <stdint.h>
#define check_release(obj, exp) _check_release(__LINE__, obj, exp)
static inline void _check_release(unsigned int line, IUnknown *obj, int exp)
@ -279,6 +280,87 @@ static const BYTE dds_dxt5_8_8[] =
0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x05,0x05,0x50,0x50,
};
/*
* 8x8 dxt5 image data, four 4x4 blocks:
* +-----+-----+
* |Blue |Green|
* | | |
* +-----+-----+
* |Red |Black|
* | | |
* +-----+-----+
*/
static const BYTE dxt5_8_8[] =
{
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0xe0,0x07,0x00,0x00,0x00,0x00,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,0x00,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
struct surface_readback
{
IDirect3DSurface9 *surface;
D3DLOCKED_RECT locked_rect;
};
static uint32_t get_readback_color(struct surface_readback *rb, uint32_t x, uint32_t y)
{
return rb->locked_rect.pBits
? ((uint32_t *)rb->locked_rect.pBits)[y * rb->locked_rect.Pitch / sizeof(uint32_t) + x] : 0xdeadbeef;
}
static void release_surface_readback(struct surface_readback *rb)
{
HRESULT hr;
if (!rb->surface)
return;
if (rb->locked_rect.pBits && FAILED(hr = IDirect3DSurface9_UnlockRect(rb->surface)))
trace("Can't unlock the offscreen surface, hr %#lx.\n", hr);
IDirect3DSurface9_Release(rb->surface);
}
static void get_surface_decompressed_readback(IDirect3DDevice9 *device, IDirect3DSurface9 *compressed_surface,
struct surface_readback *rb)
{
D3DSURFACE_DESC desc;
HRESULT hr;
memset(rb, 0, sizeof(*rb));
hr = IDirect3DSurface9_GetDesc(compressed_surface, &desc);
if (FAILED(hr))
{
trace("Failed to get compressed surface description, hr %#lx.\n", hr);
return;
}
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM,
&rb->surface, NULL);
if (FAILED(hr))
{
trace("Can't create the decompressed surface, hr %#lx.\n", hr);
return;
}
hr = D3DXLoadSurfaceFromSurface(rb->surface, NULL, NULL, compressed_surface, NULL, NULL, D3DX_FILTER_NONE, 0);
if (FAILED(hr))
{
trace("Can't load the decompressed surface, hr %#lx.\n", hr);
IDirect3DSurface9_Release(rb->surface);
rb->surface = NULL;
return;
}
hr = IDirect3DSurface9_LockRect(rb->surface, &rb->locked_rect, NULL, D3DLOCK_READONLY);
if (FAILED(hr))
{
trace("Can't lock the offscreen surface, hr %#lx.\n", hr);
IDirect3DSurface9_Release(rb->surface);
rb->surface = NULL;
}
}
static HRESULT create_file(const char *filename, const unsigned char *data, const unsigned int size)
{
DWORD received;
@ -832,6 +914,14 @@ static inline void _check_pixel_4bpp(unsigned int line, const D3DLOCKED_RECT *lo
ok_(__FILE__, line)(color == expected_color, "Got color 0x%08lx, expected 0x%08lx\n", color, expected_color);
}
#define check_readback_pixel_4bpp(rb, x, y, color, todo) _check_readback_pixel_4bpp(__LINE__, rb, x, y, color, todo)
static inline void _check_readback_pixel_4bpp(unsigned int line, struct surface_readback *rb, uint32_t x,
uint32_t y, uint32_t expected_color, BOOL todo)
{
uint32_t color = get_readback_color(rb, x, y);
todo_wine_if(todo) ok_(__FILE__, line)(color == expected_color, "Got color 0x%08x, expected 0x%08x.\n", color, expected_color);
}
static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
{
HRESULT hr;
@ -1450,6 +1540,8 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
skip("Failed to create DXT5 texture, hr %#lx.\n", hr);
else
{
struct surface_readback surface_rb;
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#lx.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
@ -1521,6 +1613,57 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
check_release((IUnknown *)newsurf, 1);
check_release((IUnknown *)tex, 0);
/* Misalignment tests but check the resulting image. */
hr = IDirect3DDevice9_CreateTexture(device, 8, 8, 1, 0, D3DFMT_DXT5, D3DPOOL_SYSTEMMEM, &tex, NULL);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
SetRect(&rect, 0, 0, 8, 8);
hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, NULL, dxt5_8_8,
D3DFMT_DXT5, 16 * 2, NULL, &rect, D3DX_FILTER_NONE, 0);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
get_surface_decompressed_readback(device, newsurf, &surface_rb);
check_readback_pixel_4bpp(&surface_rb, 0, 0, 0xff0000ff, FALSE); /* Blue block, top left. */
check_readback_pixel_4bpp(&surface_rb, 3, 3, 0xff0000ff, FALSE); /* Blue block, bottom right. */
check_readback_pixel_4bpp(&surface_rb, 7, 0, 0xff00ff00, FALSE); /* Green block, top right. */
check_readback_pixel_4bpp(&surface_rb, 4, 3, 0xff00ff00, FALSE); /* Green block, bottom left. */
check_readback_pixel_4bpp(&surface_rb, 3, 4, 0xffff0000, FALSE); /* Red block, top right. */
check_readback_pixel_4bpp(&surface_rb, 0, 7, 0xffff0000, FALSE); /* Red block, bottom left. */
check_readback_pixel_4bpp(&surface_rb, 4, 4, 0xff000000, FALSE); /* Black block, top left. */
check_readback_pixel_4bpp(&surface_rb, 7, 7, 0xff000000, FALSE); /* Black block, bottom right. */
release_surface_readback(&surface_rb);
/*
* Load our surface into a destination rectangle that overlaps
* multiple blocks. Original data in the blocks should be
* preserved.
*/
SetRect(&rect, 4, 4, 8, 8);
SetRect(&destrect, 2, 2, 6, 6);
hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, &destrect, dxt5_8_8,
D3DFMT_DXT5, 16 * 2, NULL, &rect, D3DX_FILTER_NONE, 0);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
get_surface_decompressed_readback(device, newsurf, &surface_rb);
check_readback_pixel_4bpp(&surface_rb, 0, 0, 0xff0000ff, FALSE); /* Blue block, top left. */
check_readback_pixel_4bpp(&surface_rb, 3, 3, 0xff000000, FALSE); /* Blue block, bottom right. */
check_readback_pixel_4bpp(&surface_rb, 7, 0, 0xff00ff00, FALSE); /* Green block, top right. */
check_readback_pixel_4bpp(&surface_rb, 4, 3, 0xff000000, FALSE); /* Green block, bottom left. */
check_readback_pixel_4bpp(&surface_rb, 3, 4, 0xff000000, FALSE); /* Red block, top right. */
check_readback_pixel_4bpp(&surface_rb, 0, 7, 0xffff0000, FALSE); /* Red block, bottom left. */
check_readback_pixel_4bpp(&surface_rb, 4, 4, 0xff000000, FALSE); /* Black block, top left. */
check_readback_pixel_4bpp(&surface_rb, 7, 7, 0xff000000, FALSE); /* Black block, bottom right. */
release_surface_readback(&surface_rb);
check_release((IUnknown *)newsurf, 1);
check_release((IUnknown *)tex, 0);
}
hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_DXT1, D3DPOOL_SYSTEMMEM, &tex, NULL);

View file

@ -279,6 +279,7 @@ static int get_opcode_size(UNWIND_CODE op)
return 2 + (op.OpInfo != 0);
case UWOP_SAVE_NONVOL:
case UWOP_SAVE_XMM128:
case UWOP_EPILOG:
return 2;
case UWOP_SAVE_NONVOL_FAR:
case UWOP_SAVE_XMM128_FAR:
@ -586,6 +587,9 @@ static BOOL interpret_function_table_entry(struct cpu_stack_walk* csw,
if (!sw_read_mem(csw, context->Rsp + 24, &context->Rsp, sizeof(DWORD64))) return FALSE;
mach_frame = TRUE;
break;
case UWOP_EPILOG:
if (info->Version == 2)
break; /* nothing to do */
default:
FIXME("unknown code %u\n", info->UnwindCode[i].UnwindOp);
break;
@ -729,31 +733,46 @@ static BOOL x86_64_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame,
static void* x86_64_find_runtime_function(struct module* module, DWORD64 addr)
{
#ifdef __x86_64__
RUNTIME_FUNCTION* rtf;
ULONG size;
int min, max;
RUNTIME_FUNCTION *func = NULL;
const RUNTIME_FUNCTION *rtf;
ULONG size;
rtf = (RUNTIME_FUNCTION*)pe_map_directory(module, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size);
if (rtf) for (min = 0, max = size / sizeof(*rtf); min <= max; )
rtf = (const RUNTIME_FUNCTION*)pe_map_directory(module, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size);
if (rtf)
{
int pos = (min + max) / 2;
if (addr < module->module.BaseOfImage + rtf[pos].BeginAddress) max = pos - 1;
else if (addr >= module->module.BaseOfImage + rtf[pos].EndAddress) min = pos + 1;
else
int lo, hi;
for (lo = 0, hi = size / sizeof(*rtf); lo <= hi; )
{
rtf += pos;
while (rtf->UnwindData & 1) /* follow chained entry */
int pos = (lo + hi) / 2;
if (addr < module->module.BaseOfImage + rtf[pos].BeginAddress) hi = pos - 1;
else if (addr >= module->module.BaseOfImage + rtf[pos].EndAddress) lo = pos + 1;
else if ((func = fetch_buffer(module->process, sizeof(*func))))
{
FIXME("RunTime_Function outside IMAGE_DIRECTORY_ENTRY_EXCEPTION unimplemented yet!\n");
return NULL;
/* we need to read into the other process */
/* rtf = (RUNTIME_FUNCTION*)(module->module.BaseOfImage + (rtf->UnwindData & ~1)); */
*func = rtf[pos];
while (func && (func->UnwindData & 1))
{
const BYTE *next = pe_lock_region_from_rva(module, func->UnwindData & ~1, sizeof(*func), NULL);
if (next)
{
*func = *(const RUNTIME_FUNCTION *)next;
pe_unlock_region(module, next);
}
else
{
WARN("Couldn't find chained RUNTIME_FUNCTION\n");
func = NULL;
}
}
break;
}
return rtf;
}
pe_unmap_directory(module, IMAGE_DIRECTORY_ENTRY_EXCEPTION, (const char*)rtf);
}
#endif
return func;
#else
return NULL;
#endif
}
static unsigned x86_64_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame)
@ -951,44 +970,7 @@ static BOOL x86_64_fetch_minidump_thread(struct dump_context* dc, unsigned index
static BOOL x86_64_fetch_minidump_module(struct dump_context* dc, unsigned index, unsigned flags)
{
/* FIXME: not sure about the flags... */
if (1)
{
/* FIXME: crop values across module boundaries, */
#ifdef __x86_64__
struct process* pcs;
struct module* module;
const RUNTIME_FUNCTION* rtf;
ULONG size;
if (!(pcs = process_find_by_handle(dc->process->handle)) ||
!(module = module_find_by_addr(pcs, dc->modules[index].base)))
return FALSE;
rtf = (const RUNTIME_FUNCTION*)pe_map_directory(module, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size);
if (rtf)
{
const RUNTIME_FUNCTION* end = (const RUNTIME_FUNCTION*)((const char*)rtf + size);
UNWIND_INFO ui;
while (rtf + 1 < end)
{
while (rtf->UnwindData & 1) /* follow chained entry */
{
FIXME("RunTime_Function outside IMAGE_DIRECTORY_ENTRY_EXCEPTION unimplemented yet!\n");
return FALSE;
/* we need to read into the other process */
/* rtf = (RUNTIME_FUNCTION*)(module->module.BaseOfImage + (rtf->UnwindData & ~1)); */
}
if (read_process_memory(dc->process, dc->modules[index].base + rtf->UnwindData, &ui, sizeof(ui)))
minidump_add_memory_block(dc, dc->modules[index].base + rtf->UnwindData,
FIELD_OFFSET(UNWIND_INFO, UnwindCode) + ui.CountOfCodes * sizeof(UNWIND_CODE), 0);
rtf++;
}
}
#endif
}
return TRUE;
return FALSE;
}
struct cpu cpu_x86_64 = {

View file

@ -438,9 +438,11 @@ struct module
struct process* process;
IMAGEHLP_MODULEW64 module;
WCHAR modulename[64]; /* used for enumeration */
WCHAR* alt_modulename; /* used in symbol lookup */
struct module* next;
enum dhext_module_type type : 16;
unsigned short is_virtual : 1,
dont_load_symbols : 1,
is_wine_builtin : 1,
has_file_image : 1;
struct cpu* cpu;
@ -548,17 +550,6 @@ struct module_pair
struct module* effective; /* out: module with debug info */
};
enum pdb_kind {PDB_JG, PDB_DS};
struct pdb_lookup
{
const char* filename;
enum pdb_kind kind;
unsigned int age;
unsigned int timestamp;
GUID guid;
};
struct cpu_stack_walk
{
HANDLE hProcess;
@ -627,7 +618,9 @@ struct dump_context
struct dump_module* modules;
unsigned num_modules;
unsigned alloc_modules;
/* exception information */
/* outter information */
MINIDUMP_EXCEPTION_INFORMATION *except_param;
MINIDUMP_USER_STREAM_INFORMATION *user_stream;
/* output information */
MINIDUMP_TYPE type;
HANDLE hFile;
@ -759,7 +752,6 @@ extern BOOL pe_load_debug_directory(const struct process* pcs,
const IMAGE_DEBUG_DIRECTORY* dbg, int nDbg);
extern DWORD msc_get_file_indexinfo(void* image, const IMAGE_DEBUG_DIRECTORY* dbgdir, DWORD size,
SYMSRV_INDEX_INFOW* info);
extern BOOL pdb_fetch_file_info(const struct pdb_lookup* pdb_lookup, unsigned* matched);
struct pdb_cmd_pair {
const char* name;
DWORD* pvalue;
@ -770,9 +762,9 @@ extern DWORD pdb_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW*
extern DWORD dbg_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info);
/* path.c */
extern BOOL path_find_symbol_file(const struct process* pcs, const struct module* module,
extern BOOL path_find_symbol_file(const struct process *pcs, const struct module *module,
PCSTR full_path, BOOL is_pdb, const GUID* guid, DWORD dw1, DWORD dw2,
WCHAR *buffer, BOOL* is_unmatched);
SYMSRV_INDEX_INFOW *info, BOOL *unmatched);
extern WCHAR *get_dos_file_name(const WCHAR *filename) __WINE_DEALLOC(HeapFree, 3) __WINE_MALLOC;
extern BOOL search_dll_path(const struct process* process, const WCHAR *name, WORD machine,
BOOL (*match)(void*, HANDLE, const WCHAR*), void *param);
@ -791,7 +783,10 @@ extern struct module*
extern BOOL pe_load_debug_info(const struct process* pcs,
struct module* module);
extern const char* pe_map_directory(struct module* module, int dirno, DWORD* size);
extern BOOL pe_unmap_directory(struct module* module, int dirno, const char*);
extern DWORD pe_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info);
extern const BYTE* pe_lock_region_from_rva(struct module *module, DWORD rva, DWORD size, DWORD *length);
extern BOOL pe_unlock_region(struct module *module, const BYTE* region);
/* source.c */
extern unsigned source_new(struct module* module, const char* basedir, const char* source);

View file

@ -61,15 +61,19 @@ static BOOL fetch_process_info(struct dump_context* dc)
{
if (HandleToUlong(spi->UniqueProcessId) == dc->pid)
{
dc->num_threads = spi->dwThreadCount;
dc->num_threads = 0;
dc->threads = HeapAlloc(GetProcessHeap(), 0,
dc->num_threads * sizeof(dc->threads[0]));
if (!dc->threads) goto failed;
for (i = 0; i < dc->num_threads; i++)
spi->dwThreadCount * sizeof(dc->threads[0]));
if (!dc->threads) break;
for (i = 0; i < spi->dwThreadCount; i++)
{
dc->threads[i].tid = HandleToULong(spi->ti[i].ClientId.UniqueThread);
dc->threads[i].prio_class = spi->ti[i].dwBasePriority; /* FIXME */
dc->threads[i].curr_prio = spi->ti[i].dwCurrentPriority;
/* don't include current thread */
if (HandleToULong(spi->ti[i].ClientId.UniqueThread) == GetCurrentThreadId())
continue;
dc->threads[dc->num_threads].tid = HandleToULong(spi->ti[i].ClientId.UniqueThread);
dc->threads[dc->num_threads].prio_class = spi->ti[i].dwBasePriority; /* FIXME */
dc->threads[dc->num_threads].curr_prio = spi->ti[i].dwCurrentPriority;
dc->num_threads++;
}
HeapFree(GetProcessHeap(), 0, pcs_buffer);
return TRUE;
@ -78,7 +82,6 @@ static BOOL fetch_process_info(struct dump_context* dc)
spi = (SYSTEM_PROCESS_INFORMATION*)((char*)spi + spi->NextEntryOffset);
}
}
failed:
HeapFree(GetProcessHeap(), 0, pcs_buffer);
return FALSE;
}
@ -116,7 +119,6 @@ static void fetch_thread_stack(struct dump_context* dc, const void* teb_addr,
* fetches some information about thread of id 'tid'
*/
static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx,
const MINIDUMP_EXCEPTION_INFORMATION* except,
MINIDUMP_THREAD* mdThd, CONTEXT* ctx)
{
DWORD tid = dc->threads[thd_idx].tid;
@ -141,44 +143,22 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx,
FIXME("Couldn't open thread %lu (%lu)\n", tid, GetLastError());
return FALSE;
}
if (NtQueryInformationThread(hThread, ThreadBasicInformation,
&tbi, sizeof(tbi), NULL) == STATUS_SUCCESS)
{
mdThd->Teb = (ULONG_PTR)tbi.TebBaseAddress;
if (tbi.ExitStatus == STILL_ACTIVE)
{
if (tid != GetCurrentThreadId() &&
(mdThd->SuspendCount = SuspendThread(hThread)) != (DWORD)-1)
{
ctx->ContextFlags = CONTEXT_FULL;
if (!GetThreadContext(hThread, ctx))
memset(ctx, 0, sizeof(*ctx));
fetch_thread_stack(dc, tbi.TebBaseAddress, ctx, &mdThd->Stack);
ResumeThread(hThread);
}
else if (tid == GetCurrentThreadId() && except)
{
CONTEXT lctx, *pctx;
mdThd->SuspendCount = 1;
if (except->ClientPointers)
{
EXCEPTION_POINTERS ep;
ReadProcessMemory(dc->process->handle, except->ExceptionPointers,
&ep, sizeof(ep), NULL);
ReadProcessMemory(dc->process->handle, ep.ContextRecord,
&lctx, sizeof(lctx), NULL);
pctx = &lctx;
}
else pctx = except->ExceptionPointers->ContextRecord;
*ctx = *pctx;
fetch_thread_stack(dc, tbi.TebBaseAddress, pctx, &mdThd->Stack);
}
else mdThd->SuspendCount = 0;
mdThd->SuspendCount = SuspendThread(hThread);
ctx->ContextFlags = CONTEXT_ALL;
if (!GetThreadContext(hThread, ctx))
memset(ctx, 0, sizeof(*ctx));
fetch_thread_stack(dc, tbi.TebBaseAddress, ctx, &mdThd->Stack);
ResumeThread(hThread);
}
else
mdThd->SuspendCount = (DWORD)-1;
}
CloseHandle(hThread);
return TRUE;
@ -397,22 +377,21 @@ static void append(struct dump_context* dc, const void* data, unsigned size)
*
* Write in File the exception information from pcs
*/
static unsigned dump_exception_info(struct dump_context* dc,
const MINIDUMP_EXCEPTION_INFORMATION* except)
static unsigned dump_exception_info(struct dump_context* dc)
{
MINIDUMP_EXCEPTION_STREAM mdExcpt;
EXCEPTION_RECORD rec, *prec;
CONTEXT ctx, *pctx;
DWORD i;
mdExcpt.ThreadId = except->ThreadId;
mdExcpt.ThreadId = dc->except_param->ThreadId;
mdExcpt.__alignment = 0;
if (except->ClientPointers)
if (dc->except_param->ClientPointers)
{
EXCEPTION_POINTERS ep;
ReadProcessMemory(dc->process->handle,
except->ExceptionPointers, &ep, sizeof(ep), NULL);
dc->except_param->ExceptionPointers, &ep, sizeof(ep), NULL);
ReadProcessMemory(dc->process->handle,
ep.ExceptionRecord, &rec, sizeof(rec), NULL);
ReadProcessMemory(dc->process->handle,
@ -422,8 +401,8 @@ static unsigned dump_exception_info(struct dump_context* dc,
}
else
{
prec = except->ExceptionPointers->ExceptionRecord;
pctx = except->ExceptionPointers->ContextRecord;
prec = dc->except_param->ExceptionPointers->ExceptionRecord;
pctx = dc->except_param->ExceptionPointers->ContextRecord;
}
mdExcpt.ExceptionRecord.ExceptionCode = prec->ExceptionCode;
mdExcpt.ExceptionRecord.ExceptionFlags = prec->ExceptionFlags;
@ -715,8 +694,7 @@ static unsigned dump_system_info(struct dump_context* dc)
*
* Dumps into File the information about running threads
*/
static unsigned dump_threads(struct dump_context* dc,
const MINIDUMP_EXCEPTION_INFORMATION* except)
static unsigned dump_threads(struct dump_context* dc)
{
MINIDUMP_THREAD mdThd;
MINIDUMP_THREAD_LIST mdThdList;
@ -732,7 +710,7 @@ static unsigned dump_threads(struct dump_context* dc,
for (i = 0; i < dc->num_threads; i++)
{
fetch_thread_info(dc, i, except, &mdThd, &ctx);
fetch_thread_info(dc, i, &mdThd, &ctx);
flags_out = ThreadWriteThread | ThreadWriteStack | ThreadWriteContext |
ThreadWriteInstructionWindow;
@ -906,6 +884,126 @@ static unsigned dump_misc_info(struct dump_context* dc)
return sizeof(mmi);
}
static DWORD CALLBACK write_minidump(void *_args)
{
struct dump_context *dc = _args;
static const MINIDUMP_DIRECTORY emptyDir = {UnusedStream, {0, 0}};
MINIDUMP_HEADER mdHead;
MINIDUMP_DIRECTORY mdDir;
DWORD i, nStreams, idx_stream;
if (!fetch_process_info(dc)) return FALSE;
fetch_modules_info(dc);
/* 1) init */
nStreams = 6 + (dc->except_param ? 1 : 0) +
(dc->user_stream ? dc->user_stream->UserStreamCount : 0);
/* pad the directory size to a multiple of 4 for alignment purposes */
nStreams = (nStreams + 3) & ~3;
/* 2) write header */
mdHead.Signature = MINIDUMP_SIGNATURE;
mdHead.Version = MINIDUMP_VERSION; /* NOTE: native puts in an 'implementation specific' value in the high order word of this member */
mdHead.NumberOfStreams = nStreams;
mdHead.CheckSum = 0; /* native sets a 0 checksum in its files */
mdHead.StreamDirectoryRva = sizeof(mdHead);
mdHead.TimeDateStamp = time(NULL);
mdHead.Flags = dc->type;
append(dc, &mdHead, sizeof(mdHead));
/* 3) write stream directories */
dc->rva += nStreams * sizeof(mdDir);
idx_stream = 0;
/* 3.1) write data stream directories */
/* must be first in minidump */
mdDir.StreamType = SystemInfoStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_system_info(dc);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
mdDir.StreamType = ThreadListStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_threads(dc);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
mdDir.StreamType = ModuleListStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_modules(dc, FALSE);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
mdDir.StreamType = 0xfff0; /* FIXME: this is part of MS reserved streams */
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_modules(dc, TRUE);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
if (!(dc->type & MiniDumpWithFullMemory))
{
mdDir.StreamType = MemoryListStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_memory_info(dc);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
}
mdDir.StreamType = MiscInfoStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_misc_info(dc);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
/* 3.2) write exception information (if any) */
if (dc->except_param)
{
mdDir.StreamType = ExceptionStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_exception_info(dc);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
}
/* 3.3) write user defined streams (if any) */
if (dc->user_stream)
{
for (i = 0; i < dc->user_stream->UserStreamCount; i++)
{
mdDir.StreamType = dc->user_stream->UserStreamArray[i].Type;
mdDir.Location.DataSize = dc->user_stream->UserStreamArray[i].BufferSize;
mdDir.Location.Rva = dc->rva;
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
append(dc, dc->user_stream->UserStreamArray[i].Buffer,
dc->user_stream->UserStreamArray[i].BufferSize);
}
}
/* 3.4) write full memory (if requested) */
if (dc->type & MiniDumpWithFullMemory)
{
fetch_memory64_info(dc);
mdDir.StreamType = Memory64ListStream;
mdDir.Location.Rva = dc->rva;
mdDir.Location.DataSize = dump_memory64_info(dc);
writeat(dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
}
/* fill the remaining directory entries with 0's (unused stream types) */
/* NOTE: this should always come last in the dump! */
for (i = idx_stream; i < nStreams; i++)
writeat(dc, mdHead.StreamDirectoryRva + i * sizeof(emptyDir), &emptyDir, sizeof(emptyDir));
return TRUE;
}
/******************************************************************
* MiniDumpWriteDump (DEBUGHLP.@)
*
@ -916,12 +1014,9 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
PMINIDUMP_CALLBACK_INFORMATION CallbackParam)
{
static const MINIDUMP_DIRECTORY emptyDir = {UnusedStream, {0, 0}};
MINIDUMP_HEADER mdHead;
MINIDUMP_DIRECTORY mdDir;
DWORD i, nStreams, idx_stream;
struct dump_context dc;
BOOL sym_initialized = FALSE;
BOOL ret = FALSE;
if (!(dc.process = process_find_by_handle(hProcess)))
{
@ -933,6 +1028,15 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
dc.process = process_find_by_handle(hProcess);
}
if (DumpType & MiniDumpWithDataSegs)
FIXME("NIY MiniDumpWithDataSegs\n");
if (DumpType & MiniDumpWithHandleData)
FIXME("NIY MiniDumpWithHandleData\n");
if (DumpType & MiniDumpFilterMemory)
FIXME("NIY MiniDumpFilterMemory\n");
if (DumpType & MiniDumpScanMemory)
FIXME("NIY MiniDumpScanMemory\n");
dc.hFile = hFile;
dc.pid = pid;
dc.modules = NULL;
@ -949,125 +1053,26 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
dc.num_mem64 = 0;
dc.alloc_mem64 = 0;
dc.rva = 0;
dc.except_param = ExceptionParam;
dc.user_stream = UserStreamParam;
if (!fetch_process_info(&dc)) return FALSE;
fetch_modules_info(&dc);
/* 1) init */
nStreams = 6 + (ExceptionParam ? 1 : 0) +
(UserStreamParam ? UserStreamParam->UserStreamCount : 0);
/* pad the directory size to a multiple of 4 for alignment purposes */
nStreams = (nStreams + 3) & ~3;
if (DumpType & MiniDumpWithDataSegs)
FIXME("NIY MiniDumpWithDataSegs\n");
if (DumpType & MiniDumpWithHandleData)
FIXME("NIY MiniDumpWithHandleData\n");
if (DumpType & MiniDumpFilterMemory)
FIXME("NIY MiniDumpFilterMemory\n");
if (DumpType & MiniDumpScanMemory)
FIXME("NIY MiniDumpScanMemory\n");
/* 2) write header */
mdHead.Signature = MINIDUMP_SIGNATURE;
mdHead.Version = MINIDUMP_VERSION; /* NOTE: native puts in an 'implementation specific' value in the high order word of this member */
mdHead.NumberOfStreams = nStreams;
mdHead.CheckSum = 0; /* native sets a 0 checksum in its files */
mdHead.StreamDirectoryRva = sizeof(mdHead);
mdHead.TimeDateStamp = time(NULL);
mdHead.Flags = DumpType;
append(&dc, &mdHead, sizeof(mdHead));
/* 3) write stream directories */
dc.rva += nStreams * sizeof(mdDir);
idx_stream = 0;
/* 3.1) write data stream directories */
/* must be first in minidump */
mdDir.StreamType = SystemInfoStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_system_info(&dc);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
mdDir.StreamType = ThreadListStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_threads(&dc, ExceptionParam);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
mdDir.StreamType = ModuleListStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_modules(&dc, FALSE);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
mdDir.StreamType = 0xfff0; /* FIXME: this is part of MS reserved streams */
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_modules(&dc, TRUE);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
if (!(DumpType & MiniDumpWithFullMemory))
/* have a dedicated thread for fetching info on self */
if (dc.pid != GetCurrentProcessId())
ret = write_minidump(&dc);
else
{
mdDir.StreamType = MemoryListStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_memory_info(&dc);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
}
mdDir.StreamType = MiscInfoStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_misc_info(&dc);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
/* 3.2) write exception information (if any) */
if (ExceptionParam)
{
mdDir.StreamType = ExceptionStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_exception_info(&dc, ExceptionParam);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
}
/* 3.3) write user defined streams (if any) */
if (UserStreamParam)
{
for (i = 0; i < UserStreamParam->UserStreamCount; i++)
DWORD exit_code;
HANDLE h = CreateThread(NULL, 0, write_minidump, &dc, 0, NULL);
if (h)
{
mdDir.StreamType = UserStreamParam->UserStreamArray[i].Type;
mdDir.Location.DataSize = UserStreamParam->UserStreamArray[i].BufferSize;
mdDir.Location.Rva = dc.rva;
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
append(&dc, UserStreamParam->UserStreamArray[i].Buffer,
UserStreamParam->UserStreamArray[i].BufferSize);
if (WaitForSingleObject(h, INFINITE) == WAIT_OBJECT_0 && GetExitCodeThread(h, &exit_code))
ret = exit_code;
else
TerminateThread(h, 0);
CloseHandle(h);
}
}
/* 3.4) write full memory (if requested) */
if (DumpType & MiniDumpWithFullMemory)
{
fetch_memory64_info(&dc);
mdDir.StreamType = Memory64ListStream;
mdDir.Location.Rva = dc.rva;
mdDir.Location.DataSize = dump_memory64_info(&dc);
writeat(&dc, mdHead.StreamDirectoryRva + idx_stream++ * sizeof(mdDir),
&mdDir, sizeof(mdDir));
}
/* fill the remaining directory entries with 0's (unused stream types) */
/* NOTE: this should always come last in the dump! */
for (i = idx_stream; i < nStreams; i++)
writeat(&dc, mdHead.StreamDirectoryRva + i * sizeof(emptyDir), &emptyDir, sizeof(emptyDir));
if (sym_initialized)
SymCleanup(hProcess);
@ -1076,7 +1081,7 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
HeapFree(GetProcessHeap(), 0, dc.modules);
HeapFree(GetProcessHeap(), 0, dc.threads);
return TRUE;
return ret;
}
/******************************************************************

View file

@ -210,6 +210,7 @@ struct module* module_new(struct process* pcs, const WCHAR* name,
module->module.BaseOfImage = mod_addr;
module->module.ImageSize = size;
module_set_module(module, name);
module->alt_modulename = NULL;
module->module.ImageName[0] = '\0';
lstrcpynW(module->module.LoadedImageName, name, ARRAY_SIZE(module->module.LoadedImageName));
module->module.SymType = SymDeferred;
@ -288,6 +289,7 @@ struct module* module_find_by_nameW(const struct process* pcs, const WCHAR* name
for (module = pcs->lmodules; module; module = module->next)
{
if (!wcsicmp(name, module->modulename)) return module;
if (module->alt_modulename && !wcsicmp(name, module->alt_modulename)) return module;
}
SetLastError(ERROR_INVALID_NAME);
return NULL;
@ -374,8 +376,12 @@ BOOL module_load_debug(struct module* module)
if (module->module.SymType == SymDeferred)
{
BOOL ret;
if (module->is_virtual) ret = FALSE;
if (module->is_virtual)
{
module->module.SymType = SymVirtual;
ret = TRUE;
}
else if (module->type == DMT_PE)
{
idslW64.SizeOfStruct = sizeof(idslW64);
@ -398,8 +404,9 @@ BOOL module_load_debug(struct module* module)
if (!ret) module->module.SymType = SymNone;
assert(module->module.SymType != SymDeferred);
module->module.NumSyms = module->ht_symbols.num_elts;
return ret;
}
return module->module.SymType != SymNone;
return TRUE;
}
/******************************************************************
@ -410,7 +417,6 @@ BOOL module_load_debug(struct module* module)
* the module itself)
* - if the module has no debug info and has an ELF container, then return the ELF
* container (and also force the ELF container's debug info loading if deferred)
* - otherwise return the module itself if it has some debug info
*/
BOOL module_get_debug(struct module_pair* pair)
{
@ -940,7 +946,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
if (!(pcs = process_find_by_handle(hProcess))) return 0;
if (Flags & ~(SLMFLAG_VIRTUAL))
if (Flags & ~(SLMFLAG_VIRTUAL | SLMFLAG_NO_SYMBOLS))
FIXME("Unsupported Flags %08lx for %s\n", Flags, debugstr_w(wImageName));
/* Trying to load a new module at the same address of an existing one,
@ -956,45 +962,48 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
}
}
pcs->loader->synchronize_module_list(pcs);
/* this is a Wine extension to the API just to redo the synchronisation */
if (!wImageName && !hFile) return 0;
if (!wImageName && !hFile && !Flags)
{
pcs->loader->synchronize_module_list(pcs);
return 0;
}
if (Flags & SLMFLAG_VIRTUAL)
{
if (!wImageName) return 0;
if (!wImageName) wImageName = L"";
module = module_new(pcs, wImageName, DMT_PE, FALSE, TRUE, BaseOfDll, SizeOfDll, 0, 0, IMAGE_FILE_MACHINE_UNKNOWN);
if (!module) return 0;
module->module.SymType = SymVirtual;
}
/* check if it's a builtin PE module with a containing ELF module */
else if (wImageName && module_is_container_loaded(pcs, wImageName, BaseOfDll))
else
{
/* force the loading of DLL as builtin */
module = pe_load_builtin_module(pcs, wImageName, BaseOfDll, SizeOfDll);
}
if (!module)
{
/* otherwise, try a regular PE module */
if (!(module = pe_load_native_module(pcs, wImageName, hFile, BaseOfDll, SizeOfDll)) &&
wImageName)
/* try PE image */
module = pe_load_native_module(pcs, wImageName, hFile, BaseOfDll, SizeOfDll);
if (!module && wImageName)
{
/* and finally an ELF or Mach-O module */
module = pcs->loader->load_module(pcs, wImageName, BaseOfDll);
/* It could be either a dll.so file (for which we need the corresponding
* system module) or a system module.
* In both cases, ensure system module list is up-to-date.
*/
pcs->loader->synchronize_module_list(pcs);
if (module_is_container_loaded(pcs, wImageName, BaseOfDll))
module = pe_load_builtin_module(pcs, wImageName, BaseOfDll, SizeOfDll);
/* at last, try ELF or Mach-O module */
if (!module)
module = pcs->loader->load_module(pcs, wImageName, BaseOfDll);
}
if (!module)
{
WARN("Couldn't locate %s\n", debugstr_w(wImageName));
SetLastError(ERROR_NO_MORE_FILES);
return 0;
}
}
if (!module)
{
WARN("Couldn't locate %s\n", debugstr_w(wImageName));
SetLastError(ERROR_NO_MORE_FILES);
return 0;
}
/* by default module_new fills module.ModuleName from a derivation
* of LoadedImageName. Overwrite it, if we have better information
*/
if (Flags & SLMFLAG_NO_SYMBOLS) module->dont_load_symbols = 1;
/* Store alternate name for module when provided. */
if (wModuleName)
module_set_module(module, wModuleName);
module->alt_modulename = pool_wcsdup(&module->pool, wModuleName);
if (wImageName)
lstrcpynW(module->module.ImageName, wImageName, ARRAY_SIZE(module->module.ImageName));
@ -1526,6 +1535,11 @@ BOOL WINAPI SymGetModuleInfoW64(HANDLE hProcess, DWORD64 dwAddr,
if (dbghelp_opt_real_path && module->real_path)
lstrcpynW(miw64.LoadedImageName, module->real_path, ARRAY_SIZE(miw64.LoadedImageName));
else if (miw64.SymType == SymDeferred)
{
miw64.LoadedImageName[0] = '\0';
miw64.TimeDateStamp = 0;
}
/* update debug information from container if any */
if (module->module.SymType == SymNone)

View file

@ -49,16 +49,19 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
static const GUID null_guid;
struct pdb_stream_name
{
const char* name;
unsigned index;
};
enum pdb_kind {PDB_JG, PDB_DS};
struct pdb_file_info
{
enum pdb_kind kind;
DWORD age;
HANDLE hMap;
const char* image;
struct pdb_stream_name* stream_dict;
@ -67,12 +70,10 @@ struct pdb_file_info
{
struct
{
DWORD timestamp;
struct PDB_JG_TOC* toc;
} jg;
struct
{
GUID guid;
struct PDB_DS_TOC* toc;
} ds;
} u;
@ -3141,21 +3142,22 @@ static void pdb_free_file(struct pdb_file_info* pdb_file)
HeapFree(GetProcessHeap(), 0, pdb_file->stream_dict);
}
static BOOL pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const char* str, unsigned cb)
static struct pdb_stream_name* pdb_load_stream_name_table(const char* str, unsigned cb)
{
DWORD* pdw;
DWORD* ok_bits;
DWORD count, numok;
unsigned i, j;
char* cpstr;
struct pdb_stream_name* stream_dict;
DWORD* pdw;
DWORD* ok_bits;
DWORD count, numok;
unsigned i, j;
char* cpstr;
pdw = (DWORD*)(str + cb);
numok = *pdw++;
count = *pdw++;
pdb_file->stream_dict = HeapAlloc(GetProcessHeap(), 0, (numok + 1) * sizeof(struct pdb_stream_name) + cb);
if (!pdb_file->stream_dict) return FALSE;
cpstr = (char*)(pdb_file->stream_dict + numok + 1);
stream_dict = HeapAlloc(GetProcessHeap(), 0, (numok + 1) * sizeof(struct pdb_stream_name) + cb);
if (!stream_dict) return NULL;
cpstr = (char*)(stream_dict + numok + 1);
memcpy(cpstr, str, cb);
/* bitfield: first dword is len (in dword), then data */
@ -3168,15 +3170,14 @@ static BOOL pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const cha
if (ok_bits[i / 32] & (1 << (i % 32)))
{
if (j >= numok) break;
pdb_file->stream_dict[j].name = &cpstr[*pdw++];
pdb_file->stream_dict[j].index = *pdw++;
stream_dict[j].name = &cpstr[*pdw++];
stream_dict[j].index = *pdw++;
j++;
}
}
/* add sentinel */
pdb_file->stream_dict[numok].name = NULL;
pdb_file->fpoext_stream = -1;
return TRUE;
stream_dict[numok].name = NULL;
return stream_dict;
}
static unsigned pdb_get_stream_by_name(const struct pdb_file_info* pdb_file, const char* name)
@ -3304,39 +3305,6 @@ static void pdb_convert_symbol_file(const PDB_SYMBOLS* symbols,
}
}
static HANDLE map_pdb_file(const struct process* pcs,
const struct pdb_lookup* lookup,
struct module* module)
{
HANDLE hFile, hMap = NULL;
WCHAR dbg_file_path[MAX_PATH];
BOOL ret = FALSE;
switch (lookup->kind)
{
case PDB_JG:
ret = path_find_symbol_file(pcs, module, lookup->filename, TRUE, NULL, lookup->timestamp,
lookup->age, dbg_file_path, &module->module.PdbUnmatched);
break;
case PDB_DS:
ret = path_find_symbol_file(pcs, module, lookup->filename, TRUE, &lookup->guid, 0,
lookup->age, dbg_file_path, &module->module.PdbUnmatched);
break;
}
if (!ret)
{
WARN("\tCouldn't find %s\n", lookup->filename);
return NULL;
}
if ((hFile = CreateFileW(dbg_file_path, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE)
{
hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
CloseHandle(hFile);
}
return hMap;
}
static void pdb_dispose_type_parse(struct codeview_type_parse* ctp)
{
pdb_free(ctp->hash_stream);
@ -3385,12 +3353,14 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg,
ERR("-Unsupported hash of size %u\n", ctp->header.hash_value_size);
return FALSE;
}
ctp->hash_stream = pdb_read_stream(pdb_file, ctp->header.hash_stream);
/* FIXME always present? if not reconstruct ?*/
if (!ctp->hash_stream)
if (!(ctp->hash_stream = pdb_read_stream(pdb_file, ctp->header.hash_stream)))
{
ERR("-Missing hash table in PDB file\n");
return FALSE;
if (ctp->header.last_index > ctp->header.first_index)
{
/* may be reconstruct hash table ? */
FIXME("-No hash table, while types exist\n");
return FALSE;
}
}
ctp->module = msc_dbg->module;
@ -3422,7 +3392,7 @@ static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg,
/* parse the remap table
* => move listed type_id at first position of their hash buckets so that we force remap to them
*/
if (ctp->header.type_remap_size)
if (ctp->hash_stream && ctp->header.type_remap_size)
{
const unsigned* remap = (const unsigned*)((const BYTE*)ctp->hash_stream + ctp->header.type_remap_offset);
unsigned i, capa, count_present;
@ -3486,30 +3456,29 @@ static const char PDB_DS_IDENT[] = "Microsoft C/C++ MSF 7.00\r\n\032DS\0";
* pdb_init
*
* Tries to load a pdb file
* 'matched' is filled with the number of correct matches for this file:
* - age counts for one
* - timestamp or guid depending on kind counts for one
* a wrong kind of file returns FALSE (FIXME ?)
*/
static BOOL pdb_init(const struct pdb_lookup* pdb_lookup, struct pdb_file_info* pdb_file,
const char* image, unsigned* matched)
static BOOL pdb_init(struct pdb_file_info* pdb_file, const char* image)
{
BOOL ret = TRUE;
/* check the file header, and if ok, load the TOC */
TRACE("PDB(%s): %.40s\n", pdb_lookup->filename, debugstr_an(image, 40));
TRACE("PDB: %.40s\n", debugstr_an(image, 40));
*matched = 0;
if (!memcmp(image, PDB_JG_IDENT, sizeof(PDB_JG_IDENT)))
{
const struct PDB_JG_HEADER* pdb = (const struct PDB_JG_HEADER*)image;
struct PDB_JG_ROOT* root;
struct PDB_JG_TOC* jg_toc;
pdb_file->u.jg.toc = pdb_jg_read(pdb, pdb->toc_block, pdb->toc.size);
root = pdb_read_jg_stream(pdb, pdb_file->u.jg.toc, 1);
jg_toc = pdb_jg_read(pdb, pdb->toc_block, pdb->toc.size);
if (!jg_toc)
{
ERR("-Unable to get TOC from .PDB\n");
return FALSE;
}
root = pdb_read_jg_stream(pdb, jg_toc, 1);
if (!root)
{
ERR("-Unable to get root from .PDB in %s\n", pdb_lookup->filename);
ERR("-Unable to get root from .PDB\n");
pdb_free(jg_toc);
return FALSE;
}
switch (root->Version)
@ -3522,38 +3491,32 @@ static BOOL pdb_init(const struct pdb_lookup* pdb_lookup, struct pdb_file_info*
default:
ERR("-Unknown root block version %d\n", root->Version);
}
if (pdb_lookup->kind != PDB_JG)
{
WARN("Found %s, but wrong PDB kind\n", pdb_lookup->filename);
pdb_free(root);
return FALSE;
}
pdb_file->kind = PDB_JG;
pdb_file->u.jg.timestamp = root->TimeDateStamp;
pdb_file->age = root->Age;
if (root->TimeDateStamp == pdb_lookup->timestamp) (*matched)++;
else WARN("Found %s, but wrong signature: %08x %08x\n",
pdb_lookup->filename, root->TimeDateStamp, pdb_lookup->timestamp);
if (root->Age == pdb_lookup->age) (*matched)++;
else WARN("Found %s, but wrong age: %08x %08x\n",
pdb_lookup->filename, root->Age, pdb_lookup->age);
TRACE("found JG for %s: age=%x timestamp=%x\n",
pdb_lookup->filename, root->Age, root->TimeDateStamp);
ret = pdb_load_stream_name_table(pdb_file, &root->names[0], root->cbNames);
pdb_file->u.jg.toc = jg_toc;
TRACE("found JG: age=%x timestamp=%x\n", root->Age, root->TimeDateStamp);
pdb_file->stream_dict = pdb_load_stream_name_table(&root->names[0], root->cbNames);
pdb_file->fpoext_stream = -1;
pdb_free(root);
}
else if (!memcmp(image, PDB_DS_IDENT, sizeof(PDB_DS_IDENT)))
{
const struct PDB_DS_HEADER* pdb = (const struct PDB_DS_HEADER*)image;
struct PDB_DS_ROOT* root;
struct PDB_DS_TOC* ds_toc;
pdb_file->u.ds.toc =
pdb_ds_read(pdb, (const UINT*)((const char*)pdb + pdb->toc_block * pdb->block_size),
pdb->toc_size);
root = pdb_read_ds_stream(pdb, pdb_file->u.ds.toc, 1);
ds_toc = pdb_ds_read(pdb, (const UINT*)((const char*)pdb + pdb->toc_block * pdb->block_size),
pdb->toc_size);
if (!ds_toc)
{
ERR("-Unable to get TOC from .PDB\n");
return FALSE;
}
root = pdb_read_ds_stream(pdb, ds_toc, 1);
if (!root)
{
ERR("-Unable to get root from .PDB in %s\n", pdb_lookup->filename);
ERR("-Unable to get root from .PDB\n");
pdb_free(ds_toc);
return FALSE;
}
switch (root->Version)
@ -3564,18 +3527,10 @@ static BOOL pdb_init(const struct pdb_lookup* pdb_lookup, struct pdb_file_info*
ERR("-Unknown root block version %u\n", root->Version);
}
pdb_file->kind = PDB_DS;
pdb_file->u.ds.guid = root->guid;
pdb_file->age = root->Age;
if (!memcmp(&root->guid, &pdb_lookup->guid, sizeof(GUID))) (*matched)++;
else WARN("Found %s, but wrong GUID: %s %s\n",
pdb_lookup->filename, debugstr_guid(&root->guid),
debugstr_guid(&pdb_lookup->guid));
if (root->Age == pdb_lookup->age) (*matched)++;
else WARN("Found %s, but wrong age: %08x %08x\n",
pdb_lookup->filename, root->Age, pdb_lookup->age);
TRACE("found DS for %s: age=%x guid=%s\n",
pdb_lookup->filename, root->Age, debugstr_guid(&root->guid));
ret = pdb_load_stream_name_table(pdb_file, &root->names[0], root->cbNames);
pdb_file->u.ds.toc = ds_toc;
TRACE("found DS for: age=%x guid=%s\n", root->Age, debugstr_guid(&root->guid));
pdb_file->stream_dict = pdb_load_stream_name_table(&root->names[0], root->cbNames);
pdb_file->fpoext_stream = -1;
pdb_free(root);
}
@ -3599,13 +3554,13 @@ static BOOL pdb_init(const struct pdb_lookup* pdb_lookup, struct pdb_file_info*
pdb_free(x);
}
}
return ret;
return pdb_file->stream_dict != NULL;
}
static BOOL pdb_process_internal(const struct process* pcs,
const struct msc_debug_info* msc_dbg,
const struct pdb_lookup* pdb_lookup,
struct pdb_module_info* pdb_module_info,
static BOOL pdb_process_internal(const struct process *pcs,
const struct msc_debug_info *msc_dbg,
const WCHAR *filename,
struct pdb_module_info *pdb_module_info,
unsigned module_index);
DWORD pdb_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info)
@ -3717,13 +3672,12 @@ DWORD pdb_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info)
return ERROR_BAD_FORMAT;
}
static void pdb_process_symbol_imports(const struct process* pcs,
const struct msc_debug_info* msc_dbg,
const PDB_SYMBOLS* symbols,
const void* symbols_image,
const char* image,
const struct pdb_lookup* pdb_lookup,
struct pdb_module_info* pdb_module_info,
static void pdb_process_symbol_imports(const struct process *pcs,
const struct msc_debug_info *msc_dbg,
const PDB_SYMBOLS *symbols,
const void *symbols_image,
const char *image,
struct pdb_module_info *pdb_module_info,
unsigned module_index)
{
if (module_index == -1 && symbols && symbols->pdbimport_size)
@ -3733,7 +3687,6 @@ static void pdb_process_symbol_imports(const struct process* pcs,
const void* last;
const char* ptr;
int i = 0;
struct pdb_file_info sf0 = pdb_module_info->pdb_files[0];
imp = (const PDB_SYMBOL_IMPORT*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) +
symbols->module_size + symbols->sectcontrib_size +
@ -3742,29 +3695,15 @@ static void pdb_process_symbol_imports(const struct process* pcs,
last = (const char*)imp + symbols->pdbimport_size;
while (imp < (const PDB_SYMBOL_IMPORT*)last)
{
SYMSRV_INDEX_INFOW info;
ptr = (const char*)imp + sizeof(*imp) + strlen(imp->filename);
if (i >= CV_MAX_MODULES) FIXME("Out of bounds!!!\n");
if (!stricmp(pdb_lookup->filename, imp->filename))
{
if (module_index != -1) FIXME("Twice the entry\n");
else module_index = i;
pdb_module_info->pdb_files[i] = sf0;
}
else
{
struct pdb_lookup imp_pdb_lookup;
/* FIXME: this is an import of a JG PDB file
* how's a DS PDB handled ?
*/
imp_pdb_lookup.filename = imp->filename;
imp_pdb_lookup.kind = PDB_JG;
imp_pdb_lookup.timestamp = imp->TimeDateStamp;
imp_pdb_lookup.age = imp->Age;
TRACE("got for %s: age=%u ts=%x\n",
imp->filename, imp->Age, imp->TimeDateStamp);
pdb_process_internal(pcs, msc_dbg, &imp_pdb_lookup, pdb_module_info, i);
}
TRACE("got for %s: age=%u ts=%x\n",
imp->filename, imp->Age, imp->TimeDateStamp);
if (path_find_symbol_file(pcs, msc_dbg->module, imp->filename, TRUE, NULL, imp->TimeDateStamp, imp->Age, &info,
&msc_dbg->module->module.PdbUnmatched))
pdb_process_internal(pcs, msc_dbg, info.pdbfile, pdb_module_info, i);
i++;
imp = (const PDB_SYMBOL_IMPORT*)((const char*)first + ((ptr - (const char*)first + strlen(ptr) + 1 + 3) & ~3));
}
@ -3780,31 +3719,34 @@ static void pdb_process_symbol_imports(const struct process* pcs,
cv_current_module->allowed = TRUE;
}
static BOOL pdb_process_internal(const struct process* pcs,
const struct msc_debug_info* msc_dbg,
const struct pdb_lookup* pdb_lookup,
struct pdb_module_info* pdb_module_info,
static BOOL pdb_process_internal(const struct process *pcs,
const struct msc_debug_info *msc_dbg,
const WCHAR *filename,
struct pdb_module_info *pdb_module_info,
unsigned module_index)
{
HANDLE hMap = NULL;
HANDLE hFile = NULL, hMap = NULL;
char* image = NULL;
BYTE* symbols_image = NULL;
PDB_STRING_TABLE* files_image = NULL;
unsigned matched;
struct pdb_file_info* pdb_file;
TRACE("Processing PDB file %s\n", pdb_lookup->filename);
TRACE("Processing PDB file %ls\n", filename);
pdb_file = &pdb_module_info->pdb_files[module_index == -1 ? 0 : module_index];
/* Open and map() .PDB file */
if ((hMap = map_pdb_file(pcs, pdb_lookup, msc_dbg->module)) == NULL ||
((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL))
if ((hFile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE ||
(hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL ||
(image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL)
{
WARN("Unable to open .PDB file: %s\n", pdb_lookup->filename);
WARN("Unable to open .PDB file: %ls\n", filename);
CloseHandle(hMap);
CloseHandle(hFile);
return FALSE;
}
if (!pdb_init(pdb_lookup, pdb_file, image, &matched) || matched != 2)
CloseHandle(hFile);
if (!pdb_init(pdb_file, image))
{
CloseHandle(hMap);
UnmapViewOfFile(image);
@ -3823,7 +3765,8 @@ static BOOL pdb_process_internal(const struct process* pcs,
struct codeview_type_parse ipi_ctp;
BYTE* file;
int header_size = 0;
PDB_STREAM_INDEXES* psi;
unsigned num_sub_streams;
const unsigned short* sub_streams;
BOOL ipi_ok;
pdb_convert_symbols_header(&symbols, &header_size, symbols_image);
@ -3839,29 +3782,18 @@ static BOOL pdb_process_internal(const struct process* pcs,
symbols.version, symbols.version);
}
switch (symbols.stream_index_size)
{
case 0:
case sizeof(PDB_STREAM_INDEXES_OLD):
/* no fpo ext stream in this case */
break;
case sizeof(PDB_STREAM_INDEXES):
case sizeof(PDB_STREAM_INDEXES) + 2:
psi = (PDB_STREAM_INDEXES*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) +
symbols.module_size + symbols.sectcontrib_size +
symbols.segmap_size + symbols.srcmodule_size +
symbols.pdbimport_size + symbols.unknown2_size);
pdb_file->fpoext_stream = psi->FPO_EXT;
break;
default:
FIXME("Unknown PDB_STREAM_INDEXES size (%u)\n", symbols.stream_index_size);
pdb_free(symbols_image);
return FALSE;
}
num_sub_streams = symbols.stream_index_size / sizeof(sub_streams[0]);
sub_streams = (const unsigned short*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) +
symbols.module_size + symbols.sectcontrib_size +
symbols.segmap_size + symbols.srcmodule_size +
symbols.pdbimport_size + symbols.unknown2_size);
if (PDB_SIDX_FPOEXT < num_sub_streams)
pdb_file->fpoext_stream = sub_streams[PDB_SIDX_FPOEXT];
files_image = pdb_read_strings(pdb_file);
pdb_process_symbol_imports(pcs, msc_dbg, &symbols, symbols_image, image,
pdb_lookup, pdb_module_info, module_index);
pdb_module_info, module_index);
pdb_process_types(msc_dbg, pdb_file);
ipi_image = pdb_read_stream(pdb_file, 4);
@ -3947,7 +3879,7 @@ static BOOL pdb_process_internal(const struct process* pcs,
}
else
pdb_process_symbol_imports(pcs, msc_dbg, NULL, NULL, image,
pdb_lookup, pdb_module_info, module_index);
pdb_module_info, module_index);
pdb_free(symbols_image);
pdb_free(files_image);
@ -3955,83 +3887,63 @@ static BOOL pdb_process_internal(const struct process* pcs,
return TRUE;
}
static BOOL pdb_process_file(const struct process* pcs,
const struct msc_debug_info* msc_dbg,
struct pdb_lookup* pdb_lookup)
static BOOL pdb_process_file(const struct process *pcs,
const struct msc_debug_info *msc_dbg,
const char *filename, const GUID *guid, DWORD timestamp, DWORD age)
{
BOOL ret;
struct module_format* modfmt;
struct pdb_module_info* pdb_module_info;
SYMSRV_INDEX_INFOW info;
BOOL unmatched;
modfmt = HeapAlloc(GetProcessHeap(), 0,
sizeof(struct module_format) + sizeof(struct pdb_module_info));
if (!modfmt) return FALSE;
pdb_module_info = (void*)(modfmt + 1);
msc_dbg->module->format_info[DFI_PDB] = modfmt;
modfmt->module = msc_dbg->module;
modfmt->remove = pdb_module_remove;
modfmt->loc_compute = pdb_location_compute;
modfmt->u.pdb_info = pdb_module_info;
memset(cv_zmodules, 0, sizeof(cv_zmodules));
codeview_init_basic_types(msc_dbg->module);
ret = pdb_process_internal(pcs, msc_dbg, pdb_lookup,
msc_dbg->module->format_info[DFI_PDB]->u.pdb_info, -1);
codeview_clear_type_table();
if (ret)
{
struct pdb_module_info* pdb_info = msc_dbg->module->format_info[DFI_PDB]->u.pdb_info;
msc_dbg->module->module.SymType = SymPdb;
if (pdb_info->pdb_files[0].kind == PDB_JG)
msc_dbg->module->module.PdbSig = pdb_info->pdb_files[0].u.jg.timestamp;
else
msc_dbg->module->module.PdbSig70 = pdb_info->pdb_files[0].u.ds.guid;
msc_dbg->module->module.PdbAge = pdb_info->pdb_files[0].age;
MultiByteToWideChar(CP_ACP, 0, pdb_lookup->filename, -1,
msc_dbg->module->module.LoadedPdbName,
ARRAY_SIZE(msc_dbg->module->module.LoadedPdbName));
/* FIXME: we could have a finer grain here */
msc_dbg->module->module.LineNumbers = TRUE;
msc_dbg->module->module.GlobalSymbols = TRUE;
msc_dbg->module->module.TypeInfo = TRUE;
msc_dbg->module->module.SourceIndexed = TRUE;
msc_dbg->module->module.Publics = TRUE;
}
else
if (!msc_dbg->module->dont_load_symbols &&
path_find_symbol_file(pcs, msc_dbg->module, filename, TRUE, guid, timestamp, age, &info, &unmatched) &&
(modfmt = HeapAlloc(GetProcessHeap(), 0,
sizeof(struct module_format) + sizeof(struct pdb_module_info))))
{
BOOL ret;
pdb_module_info = (void*)(modfmt + 1);
msc_dbg->module->format_info[DFI_PDB] = modfmt;
modfmt->module = msc_dbg->module;
modfmt->remove = pdb_module_remove;
modfmt->loc_compute = pdb_location_compute;
modfmt->u.pdb_info = pdb_module_info;
memset(cv_zmodules, 0, sizeof(cv_zmodules));
codeview_init_basic_types(msc_dbg->module);
ret = pdb_process_internal(pcs, msc_dbg, info.pdbfile,
msc_dbg->module->format_info[DFI_PDB]->u.pdb_info, -1);
codeview_clear_type_table();
if (ret)
{
msc_dbg->module->module.SymType = SymPdb;
msc_dbg->module->module.PdbSig = info.sig;
msc_dbg->module->module.PdbAge = info.age;
msc_dbg->module->module.PdbSig70 = info.guid;
msc_dbg->module->module.PdbUnmatched = unmatched;
wcscpy(msc_dbg->module->module.LoadedPdbName, info.pdbfile);
/* FIXME: we could have a finer grain here */
msc_dbg->module->module.LineNumbers = TRUE;
msc_dbg->module->module.GlobalSymbols = TRUE;
msc_dbg->module->module.TypeInfo = TRUE;
msc_dbg->module->module.SourceIndexed = TRUE;
msc_dbg->module->module.Publics = TRUE;
return TRUE;
}
msc_dbg->module->format_info[DFI_PDB] = NULL;
HeapFree(GetProcessHeap(), 0, modfmt);
}
return ret;
}
BOOL pdb_fetch_file_info(const struct pdb_lookup* pdb_lookup, unsigned* matched)
{
HANDLE hFile, hMap = NULL;
char* image = NULL;
BOOL ret;
struct pdb_file_info pdb_file;
if ((hFile = CreateFileA(pdb_lookup->filename, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE ||
((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL) ||
((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL))
{
WARN("Unable to open .PDB file: %s\n", pdb_lookup->filename);
ret = FALSE;
}
msc_dbg->module->module.SymType = SymNone;
if (guid)
msc_dbg->module->module.PdbSig70 = *guid;
else
{
ret = pdb_init(pdb_lookup, &pdb_file, image, matched);
pdb_free_file(&pdb_file);
}
if (image) UnmapViewOfFile(image);
if (hMap) CloseHandle(hMap);
if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
return ret;
memset(&msc_dbg->module->module.PdbSig70, 0, sizeof(GUID));
msc_dbg->module->module.PdbSig = 0;
msc_dbg->module->module.PdbAge = age;
return FALSE;
}
/*========================================================================
@ -4350,12 +4262,11 @@ BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip,
#define CODEVIEW_NB11_SIG MAKESIG('N','B','1','1')
#define CODEVIEW_RSDS_SIG MAKESIG('R','S','D','S')
static BOOL codeview_process_info(const struct process* pcs,
const struct msc_debug_info* msc_dbg)
static BOOL codeview_process_info(const struct process *pcs,
const struct msc_debug_info *msc_dbg)
{
const DWORD* signature = (const DWORD*)msc_dbg->root;
BOOL ret = FALSE;
struct pdb_lookup pdb_lookup;
TRACE("Processing signature %.4s\n", (const char*)signature);
@ -4443,11 +4354,7 @@ static BOOL codeview_process_info(const struct process* pcs,
case CODEVIEW_NB10_SIG:
{
const CODEVIEW_PDB_DATA* pdb = (const CODEVIEW_PDB_DATA*)msc_dbg->root;
pdb_lookup.filename = pdb->name;
pdb_lookup.kind = PDB_JG;
pdb_lookup.timestamp = pdb->timestamp;
pdb_lookup.age = pdb->age;
ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup);
ret = pdb_process_file(pcs, msc_dbg, pdb->name, NULL, pdb->timestamp, pdb->age);
break;
}
case CODEVIEW_RSDS_SIG:
@ -4456,11 +4363,7 @@ static BOOL codeview_process_info(const struct process* pcs,
TRACE("Got RSDS type of PDB file: guid=%s age=%08x name=%s\n",
wine_dbgstr_guid(&rsds->guid), rsds->age, rsds->name);
pdb_lookup.filename = rsds->name;
pdb_lookup.kind = PDB_DS;
pdb_lookup.guid = rsds->guid;
pdb_lookup.age = rsds->age;
ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup);
ret = pdb_process_file(pcs, msc_dbg, rsds->name, &rsds->guid, 0, rsds->age);
break;
}
default:
@ -4566,6 +4469,26 @@ typedef struct _FPO_DATA
ret = FALSE;
}
__ENDTRY
/* we haven't found yet any debug information, fallback to unmatched pdb */
if (module->module.SymType == SymDeferred)
{
SYMSRV_INDEX_INFOW info = {.sizeofstruct = sizeof(info)};
char buffer[MAX_PATH];
char *ext;
DWORD options;
WideCharToMultiByte(CP_ACP, 0, module->module.LoadedImageName, -1, buffer, ARRAY_SIZE(buffer), 0, NULL);
ext = strrchr(buffer, '.');
if (ext) strcpy(ext + 1, "pdb"); else strcat(buffer, ".pdb");
options = SymGetOptions();
SymSetOptions(options | SYMOPT_LOAD_ANYTHING);
ret = pdb_process_file(pcs, &msc_dbg, buffer, &null_guid, 0, 0);
SymSetOptions(options);
if (!ret && module->dont_load_symbols)
module->module.TimeDateStamp = 0;
}
return ret;
}

View file

@ -398,13 +398,6 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
filename = file_name(full_path);
/* first check full path to file */
if (sffip_cb(full_path, &s))
{
lstrcpyW(buffer, full_path);
return TRUE;
}
while (searchPath)
{
ptr = wcschr(searchPath, ';');
@ -425,6 +418,7 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
return TRUE;
}
}
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
@ -461,7 +455,7 @@ BOOL WINAPI SymFindFileInPath(HANDLE hProcess, PCSTR searchPath, PCSTR full_path
struct module_find
{
BOOL is_pdb;
BOOL is_pdb;
/* pdb: guid PDB guid (if DS PDB file)
* or dw1 PDB timestamp (if JG PDB file)
* dw2 PDB age
@ -471,7 +465,8 @@ struct module_find
const GUID* guid;
DWORD dw1;
DWORD dw2;
WCHAR filename[MAX_PATH];
SYMSRV_INDEX_INFOW *info;
WCHAR *buffer; /* MAX_PATH + 1 */
unsigned matched;
};
@ -483,151 +478,119 @@ struct module_find
static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
{
struct module_find* mf = user;
DWORD timestamp;
unsigned matched = 0;
SYMSRV_INDEX_INFOW info;
/* the matching weights:
* +1 if a file with same name is found and is a decent file of expected type
* +1 if first parameter and second parameter match
*/
if (mf->is_pdb)
{
struct pdb_lookup pdb_lookup;
char fn[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, buffer, -1, fn, MAX_PATH, NULL, NULL);
pdb_lookup.filename = fn;
if (mf->guid)
{
pdb_lookup.kind = PDB_DS;
pdb_lookup.timestamp = 0;
pdb_lookup.guid = *mf->guid;
}
else
{
pdb_lookup.kind = PDB_JG;
pdb_lookup.timestamp = mf->dw1;
/* pdb_loopkup.guid = */
}
pdb_lookup.age = mf->dw2;
if (!pdb_fetch_file_info(&pdb_lookup, &matched)) return FALSE;
}
else
{
HANDLE hFile, hMap;
void* mapping;
timestamp = ~mf->dw1;
hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return FALSE;
if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
{
if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
{
const IMAGE_SEPARATE_DEBUG_HEADER* hdr;
hdr = mapping;
if (hdr->Signature == IMAGE_SEPARATE_DEBUG_SIGNATURE)
{
matched++;
timestamp = hdr->TimeDateStamp;
}
UnmapViewOfFile(mapping);
}
CloseHandle(hMap);
}
CloseHandle(hFile);
if (timestamp == mf->dw1) matched++;
else WARN("Found %s, but wrong timestamp\n", debugstr_w(buffer));
}
info.sizeofstruct = sizeof(info);
if (!SymSrvGetFileIndexInfoW(buffer, &info, 0))
return FALSE;
matched++;
if (!memcmp(&info.guid, mf->guid, sizeof(GUID))) matched++;
if (info.timestamp == mf->dw1) matched++;
if (info.age == mf->dw2) matched++;
if (matched > mf->matched)
{
lstrcpyW(mf->filename, buffer);
size_t len = min(wcslen(buffer), MAX_PATH);
memcpy(mf->buffer, buffer, len * sizeof(WCHAR));
mf->buffer[len] = L'\0';
mf->matched = matched;
mf->info->guid = info.guid;
mf->info->timestamp = info.timestamp;
mf->info->age = info.age;
mf->info->sig = info.sig;
}
/* yes, EnumDirTree/do_search and SymFindFileInPath callbacks use the opposite
* convention to stop/continue enumeration. sigh.
*/
return mf->matched == 2;
return mf->matched == 4;
}
BOOL path_find_symbol_file(const struct process* pcs, const struct module* module,
PCSTR full_path, BOOL is_pdb, const GUID* guid, DWORD dw1, DWORD dw2,
WCHAR *buffer, BOOL* is_unmatched)
SYMSRV_INDEX_INFOW *info, BOOL* is_unmatched)
{
struct module_find mf;
WCHAR full_pathW[MAX_PATH];
WCHAR* ptr;
WCHAR *ptr, *ext;
const WCHAR* filename;
WCHAR* searchPath = pcs->search_path;
WCHAR *searchPath = pcs->search_path;
WCHAR buffer[MAX_PATH];
TRACE("(pcs = %p, full_path = %s, guid = %s, dw1 = 0x%08lx, dw2 = 0x%08lx, buffer = %p)\n",
pcs, debugstr_a(full_path), debugstr_guid(guid), dw1, dw2, buffer);
TRACE("(pcs = %p, full_path = %s, guid = %s, dw1 = 0x%08lx, dw2 = 0x%08lx)\n",
pcs, debugstr_a(full_path), debugstr_guid(guid), dw1, dw2);
mf.info = info;
mf.guid = guid;
mf.dw1 = dw1;
mf.dw2 = dw2;
mf.matched = 0;
mf.buffer = is_pdb ? info->pdbfile : info->dbgfile;
MultiByteToWideChar(CP_ACP, 0, full_path, -1, full_pathW, MAX_PATH);
filename = file_name(full_pathW);
MultiByteToWideChar(CP_ACP, 0, full_path, -1, info->file, MAX_PATH);
filename = file_name(info->file);
mf.is_pdb = is_pdb;
*is_unmatched = FALSE;
/* first check full path to file */
if (module_find_cb(full_pathW, &mf))
if (is_pdb && module_find_cb(info->file, &mf))
{
lstrcpyW( buffer, full_pathW );
wcscpy( info->pdbfile, info->file );
return TRUE;
}
/* FIXME: Use Environment-Variables (see MS docs)
_NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH
FIXME: Implement "Standard Path Elements" (Path) ... (see MS docs)
do a search for (every?) path-element like this ...
<path>
<path>\dll
<path>\symbols\dll
(dll may be exe, or sys depending on the file extension) */
*/
/* 2. check module-path */
file_pathW(module->module.LoadedImageName, buffer);
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
ext = wcsrchr(module->module.LoadedImageName, L'.');
while (searchPath)
{
size_t len;
ptr = wcschr(searchPath, ';');
len = (ptr) ? ptr - searchPath : wcslen(searchPath);
if (len + 1 < ARRAY_SIZE(buffer))
{
memcpy(buffer, searchPath, len * sizeof(WCHAR));
buffer[len] = L'\0';
/* return first fully matched file */
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
len = wcslen(buffer); /* do_searchW removes the trailing \ in buffer when present */
/* check once max size for \symbols\<ext>\ */
if (ext && len + 9 /* \symbols\ */ + wcslen(ext + 1) + 1 + 1 <= ARRAY_SIZE(buffer))
{
buffer[len++] = L'\\';
wcscpy(buffer + len, ext + 1);
wcscat(buffer + len, L"\\");
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
wcscpy(buffer + len, L"symbols\\");
wcscat(buffer + len, ext + 1);
wcscat(buffer + len, L"\\");
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
}
}
else
ERR("Too long search element %ls\n", searchPath);
searchPath = ptr ? ptr + 1 : NULL;
}
/* check module-path */
if (module->real_path)
{
file_pathW(module->real_path, buffer);
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
}
file_pathW(module->module.LoadedImageName, buffer);
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
while (searchPath)
{
ptr = wcschr(searchPath, ';');
if (ptr)
{
memcpy(buffer, searchPath, (ptr - searchPath) * sizeof(WCHAR));
buffer[ptr - searchPath] = '\0';
searchPath = ptr + 1;
}
else
{
lstrcpyW(buffer, searchPath);
searchPath = NULL;
}
/* return first fully matched file */
if (do_searchW(filename, buffer, FALSE, module_find_cb, &mf)) return TRUE;
}
/* if no fully matching file is found, return the best matching file if any */
if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched)
{
lstrcpyW( buffer, mf.filename );
*is_unmatched = TRUE;
return TRUE;
}
mf.buffer[0] = L'\0';
return FALSE;
}

View file

@ -268,12 +268,11 @@ BOOL pe_map_file(HANDLE file, struct image_file_map* fmap)
memcpy(&fmap->u.pe.opt.header32, &nthdr->OptionalHeader, sizeof(fmap->u.pe.opt.header32));
break;
case IMAGE_NT_OPTIONAL_HDR64_MAGIC:
if (sizeof(void*) == 4) return FALSE;
fmap->addr_size = 64;
memcpy(&fmap->u.pe.opt.header64, &nthdr->OptionalHeader, sizeof(fmap->u.pe.opt.header64));
break;
default:
return FALSE;
goto error;
}
fmap->u.pe.builtin = !memcmp((const IMAGE_DOS_HEADER*)mapping + 1, builtin_signature, sizeof(builtin_signature));
@ -342,6 +341,52 @@ const char* pe_map_directory(struct module* module, int dirno, DWORD* size)
nth->OptionalHeader.DataDirectory[dirno].VirtualAddress, NULL);
}
BOOL pe_unmap_directory(struct module* module, int dirno, const char *dir)
{
if (module->type != DMT_PE || !module->format_info[DFI_PE]) return FALSE;
if (dirno >= IMAGE_NUMBEROF_DIRECTORY_ENTRIES) return FALSE;
pe_unmap_full(&module->format_info[DFI_PE]->u.pe_info->fmap);
return TRUE;
}
/* Locks a region from a mapped PE file, from its RVA, and for at least 'size' bytes.
* Region must fit entirely inside a PE section.
* 'length', upon success, gets the size from RVA until end of PE section.
*/
const BYTE* pe_lock_region_from_rva(struct module *module, DWORD rva, DWORD size, DWORD *length)
{
IMAGE_NT_HEADERS* nth;
void* mapping;
IMAGE_SECTION_HEADER *section;
const BYTE *ret;
if (module->type != DMT_PE || !module->format_info[DFI_PE]) return NULL;
if (!(mapping = pe_map_full(&module->format_info[DFI_PE]->u.pe_info->fmap, &nth)))
return NULL;
section = NULL;
ret = RtlImageRvaToVa(nth, mapping, rva, &section);
if (ret)
{
if (rva + size <= section->VirtualAddress + section->SizeOfRawData)
{
if (length)
*length = section->VirtualAddress + section->SizeOfRawData - rva;
return ret;
}
if (rva + size <= section->VirtualAddress + section->Misc.VirtualSize)
FIXME("Not able to lock regions not present on file\n");
}
pe_unmap_full(&module->format_info[DFI_PE]->u.pe_info->fmap);
return NULL;
}
BOOL pe_unlock_region(struct module *module, const BYTE* region)
{
if (module->type != DMT_PE || !module->format_info[DFI_PE] || !region) return FALSE;
pe_unmap_full(&module->format_info[DFI_PE]->u.pe_info->fmap);
return TRUE;
}
static void pe_module_remove(struct process* pcs, struct module_format* modfmt)
{
image_unmap_file(&modfmt->u.pe_info->fmap);
@ -543,15 +588,15 @@ static BOOL pe_load_dwarf(struct module* module)
static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
const char* dbg_name, DWORD timestamp)
{
WCHAR tmp[MAX_PATH];
HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0;
const BYTE* dbg_mapping = NULL;
BOOL ret = FALSE;
SYMSRV_INDEX_INFOW info;
TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
if (path_find_symbol_file(pcs, module, dbg_name, FALSE, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) &&
(hFile = CreateFileW(tmp, GENERIC_READ, FILE_SHARE_READ, NULL,
if (path_find_symbol_file(pcs, module, dbg_name, FALSE, NULL, timestamp, 0, &info, &module->module.DbgUnmatched) &&
(hFile = CreateFileW(info.dbgfile, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE &&
((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) &&
((dbg_mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL))
@ -574,7 +619,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
hdr->DebugDirectorySize / sizeof(*dbg));
}
else
ERR("Couldn't find .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_w(tmp));
ERR("Couldn't find .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_w(info.dbgfile));
if (dbg_mapping) UnmapViewOfFile(dbg_mapping);
if (hMap) CloseHandle(hMap);
@ -599,7 +644,7 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs, struct module* mod
if (!(mapping = pe_map_full(fmap, &nth))) return FALSE;
/* Read in debug directory */
dbg = RtlImageDirectoryEntryToData( mapping, FALSE, IMAGE_DIRECTORY_ENTRY_DEBUG, &nDbg );
if (!dbg || !(nDbg /= sizeof(IMAGE_DEBUG_DIRECTORY))) goto done;
nDbg = dbg ? nDbg / sizeof(IMAGE_DEBUG_DIRECTORY) : 0;
/* Parse debug directory */
if (nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED)
@ -625,7 +670,6 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs, struct module* mod
ret = pe_load_debug_directory(pcs, module, mapping, IMAGE_FIRST_SECTION( nth ),
nth->FileHeader.NumberOfSections, dbg, nDbg);
}
done:
pe_unmap_full(fmap);
return ret;
}
@ -722,9 +766,12 @@ BOOL pe_load_debug_info(const struct process* pcs, struct module* module)
if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY))
{
ret = image_check_alternate(&module->format_info[DFI_PE]->u.pe_info->fmap, module);
ret = pe_load_stabs(pcs, module) || ret;
ret = pe_load_dwarf(module) || ret;
if (!module->dont_load_symbols)
{
ret = image_check_alternate(&module->format_info[DFI_PE]->u.pe_info->fmap, module);
ret = pe_load_stabs(pcs, module) || ret;
ret = pe_load_dwarf(module) || ret;
}
ret = pe_load_msc_debug_info(pcs, module) || ret;
ret = ret || pe_load_coff_symbol_table(module); /* FIXME */
/* if we still have no debug info (we could only get SymExport at this

View file

@ -2614,10 +2614,16 @@ BOOL WINAPI SymGetLineFromNameW64(HANDLE hProcess, PCWSTR ModuleName, PCWSTR Fil
*/
BOOL WINAPI SymFromIndex(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMBOL_INFO symbol)
{
FIXME("hProcess = %p, BaseOfDll = %I64x, index = %ld, symbol = %p\n",
struct module_pair pair;
struct symt* sym;
TRACE("hProcess = %p, BaseOfDll = %I64x, index = %ld, symbol = %p\n",
hProcess, BaseOfDll, index, symbol);
return FALSE;
if (!module_init_pair(&pair, hProcess, BaseOfDll)) return FALSE;
if ((sym = symt_index2ptr(pair.effective, index)) == NULL) return FALSE;
symt_fill_sym_info(&pair, NULL, sym, symbol);
return TRUE;
}
/******************************************************************
@ -2626,10 +2632,21 @@ BOOL WINAPI SymFromIndex(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMBO
*/
BOOL WINAPI SymFromIndexW(HANDLE hProcess, ULONG64 BaseOfDll, DWORD index, PSYMBOL_INFOW symbol)
{
FIXME("hProcess = %p, BaseOfDll = %I64x, index = %ld, symbol = %p\n",
PSYMBOL_INFO si;
BOOL ret;
TRACE("hProcess = %p, BaseOfDll = %I64x, index = %ld, symbol = %p\n",
hProcess, BaseOfDll, index, symbol);
return FALSE;
si = HeapAlloc(GetProcessHeap(), 0, sizeof(*si) + symbol->MaxNameLen * sizeof(WCHAR));
if (!si) return FALSE;
si->SizeOfStruct = sizeof(*si);
si->MaxNameLen = symbol->MaxNameLen;
if ((ret = SymFromIndex(hProcess, BaseOfDll, index, si)))
copy_symbolW(symbol, si);
HeapFree(GetProcessHeap(), 0, si);
return ret;
}
/******************************************************************

View file

@ -3,4 +3,5 @@ IMPORTS = dbghelp user32
SOURCES = \
dbghelp.c \
minidump.c \
path.c

View file

@ -1492,6 +1492,43 @@ static void test_live_modules(void)
}
}
#define test_function_table_main_module(b) _test_function_table_entry(__LINE__, NULL, #b, (DWORD64)(DWORD_PTR)&(b))
#define test_function_table_module(a, b) _test_function_table_entry(__LINE__, a, #b, (DWORD64)(DWORD_PTR)GetProcAddress(GetModuleHandleA(a), (b)))
static void *_test_function_table_entry(unsigned lineno, const char *modulename, const char *name, DWORD64 addr)
{
DWORD64 base_module = (DWORD64)(DWORD_PTR)GetModuleHandleA(modulename);
if (RtlImageNtHeader(GetModuleHandleW(NULL))->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)
{
IMAGE_AMD64_RUNTIME_FUNCTION_ENTRY *func;
func = SymFunctionTableAccess64(GetCurrentProcess(), addr);
ok_(__FILE__, lineno)(func != NULL, "Couldn't find function table for %s\n", name);
if (func)
{
ok_(__FILE__, lineno)(func->BeginAddress == addr - base_module, "Unexpected start of function\n");
ok_(__FILE__, lineno)(func->BeginAddress < func->EndAddress, "Unexpected end of function\n");
ok_(__FILE__, lineno)((func->UnwindData & 1) == 0, "Unexpected chained runtime function\n");
}
return func;
}
return NULL;
}
static void test_function_tables(void)
{
void *ptr1, *ptr2;
SymInitialize(GetCurrentProcess(), NULL, TRUE);
ptr1 = test_function_table_main_module(test_live_modules);
ptr2 = test_function_table_main_module(test_function_tables);
ok(ptr1 == ptr2, "Expecting unique storage area\n");
ptr2 = test_function_table_module("kernel32.dll", "CreateFileMappingA");
ok(ptr1 == ptr2, "Expecting unique storage area\n");
SymCleanup(GetCurrentProcess());
}
START_TEST(dbghelp)
{
BOOL ret;
@ -1523,4 +1560,5 @@ START_TEST(dbghelp)
test_loaded_modules();
test_live_modules();
}
test_function_tables();
}

View file

@ -0,0 +1,864 @@
/*
* Copyright 2024 Eric Pouech for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windows.h"
#include "dbghelp.h"
#include "wine/test.h"
#include "winternl.h"
#include "winnt.h"
#include "wine/test.h"
static unsigned popcount32(ULONG val)
{
val -= val >> 1 & 0x55555555;
val = (val & 0x33333333) + (val >> 2 & 0x33333333);
return ((val + (val >> 4)) & 0x0f0f0f0f) * 0x01010101 >> 24;
}
static inline unsigned popcount64(ULONG64 val)
{
return popcount32(val >> 32) + popcount32(val);
}
#define minidump_open_for_read(a) _minidump_open_for_read(__LINE__, (a))
static MINIDUMP_HEADER *_minidump_open_for_read(unsigned line, const char *filename)
{
MINIDUMP_HEADER *hdr;
HANDLE file, map;
BOOL ret;
file = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ok_(__FILE__, line)(file != INVALID_HANDLE_VALUE, "Couldn't reopen file\n");
map = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);
ok_(__FILE__, line)(map != 0, "Couldn't map file\n");
hdr = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
ok(hdr != NULL, "Couldn't map file\n");
ok(hdr && hdr->Signature == MINIDUMP_SIGNATURE, "Unexpected signature\n");
ret = CloseHandle(map);
ok_(__FILE__, line)(ret, "Couldn't unmap file\n");
ret = CloseHandle(file);
ok_(__FILE__, line)(ret, "Couldn't close file\n");
return hdr;
}
#define minidump_close_for_read(a) _minidump_close_for_read(__LINE__, (a))
static void _minidump_close_for_read(unsigned line, MINIDUMP_HEADER *data)
{
BOOL ret;
ret = UnmapViewOfFile(data);
ok_(__FILE__, line)(ret, "Couldn't unmap file\n");
}
static BOOL minidump_write(HANDLE proc, const WCHAR *filename, MINIDUMP_TYPE type, BOOL windows_can_fail,
MINIDUMP_EXCEPTION_INFORMATION *mei, MINIDUMP_CALLBACK_INFORMATION *cbi)
{
HANDLE file;
BOOL ret, ret2;
file = CreateFileW(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(file != INVALID_HANDLE_VALUE, "Failed to create minidump %ls\n", filename);
ret = MiniDumpWriteDump(proc, GetProcessId(proc), file, type, mei, NULL, cbi);
/* using new features that are not supported on old dbghelp versions */
ok(ret || broken(windows_can_fail), "Couldn't write minidump content\n");
ret2 = CloseHandle(file);
ok(ret2, "Couldn't close file\n");
return ret;
}
typedef DWORD64 stream_mask_t;
#define STREAM2MASK(st) (((stream_mask_t)1) << (st))
#define BASIC_STREAM_MASK \
(STREAM2MASK(ThreadListStream) | STREAM2MASK(ModuleListStream) | STREAM2MASK(MemoryListStream) | \
STREAM2MASK(SystemInfoStream) | STREAM2MASK(MiscInfoStream) | STREAM2MASK(SystemMemoryInfoStream) | \
STREAM2MASK(ProcessVmCountersStream))
/* streams added in Win8 & Win10... */
#define BASIC_STREAM_BROKEN_MASK (STREAM2MASK(SystemMemoryInfoStream) | STREAM2MASK(ProcessVmCountersStream))
#define BASIC_STREAM_TODO_MASK (STREAM2MASK(SystemMemoryInfoStream) | STREAM2MASK(ProcessVmCountersStream))
static void test_minidump_contents(void)
{
static const struct minidump_streams
{
MINIDUMP_TYPE type;
stream_mask_t streams_mask;
stream_mask_t todo_wine_mask;
}
streams_table[] =
{
/* 0 */ {MiniDumpNormal, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK},
{MiniDumpWithDataSegs, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK},
{MiniDumpWithProcessThreadData, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK},
{MiniDumpWithThreadInfo, BASIC_STREAM_MASK | STREAM2MASK(ThreadInfoListStream), BASIC_STREAM_TODO_MASK | STREAM2MASK(ThreadInfoListStream)},
{MiniDumpWithCodeSegs, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK},
/* 5 */ {MiniDumpWithTokenInformation, BASIC_STREAM_MASK | STREAM2MASK(TokenStream), BASIC_STREAM_TODO_MASK | STREAM2MASK(TokenStream)},
{MiniDumpWithModuleHeaders, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK}, /* requires win8 at least */
{MiniDumpWithAvxXStateContext, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK}, /* requires win10 at least */
{MiniDumpWithIptTrace, BASIC_STREAM_MASK, BASIC_STREAM_TODO_MASK},
};
MINIDUMP_HEADER *hdr;
void *where;
ULONG size;
BOOL ret;
int i, j;
for (i = 0; i < ARRAY_SIZE(streams_table); i++)
{
winetest_push_context("streams_table[%d]", i);
/* too old for dbghelp in Win7 & 8 */
if (minidump_write(GetCurrentProcess(), L"foo.mdmp", streams_table[i].type, i >= 6, NULL, NULL))
{
hdr = minidump_open_for_read("foo.mdmp");
/* native keeps (likely padding) some unused streams at the end of directory, but lists them here */
ok(hdr->NumberOfStreams >= popcount64(streams_table[i].streams_mask), "Unexpected number of streams %u <> %u\n",
hdr->NumberOfStreams, popcount64(streams_table[i].streams_mask));
ok(hdr->Flags == streams_table[i].type, "Unexpected flags\n");
/* start at 3, 0=unused (cf above), 1,2=reserved shall be skipped */
for (j = 3; j < 25 /* last documented stream */; j++)
{
ret = MiniDumpReadDumpStream(hdr, j, NULL, &where, &size);
todo_wine_if(streams_table[i].todo_wine_mask & STREAM2MASK(j))
if (streams_table[i].streams_mask & STREAM2MASK(j))
ok((ret && where) || broken(BASIC_STREAM_BROKEN_MASK & STREAM2MASK(j)), "Expecting stream %d to be present\n", j);
else
ok(!ret, "Not expecting stream %d to be present\n", j);
}
minidump_close_for_read(hdr);
ret = DeleteFileA("foo.mdmp");
ok(ret, "Couldn't delete file\n");
}
else win_skip("Skipping not supported feature (too old dbghelp version)\n");
winetest_pop_context();
}
}
static void minidump_check_nostream(void *data, MINIDUMP_STREAM_TYPE stream_type)
{
void *stream;
BOOL ret;
ret = MiniDumpReadDumpStream(data, stream_type, NULL, (void**)&stream, NULL);
ok(!ret, "Unexpected stream %u\n", stream_type);
}
static void minidump_check_pid(void *data, DWORD pid)
{
MINIDUMP_MISC_INFO *misc_info;
BOOL ret;
ret = MiniDumpReadDumpStream(data, MiscInfoStream, NULL, (void**)&misc_info, NULL);
ok(ret && misc_info, "Couldn't find misc-info stream\n");
ok(misc_info->Flags1 & misc_info->Flags1 & MINIDUMP_MISC1_PROCESS_ID, "No process-id in misc_info\n");
ok(pid == misc_info->ProcessId, "Unexpected process id\n");
}
static unsigned minidump_get_number_of_threads(void *data)
{
MINIDUMP_THREAD_LIST *thread_list;
BOOL ret;
ret = MiniDumpReadDumpStream(data, ThreadListStream, NULL, (void**)&thread_list, NULL);
ok(ret && thread_list, "Couldn't find thread-list stream\n");
return thread_list->NumberOfThreads;
}
static void minidump_check_threads(void *data)
{
MINIDUMP_THREAD_LIST *thread_list;
ULONG stream_size;
int i;
BOOL ret;
ret = MiniDumpReadDumpStream(data, ThreadListStream, NULL, (void**)&thread_list, &stream_size);
ok(ret && thread_list, "Couldn't find thread-list stream\n");
ok(stream_size == sizeof(thread_list->NumberOfThreads) + thread_list->NumberOfThreads * sizeof(thread_list->Threads[0]),
"Unexpected size\n");
for (i = 0; i < thread_list->NumberOfThreads; i++)
{
const MINIDUMP_THREAD *thread = &thread_list->Threads[i];
const CONTEXT *ctx;
ok(thread->SuspendCount == 0, "Unexpected value\n");
ok(thread->Stack.StartOfMemoryRange, "Unexpected value %I64x\n", thread->Stack.StartOfMemoryRange);
ok(thread->Stack.Memory.DataSize, "Unexpected value %x\n", thread->Stack.Memory.DataSize);
ok(thread->Teb, "Unexpected value\n");
ok(thread->ThreadContext.DataSize >= sizeof(CONTEXT), "Unexpected value\n");
ctx = RVA_TO_ADDR(data, thread->ThreadContext.Rva);
ok((ctx->ContextFlags & CONTEXT_ALL) == CONTEXT_ALL, "Unexpected value\n");
}
}
static void minidump_check_module(void *data, const WCHAR *name, DWORD64 base)
{
MINIDUMP_MODULE_LIST *module_list;
size_t namelen = wcslen(name);
int i;
BOOL ret;
ret = MiniDumpReadDumpStream(data, ModuleListStream, NULL, (void**)&module_list, NULL);
ok(ret && module_list, "Couldn't find module-list stream\n");
ok(module_list->NumberOfModules > 3, "Unexpected number of modules\n");
for (i = 0; i < module_list->NumberOfModules; i++)
{
MINIDUMP_MODULE *module = &module_list->Modules[i];
WCHAR *ptr;
MINIDUMP_STRING *string = RVA_TO_ADDR(data, module->ModuleNameRva);
for (ptr = string->Buffer + string->Length / sizeof(WCHAR) - 1; ptr >= string->Buffer && *ptr != L'\\'; ptr--) {}
ptr++;
if (ptr + namelen == string->Buffer + string->Length / sizeof(WCHAR) &&
!wcsnicmp(name, ptr, namelen) &&
module->BaseOfImage == base) break;
}
ok(i < module_list->NumberOfModules, "Couldn't find module %ls in minidump\n", name);
}
struct memory_description
{
/* MD_SECTION, MD_DIRECTORY can be present at the same time */
/* MD_UNMAPPED: some DLLs are present when creating the minidump, but are unloaded afterwards (native) */
enum {MD_NONE = 0, MD_UNMAPPED = 1, MD_PE_HEADER = 2, MD_STACK = 3, MD_SECTION = 4, MD_DIRECTORY = 8, MD_UNWIND = 16} kind;
unsigned id; /* MD_STACK: thread index
* MD_DIRECTORY: directory index
* MD_UNWIND: function index in function table
*/
const char* name; /* MD_SECTION: section name */
};
static struct memory_description minidump_get_memory_description(void *data, DWORD64 addr)
{
const BYTE *addr_ptr = (void*)(ULONG_PTR)addr;
MINIDUMP_MODULE_LIST *module_list;
MINIDUMP_THREAD_LIST *thread_list;
struct memory_description md = {.kind = MD_NONE};
BOOL ret;
int i, j, dir;
ret = MiniDumpReadDumpStream(data, ModuleListStream, NULL, (void**)&module_list, NULL);
ok(ret && module_list, "Couldn't find module-list stream\n");
for (i = 0; i < module_list->NumberOfModules; i++)
{
MINIDUMP_MODULE *module = &module_list->Modules[i];
MINIDUMP_STRING *string = RVA_TO_ADDR(data, module->ModuleNameRva);
if (module->BaseOfImage <= addr && addr < module->BaseOfImage + module->SizeOfImage)
{
HMODULE module_handle;
WCHAR *module_name;
size_t module_name_len = string->Length / sizeof(WCHAR);
IMAGE_NT_HEADERS *nthdr;
module_name = malloc((module_name_len + 1) * sizeof(WCHAR));
if (!module_name) continue;
memcpy(module_name, string->Buffer, module_name_len * sizeof(WCHAR));
module_name[module_name_len] = L'\0';
module_handle = GetModuleHandleW(module_name);
if ((nthdr = RtlImageNtHeader(module_handle)))
{
for (dir = 0; dir < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; dir++)
{
ULONG dir_size;
const BYTE *dir_start = RtlImageDirectoryEntryToData(module_handle, TRUE, dir, &dir_size);
if (dir_start && dir_start <= addr_ptr && addr_ptr < dir_start + dir_size)
{
md.kind |= MD_DIRECTORY;
md.id = dir;
}
switch (dir)
{
case IMAGE_DIRECTORY_ENTRY_EXCEPTION:
if (nthdr->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)
{
const IMAGE_AMD64_RUNTIME_FUNCTION_ENTRY *func;
for (func = (const void*)dir_start; func < (const IMAGE_AMD64_RUNTIME_FUNCTION_ENTRY *)(dir_start + dir_size); func++)
{
if (RtlImageRvaToVa(nthdr, module_handle, func->UnwindData, NULL) == addr_ptr)
{
md.kind = MD_UNWIND;
md.id = func - (const IMAGE_AMD64_RUNTIME_FUNCTION_ENTRY *)dir_start;
}
}
}
break;
/* FIXME handle more areas: import/export tables... */
}
}
if (addr < (DWORD_PTR)(IMAGE_FIRST_SECTION(nthdr) + nthdr->FileHeader.NumberOfSections))
{
md.kind = MD_PE_HEADER;
}
for (j = 0; j < nthdr->FileHeader.NumberOfSections; j++)
{
IMAGE_SECTION_HEADER *section = IMAGE_FIRST_SECTION(nthdr) + j;
const BYTE *section_start = (BYTE*)module_handle + section->VirtualAddress;
if (section_start <= addr_ptr && addr_ptr < section_start + section->Misc.VirtualSize)
{
md.kind |= MD_SECTION;
md.name = (const char*)section->Name;
}
}
}
else md.kind = MD_UNMAPPED;
free(module_name);
return md;
}
}
ret = MiniDumpReadDumpStream(data, ThreadListStream, NULL, (void**)&thread_list, NULL);
ok(ret && thread_list, "Couldn't find thread-list stream\n");
for (i = 0; i < thread_list->NumberOfThreads; i++)
{
MINIDUMP_THREAD *thread = &thread_list->Threads[i];
if (thread->Stack.StartOfMemoryRange <= addr &&
addr < thread->Stack.StartOfMemoryRange + thread->Stack.Memory.DataSize)
{
md.kind = MD_STACK;
md.id = i;
return md;
}
}
return md;
}
/* modules could be load/unloaded when generating the minidump, so count the number of available modules */
static unsigned minidump_get_number_of_available_modules(void *data)
{
MINIDUMP_MODULE_LIST *module_list;
unsigned num_modules = 0;
BOOL ret;
int i;
ret = MiniDumpReadDumpStream(data, ModuleListStream, NULL, (void**)&module_list, NULL);
ok(ret && module_list, "Couldn't find module-list stream\n");
for (i = 0; i < module_list->NumberOfModules; i++)
{
struct memory_description md;
md = minidump_get_memory_description(data, module_list->Modules[i].BaseOfImage);
if (md.kind != MD_UNMAPPED)
num_modules++;
}
return num_modules;
}
struct memory_walker
{
unsigned num_unknown; /* number of unknown memory locations */
unsigned num_thread_stack; /* number of locations inside a thread stack */
unsigned num_directories[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; /* number of locations in side the directories' content */
unsigned num_text; /* number of locations inside .text section */
unsigned num_unwind_info;
};
static void minidump_walk_memory(void *data, struct memory_walker *walker)
{
MINIDUMP_MEMORY_LIST *memory_list;
BOOL ret;
int i;
ret = MiniDumpReadDumpStream(data, MemoryListStream, NULL, (void**)&memory_list, NULL);
ok(ret && memory_list, "Couldn't find memory-list stream\n");
for (i = 0; i < memory_list->NumberOfMemoryRanges; i++)
{
MINIDUMP_MEMORY_DESCRIPTOR *desc = &memory_list->MemoryRanges[i];
struct memory_description md;
md = minidump_get_memory_description(data, desc->StartOfMemoryRange);
switch ((int)md.kind)
{
case MD_NONE:
walker->num_unknown++;
break;
case MD_UNMAPPED:
/* nothing we can do here */
break;
case MD_STACK:
walker->num_thread_stack++;
break;
case MD_SECTION | MD_UNWIND:
walker->num_unwind_info++;
break;
case MD_PE_HEADER:
/* FIXME may change with MiniDumpWithModuleHeaders */
ok(0, "Unexpected memory block in PE header\n");
break;
case MD_SECTION:
case MD_SECTION | MD_DIRECTORY:
if (!strcmp(md.name, ".text"))
walker->num_text++;
if (md.kind & MD_DIRECTORY)
{
ok(md.id < ARRAY_SIZE(walker->num_directories), "Out of bounds index\n");
walker->num_directories[md.id]++;
}
break;
default:
ok(0, "Unexpected memory description kind: %x\n", md.kind);
break;
}
}
}
static void test_current_process(void)
{
static const struct
{
MINIDUMP_TYPE dump_type;
}
process_tests[] =
{
{ MiniDumpNormal /* = 0 */ },
{ MiniDumpWithCodeSegs },
{ MiniDumpWithDataSegs },
{ MiniDumpWithThreadInfo },
/* requires more work
{ MiniDumpWithModuleHeaders },
{ MiniDumpWithProcessThreadData },
*/
};
struct memory_walker walker;
struct memory_description md, md2;
unsigned num_available_modules, num_threads;
void *data;
BOOL ret;
int i;
for (i = 0; i < ARRAY_SIZE(process_tests); i++)
{
winetest_push_context("process_tests[%d]", i);
minidump_write(GetCurrentProcess(), L"foo.mdmp", process_tests[i].dump_type, FALSE, NULL, NULL);
data = minidump_open_for_read("foo.mdmp");
num_threads = minidump_get_number_of_threads(data);
ok(num_threads > 0, "Unexpected number of threads\n");
minidump_check_threads(data);
md = minidump_get_memory_description(data, (DWORD_PTR)&i);
ok(md.kind == MD_STACK, "Couldn't find automatic variable\n");
md2 = minidump_get_memory_description(data, (DWORD_PTR)NtCurrentTeb()->Tib.StackBase - sizeof(void*));
ok(md2.kind == MD_STACK, "Couldn't find stack bottom\n");
ok(md.id == md2.id, "Should be on same stack\n");
minidump_check_pid(data, GetCurrentProcessId());
num_available_modules = minidump_get_number_of_available_modules(data);
#define CHECK_MODULE(s) minidump_check_module(data, s, (DWORD64)(DWORD_PTR)GetModuleHandleW(s))
CHECK_MODULE(L"ntdll.dll");
CHECK_MODULE(L"kernelbase.dll");
CHECK_MODULE(L"kernel32.dll");
CHECK_MODULE(L"dbghelp.dll");
#undef CHECK_MODULE
memset(&walker, 0, sizeof(walker));
minidump_walk_memory(data, &walker);
ok(walker.num_unknown == 0, "unexpected unknown memory locations\n");
ok(walker.num_thread_stack == num_threads, "Unexpected number of stacks\n");
if (sizeof(void*) > 4 && (process_tests[i].dump_type & MiniDumpWithModuleHeaders))
ok(walker.num_directories[IMAGE_DIRECTORY_ENTRY_EXCEPTION] > 0, "expected unwind information\n");
else
ok(walker.num_directories[IMAGE_DIRECTORY_ENTRY_EXCEPTION] == 0, "unexpected unwind information\n");
if (process_tests[i].dump_type & MiniDumpWithCodeSegs)
{
todo_wine
ok(walker.num_text >= num_available_modules ||
/* win7 & 8 report one less */
broken(walker.num_text + 1 >= num_available_modules), "expected code segments %u %u\n", walker.num_text, num_available_modules);
}
else
/* native embeds some elements in code segment from ntdll */
ok(walker.num_text < 5, "unexpected code segments %u %u\n", walker.num_text, num_available_modules);
ok(walker.num_unwind_info == 0, "unexpected unwind info %u\n", walker.num_unwind_info);
minidump_check_nostream(data, ExceptionStream);
minidump_close_for_read(data);
ret = DeleteFileA("foo.mdmp");
ok(ret, "Couldn't delete file\n");
winetest_pop_context();
}
}
struct cb_info
{
/* input */
unsigned module_flags;
unsigned thread_flags;
/* output */
DWORD64 mask_types;
unsigned num_modules;
unsigned num_threads;
unsigned num_include_modules;
unsigned num_include_threads;
};
static BOOL CALLBACK test_callback_cb(void *pmt, MINIDUMP_CALLBACK_INPUT *input, MINIDUMP_CALLBACK_OUTPUT *output)
{
struct cb_info *cb = pmt;
ok(input->CallbackType < sizeof(cb->mask_types) * 8, "Too small mask\n");
cb->mask_types |= (DWORD64)1u << input->CallbackType;
if (input->CallbackType == WriteKernelMinidumpCallback || input->CallbackType == IoStartCallback)
{
ok(input->ProcessId == 0, "Unexpected pid %lu %lu\n", input->ProcessId, input->CallbackType);
ok(input->ProcessHandle == NULL, "Unexpected process handle %p %lu\n", input->ProcessHandle, input->CallbackType);
}
else if (input->CallbackType == IsProcessSnapshotCallback || input->CallbackType == VmStartCallback)
{
ok(input->ProcessId == 0, "Unexpected pid %lu %lu\n", input->ProcessId, input->CallbackType);
ok(input->ProcessHandle == GetCurrentProcess(), "Unexpected process handle %p %lu\n", input->ProcessHandle, input->CallbackType);
}
else
{
ok(input->ProcessId == GetCurrentProcessId(), "Unexpected pid %lu %lu\n", input->ProcessId, input->CallbackType);
ok(input->ProcessHandle == GetCurrentProcess(), "Unexpected process handle %p %lu\n", input->ProcessHandle, input->CallbackType);
}
switch (input->CallbackType)
{
case ModuleCallback:
ok(output->ModuleWriteFlags == cb->module_flags, "Unexpected module flags %lx\n", output->ModuleWriteFlags);
cb->num_modules++;
break;
case IncludeModuleCallback:
ok(output->ModuleWriteFlags == cb->module_flags, "Unexpected module flags %lx\n", output->ModuleWriteFlags);
cb->num_include_modules++;
break;
case ThreadCallback:
case ThreadExCallback:
ok(output->ThreadWriteFlags == cb->thread_flags, "Unexpected thread flags %lx\n", output->ThreadWriteFlags);
cb->num_threads++;
break;
case IncludeThreadCallback:
ok(output->ThreadWriteFlags == cb->thread_flags, "Unexpected thread flags %lx\n", output->ThreadWriteFlags);
cb->num_include_threads++;
break;
case MemoryCallback:
case RemoveMemoryCallback:
ok(output->MemoryBase == 0, "Unexpected memory info\n");
ok(output->MemorySize == 0, "Unexpected memory info\n");
break;
case CancelCallback:
ok(!output->Cancel, "Unexpected value\n");
ok(!output->CheckCancel, "Unexpected value\n");
break;
case WriteKernelMinidumpCallback:
ok(output->Handle == NULL, "Unexpected value\n");
break;
/* case KernelMinidumpStatusCallback: */
/* case IncludeVmRegionCallback: */
case IoStartCallback:
ok(output->Status == E_NOTIMPL, "Unexpected value %lx\n", output->Status);
/* TODO check the output->Vm* fields */
break;
/* case IoWriteAllCallback:
* case IoFinishCallback:
*/
case ReadMemoryFailureCallback:
/* TODO check the rest */
break;
case SecondaryFlagsCallback:
ok(input->SecondaryFlags == 0x00, "Unexpected value %lx\n", input->SecondaryFlags);
ok(input->SecondaryFlags == output->SecondaryFlags, "Unexpected value %lx\n", output->SecondaryFlags);
break;
case IsProcessSnapshotCallback:
break;
case VmStartCallback:
break;
/*
case VmQueryCallback:
case VmPreReadCallback:
case VmPostReadCallback:
*/
default:
ok(0, "Unexpected callback type %lu\n", input->CallbackType);
break;
}
return TRUE;
}
static void test_callback(void)
{
static const struct
{
MINIDUMP_TYPE dump_type;
unsigned module_flags;
unsigned thread_flags;
}
callback_tests[] =
{
{
MiniDumpNormal /* = 0 */,
ModuleWriteModule | ModuleWriteMiscRecord | ModuleWriteCvRecord,
ThreadWriteThread | ThreadWriteStack | ThreadWriteContext | ThreadWriteInstructionWindow,
},
{
MiniDumpWithCodeSegs,
ModuleWriteModule | ModuleWriteMiscRecord | ModuleWriteCvRecord | ModuleWriteCodeSegs,
ThreadWriteThread | ThreadWriteStack | ThreadWriteContext | ThreadWriteInstructionWindow,
},
{
MiniDumpWithDataSegs,
ModuleWriteModule | ModuleWriteMiscRecord | ModuleWriteCvRecord | ModuleWriteDataSeg,
ThreadWriteThread | ThreadWriteStack | ThreadWriteContext | ThreadWriteInstructionWindow,
},
{
MiniDumpWithThreadInfo,
ModuleWriteModule | ModuleWriteMiscRecord | ModuleWriteCvRecord,
ThreadWriteThread | ThreadWriteStack | ThreadWriteContext | ThreadWriteInstructionWindow | ThreadWriteThreadInfo,
},
};
#define X(a) ((stream_mask_t)1u << (a))
static const stream_mask_t mask_types =
X(ModuleCallback) | X(ThreadCallback) | /* ThreadExCallback */ X(IncludeThreadCallback) |
X(IncludeModuleCallback) | X(MemoryCallback) | X(CancelCallback) | X(WriteKernelMinidumpCallback) |
/* KernelMinidumpStatusCallback) */ X(RemoveMemoryCallback) | /* IncludeVmRegionCallback */ X(IoStartCallback) |
/* IoWriteAllCallback IoFinishCallback ReadMemoryFailureCallback */ X(SecondaryFlagsCallback) |
X(IsProcessSnapshotCallback) | X(VmStartCallback) /* VmQueryCallback VmPreReadCallback */
/* VmPostReadCallback */;
static const stream_mask_t mask_types_too_old_dbghelp = X(IsProcessSnapshotCallback) | X(VmStartCallback);
#undef X
struct cb_info cb_info;
MINIDUMP_CALLBACK_INFORMATION cbi = {.CallbackRoutine = test_callback_cb, .CallbackParam = &cb_info};
BOOL ret;
int i;
for (i = 0; i < ARRAY_SIZE(callback_tests); i++)
{
winetest_push_context("callback_tests[%d]", i);
memset(&cb_info, 0, sizeof(cb_info));
cb_info.module_flags = callback_tests[i].module_flags;
cb_info.thread_flags = callback_tests[i].thread_flags;
minidump_write(GetCurrentProcess(), L"foo.mdmp", callback_tests[i].dump_type, FALSE, NULL, &cbi);
todo_wine
ok(cb_info.mask_types == mask_types ||
broken(cb_info.mask_types == (mask_types & ~mask_types_too_old_dbghelp)),
"Unexpected mask for callback types %I64x (%I64x)\n", cb_info.mask_types, mask_types);
ok(cb_info.num_modules > 5, "Unexpected number of modules\n");
/* native reports several threads... */
ok(cb_info.num_threads >= 1, "Unexpected number of threads\n");
todo_wine
ok(cb_info.num_modules == cb_info.num_include_modules, "Unexpected number of include modules\n");
todo_wine
ok(cb_info.num_threads == cb_info.num_include_threads, "Unexpected number of include threads\n");
ret = DeleteFileA("foo.mdmp");
ok(ret, "Couldn't delete file\n");
winetest_pop_context();
}
}
static void test_exception(void)
{
static const struct
{
unsigned exception_code;
unsigned exception_flags;
unsigned num_args;
BOOL with_child;
}
exception_tests[] =
{
{ 0x1234, 0, 0, FALSE },
{ 0x1234, 0, 0, TRUE },
{ 0x1234, 0, 5, FALSE },
{ 0x1234, 0, 5, TRUE },
{ EXCEPTION_BREAKPOINT, 0, 1, TRUE },
{ EXCEPTION_ACCESS_VIOLATION, 0, 2, TRUE },
};
ULONG_PTR args[EXCEPTION_MAXIMUM_PARAMETERS];
MINIDUMP_EXCEPTION_STREAM *except_info;
ULONG size;
void *data;
BOOL ret;
int i, j;
for (i = 0; i < ARRAY_SIZE(args); i++) args[i] = 0x666000 + i;
for (i = 0; i < ARRAY_SIZE(exception_tests); i++)
{
PROCESS_INFORMATION pi;
MINIDUMP_EXCEPTION_INFORMATION mei;
EXCEPTION_POINTERS ep;
DEBUG_EVENT ev;
/* for local access */
EXCEPTION_RECORD er;
CONTEXT ctx;
CONTEXT *mctx;
winetest_push_context("test_exceptions[%d]", i);
if (exception_tests[i].with_child)
{
BOOL first_exception = TRUE;
STARTUPINFOA si;
char buffer[MAX_PATH];
char **argv;
winetest_get_mainargs(&argv);
snprintf(buffer, ARRAY_SIZE(buffer), "%s minidump exception %x;%x;%u",
argv[0], exception_tests[i].exception_code, exception_tests[i].exception_flags,
exception_tests[i].num_args);
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi);
ok(ret, "CreateProcess failed, last error %#lx.\n", GetLastError());
while ((ret = WaitForDebugEvent(&ev, 2000)))
{
if (!first_exception && ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT) break;
if (first_exception && ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT &&
ev.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
first_exception = FALSE;
ret = ContinueDebugEvent(ev.dwProcessId, ev.dwThreadId, DBG_CONTINUE);
};
ok(ret, "Couldn't get debug event\n");
ok(ev.dwThreadId == pi.dwThreadId, "Unexpected value\n");
mei.ThreadId = ev.dwThreadId;
mei.ExceptionPointers = &ep;
mei.ClientPointers = FALSE;
ep.ExceptionRecord = &ev.u.Exception.ExceptionRecord;
ep.ContextRecord = &ctx;
ctx.ContextFlags = CONTEXT_FULL;
ret = GetThreadContext(pi.hThread, &ctx);
ok(ret, "Couldn't get thread context\n");
CloseHandle(pi.hThread);
}
else
{
mei.ThreadId = GetCurrentThreadId();
mei.ExceptionPointers = &ep;
mei.ClientPointers = FALSE;
ep.ExceptionRecord = &er;
ep.ContextRecord = &ctx;
memset(&ctx, 0xA5, sizeof(ctx));
ctx.ContextFlags = CONTEXT_FULL;
er.ExceptionCode = exception_tests[i].exception_code;
er.ExceptionFlags = exception_tests[i].exception_flags;
er.ExceptionAddress = (void *)(DWORD_PTR)0xdeadbeef;
er.NumberParameters = exception_tests[i].num_args;
for (j = 0; j < exception_tests[i].num_args; j++)
er.ExceptionInformation[j] = args[j];
pi.hProcess = GetCurrentProcess();
}
minidump_write(pi.hProcess, L"foo.mdmp", MiniDumpNormal, FALSE, &mei, NULL);
data = minidump_open_for_read("foo.mdmp");
ret = MiniDumpReadDumpStream(data, ExceptionStream, NULL, (void *)&except_info, &size);
ok(ret, "Couldn't find exception stream\n");
ok(except_info->ThreadId == mei.ThreadId, "Unexpected value\n");
ok(except_info->ExceptionRecord.ExceptionCode == exception_tests[i].exception_code, "Unexpected value %x %x\n", except_info->ExceptionRecord.ExceptionCode, exception_tests[i].exception_code);
/* windows 11 starts adding EXCEPTION_SOFTWARE_ORIGINATE flag */
ok((except_info->ExceptionRecord.ExceptionFlags & ~EXCEPTION_SOFTWARE_ORIGINATE) == exception_tests[i].exception_flags, "Unexpected value\n");
/* yes native does a signed conversion to DWORD64 when running on 32bit... */
ok(except_info->ExceptionRecord.ExceptionAddress == (DWORD_PTR)ep.ExceptionRecord->ExceptionAddress
|| broken(except_info->ExceptionRecord.ExceptionAddress == (LONG_PTR)ep.ExceptionRecord->ExceptionAddress), "Unexpected value\n");
if (except_info->ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
{
/* number of parameters depend on machine, wow64... */
ok(except_info->ExceptionRecord.NumberParameters, "Unexpected value %x\n", except_info->ExceptionRecord.NumberParameters);
}
else if (except_info->ExceptionRecord.ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
{
ok(except_info->ExceptionRecord.NumberParameters == exception_tests[i].num_args, "Unexpected value\n");
}
else
{
ok(except_info->ExceptionRecord.NumberParameters == exception_tests[i].num_args, "Unexpected value\n");
for (j = 0; j < exception_tests[i].num_args; j++)
ok(except_info->ExceptionRecord.ExceptionInformation[j] == args[j], "Unexpected value\n");
}
ok(except_info->ThreadContext.Rva, "Unexpected value\n");
mctx = RVA_TO_ADDR(data, except_info->ThreadContext.Rva);
ok(!memcmp(mctx, &ctx, sizeof(ctx)), "Unexpected value\n");
minidump_check_threads(data);
minidump_close_for_read(data);
DeleteFileA("foo.mdmp");
winetest_pop_context();
if (exception_tests[i].with_child)
{
TerminateProcess(pi.hProcess, 0);
CloseHandle(pi.hProcess);
}
}
}
static void generate_child_exception(const char *arg)
{
DWORD code, flags;
unsigned num_args;
if (sscanf(arg, "%lx;%lx;%u", &code, &flags, &num_args) == 3)
{
switch (code)
{
case EXCEPTION_BREAKPOINT:
DbgBreakPoint();
break;
case EXCEPTION_ACCESS_VIOLATION:
{
/* volatile to silence gcc warning */
char * volatile crashme = (char *)(DWORD_PTR)0x12;
*crashme = 2;
}
break;
default:
{
DWORD_PTR my_args[EXCEPTION_MAXIMUM_PARAMETERS];
int i;
for (i = 0; i < ARRAY_SIZE(my_args); i++)
my_args[i] = 0x666000 + i;
RaiseException(code, flags, num_args, my_args);
}
break;
}
}
}
START_TEST(minidump)
{
int argc;
char **argv;
argc = winetest_get_mainargs(&argv);
if (argc == 4 && !strcmp(argv[2], "exception"))
{
generate_child_exception(argv[3]);
return;
}
test_minidump_contents();
test_current_process();
test_callback();
test_exception();
}

File diff suppressed because it is too large Load diff

View file

@ -420,6 +420,7 @@ static void ddraw_destroy_swapchain(struct ddraw *ddraw)
*****************************************************************************/
static void ddraw_destroy(struct ddraw *This)
{
struct d3d_device *device;
IDirectDraw7_SetCooperativeLevel(&This->IDirectDraw7_iface, NULL, DDSCL_NORMAL);
IDirectDraw7_RestoreDisplayMode(&This->IDirectDraw7_iface);
@ -437,12 +438,13 @@ static void ddraw_destroy(struct ddraw *This)
if (This->wined3d_swapchain)
ddraw_destroy_swapchain(This);
wined3d_stateblock_decref(This->state);
wined3d_device_decref(This->wined3d_device);
wined3d_decref(This->wined3d);
if (This->d3ddevice)
This->d3ddevice->ddraw = NULL;
LIST_FOR_EACH_ENTRY(device, &This->d3ddevice_list, struct d3d_device, ddraw_entry)
{
device->ddraw = NULL;
}
/* Now free the object */
free(This);
@ -794,9 +796,8 @@ static HRESULT WINAPI ddraw1_RestoreDisplayMode(IDirectDraw *iface)
static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
DWORD cooplevel, BOOL restore_mode_on_normal)
{
struct wined3d_rendertarget_view *rtv = NULL, *dsv = NULL;
struct wined3d_stateblock *stateblock;
BOOL restore_state = FALSE;
struct d3d_device *device;
RECT clip_rect;
HRESULT hr;
@ -930,22 +931,24 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
{
restore_state = TRUE;
if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device,
ddraw->state, WINED3D_SBT_ALL, &stateblock)))
LIST_FOR_EACH_ENTRY(device, &ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
ERR("Failed to create stateblock, hr %#lx.\n", hr);
goto done;
if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device,
device->state, WINED3D_SBT_ALL, &device->saved_state)))
{
struct list *entry;
ERR("Failed to create stateblock, hr %#lx.\n", hr);
entry = &device->ddraw_entry;
while ((entry = list_prev(&ddraw->d3ddevice_list, entry)))
{
device = LIST_ENTRY(entry, struct d3d_device, ddraw_entry);
wined3d_stateblock_decref(device->saved_state);
device->saved_state = NULL;
}
goto done;
}
}
rtv = wined3d_device_context_get_rendertarget_view(ddraw->immediate_context, 0);
/* Rendering to the wined3d frontbuffer. */
if (rtv && !wined3d_rendertarget_view_get_sub_resource_parent(rtv))
rtv = NULL;
else if (rtv)
wined3d_rendertarget_view_incref(rtv);
if ((dsv = wined3d_device_context_get_depth_stencil_view(ddraw->immediate_context)))
wined3d_rendertarget_view_incref(dsv);
}
ddraw_destroy_swapchain(ddraw);
@ -956,20 +959,12 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
if (restore_state)
{
if (dsv)
LIST_FOR_EACH_ENTRY(device, &ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
wined3d_device_context_set_depth_stencil_view(ddraw->immediate_context, dsv);
wined3d_rendertarget_view_decref(dsv);
wined3d_stateblock_apply(device->saved_state, device->state);
wined3d_stateblock_decref(device->saved_state);
device->saved_state = NULL;
}
if (rtv)
{
wined3d_device_context_set_rendertarget_views(ddraw->immediate_context, 0, 1, &rtv, FALSE);
wined3d_rendertarget_view_decref(rtv);
}
wined3d_stateblock_apply(stateblock, ddraw->state);
wined3d_stateblock_decref(stateblock);
}
if (!(cooplevel & DDSCL_EXCLUSIVE) && (ddraw->cooperative_level & DDSCL_EXCLUSIVE))
@ -3868,7 +3863,10 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
* never have POW2 unset in d3d7 on windows. */
if (ddraw->d3dversion != 1)
{
static CHAR reference_description[] = "RGB Direct3D emulation";
/* Tomb Raider 3 overwrites the reference device description buffer
* with its own custom string. Reserve some extra space in the array
* to avoid a buffer overrun. */
static CHAR reference_description[64] = "RGB Direct3D emulation";
TRACE("Enumerating WineD3D D3DDevice interface.\n");
hal_desc = device_desc1;
@ -5124,15 +5122,6 @@ HRESULT ddraw_init(struct ddraw *ddraw, DWORD flags, enum wined3d_device_type de
ddraw->immediate_context = wined3d_device_get_immediate_context(ddraw->wined3d_device);
list_init(&ddraw->surface_list);
if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &ddraw->state)))
{
ERR("Failed to create the primary stateblock, hr %#lx.\n", hr);
wined3d_device_decref(ddraw->wined3d_device);
wined3d_decref(ddraw->wined3d);
return hr;
}
ddraw->stateblock_state = wined3d_stateblock_get_state(ddraw->state);
list_init(&ddraw->d3ddevice_list);
return DD_OK;
}

View file

@ -113,7 +113,7 @@ struct ddraw
/* D3D things */
HWND d3d_window;
struct d3d_device *d3ddevice;
struct list d3ddevice_list;
int d3dversion;
/* Various HWNDs */
@ -132,9 +132,6 @@ struct ddraw
struct FvfToDecl *decls;
UINT numConvertedDecls, declArraySize;
struct wined3d_stateblock *state;
const struct wined3d_stateblock_state *stateblock_state;
unsigned int frames;
DWORD prev_frame_time;
};
@ -329,7 +326,9 @@ struct d3d_device
struct wined3d_device *wined3d_device;
struct wined3d_device_context *immediate_context;
struct ddraw *ddraw;
struct list ddraw_entry;
IUnknown *rt_iface;
struct ddraw_surface *target, *target_ds;
struct wined3d_streaming_buffer vertex_buffer, index_buffer;
@ -364,6 +363,9 @@ struct d3d_device
struct wined3d_stateblock *recording, *state, *update_state;
const struct wined3d_stateblock_state *stateblock_state;
/* For temporary saving state during reset. */
struct wined3d_stateblock *saved_state;
};
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface,

View file

@ -284,10 +284,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
wined3d_device_context_set_rendertarget_views(This->immediate_context, 0, 1, &null_rtv, FALSE);
wined3d_stateblock_decref(This->state);
if (This->recording)
wined3d_stateblock_decref(This->recording);
/* Release the wined3d device. This won't destroy it. */
if (!wined3d_device_decref(This->wined3d_device))
ERR("The wined3d device (%p) was destroyed unexpectedly.\n", This->wined3d_device);
@ -303,22 +299,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
case DDRAW_HANDLE_FREE:
break;
case DDRAW_HANDLE_MATERIAL:
{
struct d3d_material *m = entry->object;
FIXME("Material handle %#lx (%p) not unset properly.\n", i + 1, m);
m->Handle = 0;
break;
}
case DDRAW_HANDLE_MATRIX:
{
/* No FIXME here because this might happen because of sloppy applications. */
WARN("Leftover matrix handle %#lx (%p), deleting.\n", i + 1, entry->object);
IDirect3DDevice_DeleteMatrix(&This->IDirect3DDevice_iface, i + 1);
break;
}
case DDRAW_HANDLE_STATEBLOCK:
{
/* No FIXME here because this might happen because of sloppy applications. */
@ -327,14 +307,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
break;
}
case DDRAW_HANDLE_SURFACE:
{
struct ddraw_surface *surf = entry->object;
FIXME("Texture handle %#lx (%p) not unset properly.\n", i + 1, surf);
surf->Handle = 0;
break;
}
default:
FIXME("Handle %#lx (%p) has unknown type %#x.\n", i + 1, entry->object, entry->type);
break;
@ -349,18 +321,27 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
IDirect3DDevice3_DeleteViewport(&This->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
}
wined3d_stateblock_decref(This->state);
if (This->recording)
wined3d_stateblock_decref(This->recording);
/* Releasing the render target below may release the last reference to the ddraw object. Detach
* the device from it before so it doesn't try to save / restore state on the teared down device. */
if (This->ddraw)
{
list_remove(&This->ddraw_entry);
This->ddraw = NULL;
}
TRACE("Releasing render target %p.\n", This->rt_iface);
rt_iface = This->rt_iface;
This->rt_iface = NULL;
This->target = NULL;
This->target_ds = NULL;
if (This->version != 1)
IUnknown_Release(rt_iface);
TRACE("Render target release done.\n");
/* Releasing the render target above may have released the last
* reference to the ddraw object. */
if (This->ddraw)
This->ddraw->d3ddevice = NULL;
/* Now free the structure */
free(This);
wined3d_mutex_unlock();
@ -1320,7 +1301,6 @@ static HRESULT WINAPI d3d_device1_EnumTextureFormats(IDirect3DDevice *iface,
*****************************************************************************/
static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE *D3DMatHandle)
{
struct d3d_device *device = impl_from_IDirect3DDevice(iface);
D3DMATRIX *matrix;
DWORD h;
@ -1337,7 +1317,7 @@ static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIX
wined3d_mutex_lock();
h = ddraw_allocate_handle(&device->handle_table, matrix, DDRAW_HANDLE_MATRIX);
h = ddraw_allocate_handle(NULL, matrix, DDRAW_HANDLE_MATRIX);
if (h == DDRAW_INVALID_HANDLE)
{
ERR("Failed to allocate a matrix handle.\n");
@ -1386,7 +1366,7 @@ static HRESULT WINAPI d3d_device1_SetMatrix(IDirect3DDevice *iface,
wined3d_mutex_lock();
m = ddraw_get_object(&device->handle_table, matrix_handle - 1, DDRAW_HANDLE_MATRIX);
m = ddraw_get_object(NULL, matrix_handle - 1, DDRAW_HANDLE_MATRIX);
if (!m)
{
WARN("Invalid matrix handle.\n");
@ -1435,7 +1415,6 @@ static HRESULT WINAPI d3d_device1_SetMatrix(IDirect3DDevice *iface,
static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface,
D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
{
struct d3d_device *device = impl_from_IDirect3DDevice(iface);
D3DMATRIX *m;
TRACE("iface %p, matrix_handle %#lx, matrix %p.\n", iface, D3DMatHandle, D3DMatrix);
@ -1444,7 +1423,7 @@ static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface,
wined3d_mutex_lock();
m = ddraw_get_object(&device->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
m = ddraw_get_object(NULL, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
if (!m)
{
WARN("Invalid matrix handle.\n");
@ -1476,14 +1455,13 @@ static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface,
*****************************************************************************/
static HRESULT WINAPI d3d_device1_DeleteMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle)
{
struct d3d_device *device = impl_from_IDirect3DDevice(iface);
D3DMATRIX *m;
TRACE("iface %p, matrix_handle %#lx.\n", iface, D3DMatHandle);
wined3d_mutex_lock();
m = ddraw_free_handle(&device->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
m = ddraw_free_handle(NULL, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
if (!m)
{
WARN("Invalid matrix handle.\n");
@ -1868,6 +1846,7 @@ static HRESULT d3d_device_set_render_target(struct d3d_device *device,
IUnknown_AddRef(rt_iface);
IUnknown_Release(device->rt_iface);
device->rt_iface = rt_iface;
device->target = target;
d3d_device_update_depth_stencil(device);
return D3D_OK;
@ -1911,6 +1890,8 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
IDirectDrawSurface7_AddRef(target);
IUnknown_Release(device->rt_iface);
device->rt_iface = (IUnknown *)target;
device->target = NULL;
device->target_ds = NULL;
wined3d_mutex_unlock();
return DDERR_INVALIDPIXELFORMAT;
}
@ -1970,6 +1951,8 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
IDirectDrawSurface4_AddRef(target);
IUnknown_Release(device->rt_iface);
device->rt_iface = (IUnknown *)target;
device->target = NULL;
device->target_ds = NULL;
wined3d_mutex_unlock();
return DDERR_INVALIDPIXELFORMAT;
}
@ -1980,6 +1963,8 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
IDirectDrawSurface4_AddRef(target);
IUnknown_Release(device->rt_iface);
device->rt_iface = (IUnknown *)target;
device->target = NULL;
device->target_ds = NULL;
wined3d_mutex_unlock();
return D3D_OK;
}
@ -2019,6 +2004,8 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
WARN("Surface %p is a depth buffer.\n", target_impl);
IUnknown_Release(device->rt_iface);
device->rt_iface = (IUnknown *)target;
device->target = NULL;
device->target_ds = NULL;
wined3d_mutex_unlock();
return DDERR_INVALIDPIXELFORMAT;
}
@ -2029,6 +2016,8 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
IDirectDrawSurface_AddRef(target);
IUnknown_Release(device->rt_iface);
device->rt_iface = (IUnknown *)target;
device->target = NULL;
device->target_ds = NULL;
wined3d_mutex_unlock();
return D3D_OK;
}
@ -2768,7 +2757,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface,
break;
}
surf = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_SURFACE);
surf = ddraw_get_object(NULL, value - 1, DDRAW_HANDLE_SURFACE);
if (!surf)
{
WARN("Invalid texture handle.\n");
@ -2936,7 +2925,7 @@ static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface,
{
struct d3d_material *m;
if (!(m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL)))
if (!(m = ddraw_get_object(NULL, value - 1, DDRAW_HANDLE_MATERIAL)))
{
WARN("Invalid material handle.\n");
wined3d_mutex_unlock();
@ -3391,16 +3380,36 @@ static HRESULT WINAPI d3d_device2_MultiplyTransform(IDirect3DDevice2 *iface,
*****************************************************************************/
static void d3d_device_sync_rendertarget(struct d3d_device *device)
{
struct wined3d_rendertarget_view *rtv;
struct wined3d_rendertarget_view *rtv, *dsv;
rtv = device->target ? ddraw_surface_get_rendertarget_view(device->target) : NULL;
if (rtv)
{
if (FAILED(wined3d_device_context_set_rendertarget_views(device->immediate_context, 0, 1, &rtv, FALSE)))
ERR("wined3d_device_context_set_rendertarget_views failed.\n");
}
else if (!device->target)
{
/* NULL device->target may appear when the game was setting invalid render target which in some cases
* still keeps the invalid render target in the device even while returning an error.
*
* TODO: make render go nowhere instead of lefover render target (like it seems to work on Windows on HW devices
* while may just crash on software devices. */
FIXME("Keeping leftover render target.\n");
}
dsv = device->target_ds ? ddraw_surface_get_rendertarget_view(device->target_ds) : NULL;
if (FAILED(wined3d_device_context_set_depth_stencil_view(device->immediate_context, dsv)))
ERR("wined3d_device_context_set_depth_stencil_view failed.\n");
if (device->hardware_device)
return;
if ((rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0)))
if (rtv)
ddraw_surface_get_draw_texture(wined3d_rendertarget_view_get_parent(rtv), DDRAW_SURFACE_RW);
if ((rtv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
ddraw_surface_get_draw_texture(wined3d_rendertarget_view_get_parent(rtv), DDRAW_SURFACE_RW);
if (dsv)
ddraw_surface_get_draw_texture(wined3d_rendertarget_view_get_parent(dsv), DDRAW_SURFACE_RW);
}
void d3d_device_sync_surfaces(struct d3d_device *device)
@ -5195,7 +5204,8 @@ static HRESULT d3d_device7_SetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *vi
return DDERR_INVALIDPARAMS;
wined3d_mutex_lock();
if (!(rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0)))
rtv = device->target ? ddraw_surface_get_rendertarget_view(device->target) : NULL;
if (!rtv)
{
wined3d_mutex_unlock();
return DDERR_INVALIDCAPS;
@ -6780,7 +6790,6 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
IDirectDrawSurface7 *depthStencil = NULL;
IDirectDrawSurface7 *render_target;
static DDSCAPS2 depthcaps = { DDSCAPS_ZBUFFER, 0, 0, {0} };
struct ddraw_surface *dsi;
if (device->rt_iface && SUCCEEDED(IUnknown_QueryInterface(device->rt_iface,
&IID_IDirectDrawSurface7, (void **)&render_target)))
@ -6792,26 +6801,27 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
{
TRACE("Setting wined3d depth stencil to NULL\n");
wined3d_device_context_set_depth_stencil_view(device->immediate_context, NULL);
device->target_ds = NULL;
return WINED3D_ZB_FALSE;
}
dsi = impl_from_IDirectDrawSurface7(depthStencil);
device->target_ds = impl_from_IDirectDrawSurface7(depthStencil);
wined3d_device_context_set_depth_stencil_view(device->immediate_context,
ddraw_surface_get_rendertarget_view(dsi));
ddraw_surface_get_rendertarget_view(device->target_ds));
IDirectDrawSurface7_Release(depthStencil);
return WINED3D_ZB_TRUE;
}
static void ddraw_reset_viewport_state(struct ddraw *ddraw)
static void device_reset_viewport_state(struct d3d_device *device)
{
struct wined3d_viewport vp;
RECT rect;
wined3d_device_context_get_viewports(ddraw->immediate_context, NULL, &vp);
wined3d_stateblock_set_viewport(ddraw->state, &vp);
wined3d_device_context_get_scissor_rects(ddraw->immediate_context, NULL, &rect);
wined3d_stateblock_set_scissor_rect(ddraw->state, &rect);
wined3d_device_context_get_viewports(device->immediate_context, NULL, &vp);
wined3d_stateblock_set_viewport(device->state, &vp);
wined3d_device_context_get_scissor_rects(device->immediate_context, NULL, &rect);
wined3d_stateblock_set_scissor_rect(device->state, &rect);
}
static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, const GUID *guid,
@ -6865,13 +6875,19 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, c
device->legacy_projection = ident;
device->legacy_clipspace = ident;
if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &device->state)))
{
ERR("Failed to create the primary stateblock, hr %#lx.\n", hr);
ddraw_handle_table_destroy(&device->handle_table);
return hr;
}
device->stateblock_state = wined3d_stateblock_get_state(device->state);
device->update_state = device->state;
/* This is for convenience. */
device->wined3d_device = ddraw->wined3d_device;
device->immediate_context = ddraw->immediate_context;
wined3d_device_incref(ddraw->wined3d_device);
device->update_state = device->state = ddraw->state;
device->stateblock_state = ddraw->stateblock_state;
wined3d_stateblock_incref(ddraw->state);
wined3d_streaming_buffer_init(&device->vertex_buffer, WINED3D_BIND_VERTEX_BUFFER);
wined3d_streaming_buffer_init(&device->index_buffer, WINED3D_BIND_INDEX_BUFFER);
@ -6887,24 +6903,25 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, c
}
device->rt_iface = rt_iface;
device->target = target;
if (version != 1)
IUnknown_AddRef(device->rt_iface);
ddraw->d3ddevice = device;
list_add_head(&ddraw->d3ddevice_list, &device->ddraw_entry);
wined3d_stateblock_set_render_state(ddraw->state, WINED3D_RS_ZENABLE,
wined3d_stateblock_set_render_state(device->state, WINED3D_RS_ZENABLE,
d3d_device_update_depth_stencil(device));
if (version == 1) /* Color keying is initially enabled for version 1 devices. */
wined3d_stateblock_set_render_state(ddraw->state, WINED3D_RS_COLORKEYENABLE, TRUE);
wined3d_stateblock_set_render_state(device->state, WINED3D_RS_COLORKEYENABLE, TRUE);
else if (version == 2)
wined3d_stateblock_set_render_state(ddraw->state, WINED3D_RS_SPECULARENABLE, TRUE);
wined3d_stateblock_set_render_state(device->state, WINED3D_RS_SPECULARENABLE, TRUE);
if (version < 7)
{
wined3d_stateblock_set_render_state(ddraw->state, WINED3D_RS_NORMALIZENORMALS, TRUE);
wined3d_stateblock_set_render_state(device->state, WINED3D_RS_NORMALIZENORMALS, TRUE);
IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface,
D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE);
}
ddraw_reset_viewport_state(ddraw);
device_reset_viewport_state(device);
return D3D_OK;
}
@ -6938,12 +6955,6 @@ HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_su
return DDERR_OUTOFMEMORY;
}
if (ddraw->d3ddevice)
{
FIXME("Only one Direct3D device per DirectDraw object supported.\n");
return DDERR_INVALIDPARAMS;
}
if (!(object = calloc(1, sizeof(*object))))
{
ERR("Failed to allocate device memory.\n");

View file

@ -209,9 +209,9 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
D3DMATRIXMULTIPLY *ci = (D3DMATRIXMULTIPLY *)instr;
struct wined3d_matrix *a, *b, *c;
a = ddraw_get_object(&device->handle_table, ci->hDestMatrix - 1, DDRAW_HANDLE_MATRIX);
b = ddraw_get_object(&device->handle_table, ci->hSrcMatrix1 - 1, DDRAW_HANDLE_MATRIX);
c = ddraw_get_object(&device->handle_table, ci->hSrcMatrix2 - 1, DDRAW_HANDLE_MATRIX);
a = ddraw_get_object(NULL, ci->hDestMatrix - 1, DDRAW_HANDLE_MATRIX);
b = ddraw_get_object(NULL, ci->hSrcMatrix1 - 1, DDRAW_HANDLE_MATRIX);
c = ddraw_get_object(NULL, ci->hSrcMatrix2 - 1, DDRAW_HANDLE_MATRIX);
if (!a || !b || !c)
{
@ -235,7 +235,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
D3DSTATE *ci = (D3DSTATE *)instr;
D3DMATRIX *m;
m = ddraw_get_object(&device->handle_table, ci->dwArg[0] - 1, DDRAW_HANDLE_MATRIX);
m = ddraw_get_object(NULL, ci->dwArg[0] - 1, DDRAW_HANDLE_MATRIX);
if (!m)
{
ERR("Invalid matrix handle %#lx.\n", ci->dwArg[0]);
@ -347,14 +347,12 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
instr += size;
if (!(dst = ddraw_get_object(&device->handle_table,
ci->hDestTexture - 1, DDRAW_HANDLE_SURFACE)))
if (!(dst = ddraw_get_object(NULL, ci->hDestTexture - 1, DDRAW_HANDLE_SURFACE)))
{
WARN("Invalid destination texture handle %#lx.\n", ci->hDestTexture);
continue;
}
if (!(src = ddraw_get_object(&device->handle_table,
ci->hSrcTexture - 1, DDRAW_HANDLE_SURFACE)))
if (!(src = ddraw_get_object(NULL, ci->hSrcTexture - 1, DDRAW_HANDLE_SURFACE)))
{
WARN("Invalid source texture handle %#lx.\n", ci->hSrcTexture);
continue;

View file

@ -37,6 +37,8 @@ static HINSTANCE instance;
/* value of ForceRefreshRate */
DWORD force_refresh_rate = 0;
static struct ddraw_handle_table global_handle_table;
/* Structure for converting DirectDrawEnumerateA to DirectDrawEnumerateExA */
struct callback_info
{
@ -137,6 +139,9 @@ DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddr
{
struct ddraw_handle_entry *entry;
if (!t)
t = &global_handle_table;
if (t->free_entries)
{
DWORD idx = t->free_entries - t->entries;
@ -181,6 +186,9 @@ void *ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_h
struct ddraw_handle_entry *entry;
void *object;
if (!t)
t = &global_handle_table;
if (handle == DDRAW_INVALID_HANDLE || handle >= t->entry_count)
{
WARN("Invalid handle %#lx passed.\n", handle);
@ -206,6 +214,9 @@ void *ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_ha
{
struct ddraw_handle_entry *entry;
if (!t)
t = &global_handle_table;
if (handle == DDRAW_INVALID_HANDLE || handle >= t->entry_count)
{
WARN("Invalid handle %#lx passed.\n", handle);
@ -815,6 +826,12 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
return FALSE;
}
if (!ddraw_handle_table_init(&global_handle_table, 64))
{
UnregisterClassA(DDRAW_WINDOW_CLASS_NAME, inst);
return FALSE;
}
/* On Windows one can force the refresh rate that DirectDraw uses by
* setting an override value in dxdiag. This is documented in KB315614
* (main article), KB230002, and KB217348. By comparing registry dumps
@ -866,6 +883,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
if (WARN_ON(ddraw))
{
struct ddraw *ddraw;
unsigned int i;
LIST_FOR_EACH_ENTRY(ddraw, &global_ddraw_list, struct ddraw, ddraw_list_entry)
{
@ -874,8 +892,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
WARN("DirectDraw object %p has reference counts {%lu, %lu, %lu, %lu, %lu}.\n",
ddraw, ddraw->ref7, ddraw->ref4, ddraw->ref3, ddraw->ref2, ddraw->ref1);
if (ddraw->d3ddevice)
WARN("DirectDraw object %p has Direct3D device %p attached.\n", ddraw, ddraw->d3ddevice);
if (!list_empty(&ddraw->d3ddevice_list))
WARN("DirectDraw object %p has Direct3D device(s) attached.\n", ddraw);
LIST_FOR_EACH_ENTRY(surface, &ddraw->surface_list, struct ddraw_surface, surface_list_entry)
{
@ -884,6 +902,34 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
surface->ref2, surface->ref1, surface->gamma_count);
}
}
for (i = 0; i < global_handle_table.entry_count; ++i)
{
struct ddraw_handle_entry *entry = &global_handle_table.entries[i];
switch (entry->type)
{
case DDRAW_HANDLE_FREE:
break;
case DDRAW_HANDLE_MATERIAL:
WARN("Material handle %#x (%p) not unset properly.\n", i + 1, entry->object);
break;
case DDRAW_HANDLE_SURFACE:
WARN("Texture handle %#x (%p) not unset properly.\n", i + 1, entry->object);
break;
case DDRAW_HANDLE_MATRIX:
WARN("Leftover matrix handle %#x (%p), deleting.\n", i + 1, entry->object);
break;
default:
WARN("Handle %#x (%p) has unknown type %#x.\n", i + 1, entry->object, entry->type);
break;
}
}
ddraw_handle_table_destroy(&global_handle_table);
}
if (reserved) break;

View file

@ -143,7 +143,7 @@ static ULONG WINAPI d3d_material3_Release(IDirect3DMaterial3 *iface)
if (material->Handle)
{
wined3d_mutex_lock();
ddraw_free_handle(&material->ddraw->d3ddevice->handle_table, material->Handle - 1, DDRAW_HANDLE_MATERIAL);
ddraw_free_handle(NULL, material->Handle - 1, DDRAW_HANDLE_MATERIAL);
wined3d_mutex_unlock();
}
@ -300,7 +300,7 @@ static HRESULT WINAPI d3d_material3_GetHandle(IDirect3DMaterial3 *iface,
material->active_device = device_impl;
if (!material->Handle)
{
DWORD h = ddraw_allocate_handle(&device_impl->handle_table, material, DDRAW_HANDLE_MATERIAL);
DWORD h = ddraw_allocate_handle(NULL, material, DDRAW_HANDLE_MATERIAL);
if (h == DDRAW_INVALID_HANDLE)
{
ERR("Failed to allocate a material handle.\n");

View file

@ -1563,7 +1563,6 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT *
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
{
struct ddraw *ddraw = dst_surface->ddraw;
struct wined3d_device *wined3d_device = ddraw->wined3d_device;
struct wined3d_color colour;
DWORD wined3d_flags;
HRESULT hr;
@ -1578,7 +1577,6 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT *
dst_surface->palette, fill_colour, &colour))
return DDERR_INVALIDPARAMS;
wined3d_device_apply_stateblock(wined3d_device, ddraw->state);
ddraw_surface_get_draw_texture(dst_surface, dst_rect ? DDRAW_SURFACE_RW : DDRAW_SURFACE_WRITE);
hr = wined3d_device_context_clear_rendertarget_view(ddraw->immediate_context,
ddraw_surface_get_rendertarget_view(dst_surface),
@ -1597,7 +1595,6 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT *
dst_surface->palette, fill_colour, &colour))
return DDERR_INVALIDPARAMS;
wined3d_device_apply_stateblock(wined3d_device, ddraw->state);
ddraw_surface_get_draw_texture(dst_surface, dst_rect ? DDRAW_SURFACE_RW : DDRAW_SURFACE_WRITE);
return wined3d_device_context_clear_rendertarget_view(ddraw->immediate_context,
ddraw_surface_get_rendertarget_view(dst_surface),
@ -2016,6 +2013,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface2_Blt(IDirectDrawSurface2 *
*****************************************************************************/
static HRESULT ddraw_surface_attach_surface(struct ddraw_surface *This, struct ddraw_surface *Surf)
{
struct d3d_device *device;
TRACE("surface %p, attachment %p.\n", This, Surf);
if(Surf == This)
@ -2042,8 +2041,10 @@ static HRESULT ddraw_surface_attach_surface(struct ddraw_surface *This, struct d
This->next_attached = Surf;
/* Check if the WineD3D depth stencil needs updating */
if (This->ddraw->d3ddevice)
d3d_device_update_depth_stencil(This->ddraw->d3ddevice);
LIST_FOR_EACH_ENTRY(device, &This->ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
d3d_device_update_depth_stencil(device);
}
wined3d_mutex_unlock();
@ -4349,7 +4350,7 @@ static HRESULT WINAPI ddraw_surface4_GetUniquenessValue(IDirectDrawSurface4 *ifa
static HRESULT WINAPI ddraw_surface7_SetLOD(IDirectDrawSurface7 *iface, DWORD MaxLOD)
{
struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface);
HRESULT hr;
struct d3d_device *device;
TRACE("iface %p, lod %lu.\n", iface, MaxLOD);
@ -4360,12 +4361,18 @@ static HRESULT WINAPI ddraw_surface7_SetLOD(IDirectDrawSurface7 *iface, DWORD Ma
return DDERR_INVALIDOBJECT;
}
hr = wined3d_stateblock_set_texture_lod(surface->ddraw->state, surface->wined3d_texture, MaxLOD);
if (SUCCEEDED(hr) && surface->draw_texture)
hr = wined3d_stateblock_set_texture_lod(surface->ddraw->state, surface->draw_texture, MaxLOD);
wined3d_mutex_unlock();
wined3d_texture_set_lod(surface->wined3d_texture, MaxLOD);
if (surface->draw_texture)
wined3d_texture_set_lod(surface->draw_texture, MaxLOD);
return hr;
LIST_FOR_EACH_ENTRY(device, &surface->ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
wined3d_stateblock_texture_changed(device->state, surface->wined3d_texture);
if (surface->draw_texture)
wined3d_stateblock_texture_changed(device->state, surface->draw_texture);
}
wined3d_mutex_unlock();
return DD_OK;
}
/*****************************************************************************
@ -5441,7 +5448,6 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface,
IDirect3DDevice2 *device, D3DTEXTUREHANDLE *handle)
{
struct ddraw_surface *surface = impl_from_IDirect3DTexture2(iface);
struct d3d_device *device_impl = unsafe_impl_from_IDirect3DDevice2(device);
TRACE("iface %p, device %p, handle %p.\n", iface, device, handle);
@ -5449,7 +5455,7 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface,
if (!surface->Handle)
{
DWORD h = ddraw_allocate_handle(&device_impl->handle_table, surface, DDRAW_HANDLE_SURFACE);
DWORD h = ddraw_allocate_handle(NULL, surface, DDRAW_HANDLE_SURFACE);
if (h == DDRAW_INVALID_HANDLE)
{
ERR("Failed to allocate a texture handle.\n");
@ -6060,7 +6066,7 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren
/* Having a texture handle set implies that the device still exists. */
if (surface->Handle)
ddraw_free_handle(&surface->ddraw->d3ddevice->handle_table, surface->Handle - 1, DDRAW_HANDLE_SURFACE);
ddraw_free_handle(NULL, surface->Handle - 1, DDRAW_HANDLE_SURFACE);
/* Reduce the ddraw surface count. */
list_remove(&surface->surface_list_entry);
@ -6519,15 +6525,17 @@ static HRESULT ddraw_texture_init(struct ddraw_texture *texture, struct ddraw *d
fail:
if (draw_texture)
{
wined3d_texture_decref(draw_texture);
parent = wined3d_texture_get_sub_resource_parent(draw_texture, 0);
if (texture->version == 7)
IDirectDrawSurface7_Release(&parent->IDirectDrawSurface7_iface);
else if (texture->version == 4)
IDirectDrawSurface4_Release(&parent->IDirectDrawSurface4_iface);
else
IDirectDrawSurface_Release(&parent->IDirectDrawSurface_iface);
parent = wined3d_texture_get_sub_resource_parent(draw_texture, 0);
if (texture->version == 7)
IDirectDrawSurface7_Release(&parent->IDirectDrawSurface7_iface);
else if (texture->version == 4)
IDirectDrawSurface4_Release(&parent->IDirectDrawSurface4_iface);
else
IDirectDrawSurface_Release(&parent->IDirectDrawSurface_iface);
}
return hr;
}
@ -6763,20 +6771,21 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if (ddraw->cooperative_level & DDSCL_EXCLUSIVE)
{
struct wined3d_swapchain_desc swapchain_desc;
struct d3d_device *device;
wined3d_swapchain_get_desc(ddraw->wined3d_swapchain, &swapchain_desc);
swapchain_desc.backbuffer_width = mode.width;
swapchain_desc.backbuffer_height = mode.height;
swapchain_desc.backbuffer_format = mode.format_id;
if (ddraw->d3ddevice)
LIST_FOR_EACH_ENTRY(device, &ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
if (ddraw->d3ddevice->recording)
wined3d_stateblock_decref(ddraw->d3ddevice->recording);
ddraw->d3ddevice->recording = NULL;
ddraw->d3ddevice->update_state = ddraw->d3ddevice->state;
if (device->recording)
wined3d_stateblock_decref(device->recording);
device->recording = NULL;
device->update_state = device->state;
wined3d_stateblock_reset(device->state);
}
wined3d_stateblock_reset(ddraw->state);
if (FAILED(hr = wined3d_device_reset(ddraw->wined3d_device,
&swapchain_desc, NULL, ddraw_reset_enum_callback, TRUE)))
@ -6786,8 +6795,11 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return hr_ddraw_from_wined3d(hr);
}
wined3d_stateblock_set_render_state(ddraw->state, WINED3D_RS_ZENABLE,
!!swapchain_desc.enable_auto_depth_stencil);
LIST_FOR_EACH_ENTRY(device, &ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
wined3d_stateblock_set_render_state(device->state, WINED3D_RS_ZENABLE,
!!swapchain_desc.enable_auto_depth_stencil);
}
}
}
@ -6838,11 +6850,19 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
{
if (!(desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE)))
{
unsigned int bind_flags = WINED3D_BIND_SHADER_RESOURCE;
unsigned int bind_flags = 0;
DWORD usage = 0;
if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
{
usage |= WINED3DUSAGE_LEGACY_CUBEMAP;
bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
}
else if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
{
bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
}
if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
bind_flags |= WINED3D_BIND_DEPTH_STENCIL;
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)

View file

@ -1523,13 +1523,8 @@ static void BackBuffer3DCreateSurfaceTest(void)
"GetSurfaceDesc returned caps %#lx.\n", created_ddsd.ddsCaps.dwCaps);
hr = IDirectDrawSurface_QueryInterface(surf, &IID_IDirect3DHALDevice, (void **)&d3dhal);
/* Currently Wine only supports the creation of one Direct3D device
for a given DirectDraw instance. It has been created already
in D3D1_createObjects() - IID_IDirect3DRGBDevice */
todo_wine ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr))
IDirect3DDevice_Release(d3dhal);
ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr);
IDirect3DDevice_Release(d3dhal);
IDirectDrawSurface_Release(surf);
}

View file

@ -4563,6 +4563,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(const GUID *device_guid)
{
DWORD fourcc_codes[64], fourcc_code_count;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
IDirect3DDevice *device;
@ -4580,6 +4581,12 @@ static void test_rt_caps(const GUID *device_guid)
sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED8 | DDPF_RGB, 0,
{8}, {0x00000000}, {0x00000000}, {0x00000000}, {0x00000000},
};
static const DDPIXELFORMAT fourcc_fmt =
{
.dwSize = sizeof(DDPIXELFORMAT),
.dwFlags = DDPF_FOURCC,
.dwFourCC = MAKEFOURCC('Y','U','Y','2'),
};
static const struct
{
@ -4710,6 +4717,12 @@ static void test_rt_caps(const GUID *device_guid)
DDERR_INVALIDCAPS,
TRUE /* Nvidia Kepler */,
},
{
&fourcc_fmt,
DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_OFFSCREENPLAIN,
DDERR_INVALIDCAPS,
FALSE,
},
};
software_device = is_software_device_type(device_guid);
@ -4737,6 +4750,10 @@ static void test_rt_caps(const GUID *device_guid)
hr = IDirectDraw_GetCaps(ddraw, &hal_caps, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
fourcc_code_count = ARRAY_SIZE(fourcc_codes);
hr = IDirectDraw4_GetFourCCCodes(ddraw, &fourcc_code_count, fourcc_codes);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
{
DWORD caps_in, expected_caps;
@ -4753,6 +4770,21 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.ddsCaps.dwCaps = caps_in;
if (test_data[i].pf)
{
if (test_data[i].pf->dwFlags & DDPF_FOURCC)
{
unsigned int j;
for (j = 0; j < fourcc_code_count; ++j)
{
if (test_data[i].pf->dwFourCC == fourcc_codes[j])
break;
}
if (j == fourcc_code_count)
{
skip("Fourcc format %#lx is not supported, skipping test.\n", test_data[i].pf->dwFourCC);
continue;
}
}
surface_desc.dwFlags |= DDSD_PIXELFORMAT;
surface_desc.ddpfPixelFormat = *test_data[i].pf;
}
@ -4761,6 +4793,11 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
surface_desc.dwZBufferBitDepth = z_depth;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if ((caps_in & DDSCAPS_VIDEOMEMORY) && !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
@ -4784,6 +4821,9 @@ static void test_rt_caps(const GUID *device_guid)
else
expected_caps = caps_in | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
if (caps_in & DDSCAPS_FLIP)
expected_caps |= DDSCAPS_FRONTBUFFER;
ok(surface_desc.ddsCaps.dwCaps == expected_caps || (test_data[i].pf == &p8_fmt
&& surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY))
|| (software_device && caps_in & DDSCAPS_ZBUFFER
@ -15530,6 +15570,109 @@ static void test_pinned_sysmem(void)
DestroyWindow(window);
}
static void test_multiple_devices(void)
{
static D3DMATRIX test_matrix =
{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 2.0f, 0.0f, 0.0f,
0.0f, 0.0f, 3.0f, 0.0f,
0.0f, 0.0f, 0.0f, 4.0f,
};
D3DTEXTUREHANDLE texture_handle, texture_handle2;
D3DMATERIALHANDLE mat_handle, mat_handle2;
IDirect3DViewport *viewport, *viewport2;
IDirect3DDevice *device, *device2;
IDirectDrawSurface *texture_surf;
D3DMATRIXHANDLE matrix_handle;
IDirectDraw *ddraw, *ddraw2;
IDirect3DMaterial *material;
DDSURFACEDESC surface_desc;
IDirect3DTexture *texture;
D3DMATRIX matrix;
ULONG refcount;
HWND window;
HRESULT hr;
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, &IID_IDirect3DHALDevice)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
ddraw2 = create_ddraw();
ok(!!ddraw2, "Failed to create a ddraw object.\n");
device2 = create_device_ex(ddraw2, window, DDSCL_NORMAL, &IID_IDirect3DHALDevice);
ok(!!device2, "got NULL.\n");
viewport = create_viewport(device, 0, 0, 640, 480);
viewport2 = create_viewport(device2, 0, 0, 640, 480);
material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f);
hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(mat_handle == mat_handle2, "got different handles.\n");
hr = IDirect3DMaterial_GetHandle(material, device2, &mat_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
todo_wine ok(mat_handle != mat_handle2, "got same handles.\n");
hr = IDirect3DViewport_SetBackground(viewport, mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DViewport_SetBackground(viewport2, mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
surface_desc.dwWidth = 256;
surface_desc.dwHeight = 256;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &texture_surf, NULL);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(texture_surf, &IID_IDirect3DTexture2, (void **)&texture);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DTexture_GetHandle(texture, device, &texture_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DTexture_GetHandle(texture, device2, &texture_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(texture_handle != texture_handle2, "got same handles.\n");
hr = IDirect3DDevice_CreateMatrix(device, &matrix_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice_SetMatrix(device, matrix_handle, &test_matrix);
ok(hr == D3D_OK, "got %#lx.\n", hr);
memset(&matrix, 0xcc, sizeof(matrix));
hr = IDirect3DDevice_GetMatrix(device2, matrix_handle, &matrix);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(!memcmp(&matrix, &test_matrix, sizeof(matrix)), "matrix does not match.\n");
IDirect3DTexture_Release(texture);
IDirectDrawSurface_Release(texture_surf);
IDirect3DMaterial_Release(material);
IDirect3DViewport_Release(viewport);
IDirect3DViewport_Release(viewport2);
refcount = IDirect3DDevice_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice_Release(device2);
ok(!refcount, "Device has %lu references left.\n", refcount);
IDirectDraw_Release(ddraw);
IDirectDraw_Release(ddraw2);
DestroyWindow(window);
}
START_TEST(ddraw1)
{
DDDEVICEIDENTIFIER identifier;
@ -15650,4 +15793,5 @@ START_TEST(ddraw1)
test_filling_convention();
test_enum_devices();
test_pinned_sysmem();
test_multiple_devices();
}

View file

@ -462,7 +462,8 @@ static IDirectDraw2 *create_ddraw(void)
return ddraw2;
}
static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWORD coop_level, const GUID *device_guid)
static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWORD coop_level, const GUID *device_guid,
IDirectDrawSurface **ret_surface)
{
/* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask
* for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports
@ -541,13 +542,17 @@ static IDirect3DDevice2 *create_device_ex(IDirectDraw2 *ddraw, HWND window, DWOR
}
IDirect3D2_Release(d3d);
IDirectDrawSurface_Release(surface);
if (ret_surface)
*ret_surface = surface;
else
IDirectDrawSurface_Release(surface);
return device;
}
static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level)
{
return create_device_ex(ddraw, window, coop_level, &IID_IDirect3DHALDevice);
return create_device_ex(ddraw, window, coop_level, &IID_IDirect3DHALDevice, NULL);
}
static IDirect3DViewport2 *create_viewport(IDirect3DDevice2 *device, UINT x, UINT y, UINT w, UINT h)
@ -1330,7 +1335,7 @@ static void test_depth_blit(const GUID *device_guid)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@ -1856,7 +1861,7 @@ static void test_zenable(const GUID *device_guid)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@ -1971,7 +1976,7 @@ static void test_ck_rgba(const GUID *device_guid)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@ -5007,6 +5012,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(const GUID *device_guid)
{
DWORD fourcc_codes[64], fourcc_code_count;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
IDirect3DDevice2 *device;
@ -5025,6 +5031,12 @@ static void test_rt_caps(const GUID *device_guid)
sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED8 | DDPF_RGB, 0,
{8}, {0x00000000}, {0x00000000}, {0x00000000}, {0x00000000},
};
static const DDPIXELFORMAT fourcc_fmt =
{
.dwSize = sizeof(DDPIXELFORMAT),
.dwFlags = DDPF_FOURCC,
.dwFourCC = MAKEFOURCC('Y','U','Y','2'),
};
static const struct
{
@ -5197,6 +5209,13 @@ static void test_rt_caps(const GUID *device_guid)
DDERR_INVALIDCAPS,
TRUE /* Nvidia Kepler */,
},
{
&fourcc_fmt,
DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_OFFSCREENPLAIN,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
},
};
software_device = is_software_device_type(device_guid);
@ -5204,7 +5223,7 @@ static void test_rt_caps(const GUID *device_guid)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
IDirectDraw2_Release(ddraw);
@ -5230,6 +5249,10 @@ static void test_rt_caps(const GUID *device_guid)
hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
fourcc_code_count = ARRAY_SIZE(fourcc_codes);
hr = IDirectDraw4_GetFourCCCodes(ddraw, &fourcc_code_count, fourcc_codes);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
{
IDirectDrawSurface *surface, *rt, *expected_rt, *tmp;
@ -5246,6 +5269,21 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.ddsCaps.dwCaps = caps_in;
if (test_data[i].pf)
{
if (test_data[i].pf->dwFlags & DDPF_FOURCC)
{
unsigned int j;
for (j = 0; j < fourcc_code_count; ++j)
{
if (test_data[i].pf->dwFourCC == fourcc_codes[j])
break;
}
if (j == fourcc_code_count)
{
skip("Fourcc format %#lx is not supported, skipping test.\n", test_data[i].pf->dwFourCC);
continue;
}
}
surface_desc.dwFlags |= DDSD_PIXELFORMAT;
surface_desc.ddpfPixelFormat = *test_data[i].pf;
}
@ -5254,6 +5292,11 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
surface_desc.dwZBufferBitDepth = z_depth;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if ((caps_in & DDSCAPS_VIDEOMEMORY) && !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
@ -5276,6 +5319,9 @@ static void test_rt_caps(const GUID *device_guid)
else
expected_caps = caps_in | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
if (caps_in & DDSCAPS_FLIP)
expected_caps |= DDSCAPS_FRONTBUFFER;
ok(surface_desc.ddsCaps.dwCaps == expected_caps || (test_data[i].pf == &p8_fmt
&& surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY))
|| (software_device && caps_in & DDSCAPS_ZBUFFER
@ -5343,6 +5389,11 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.dwFlags |= DDSD_ZBUFFERBITDEPTH;
surface_desc.dwZBufferBitDepth = z_depth;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &rt, NULL);
@ -15692,7 +15743,7 @@ static void test_texture_wrong_caps(const GUID *device_guid)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -16442,6 +16493,144 @@ static void run_for_each_device_type(void (*test_func)(const GUID *))
test_func(&IID_IDirect3DRGBDevice);
}
static void test_multiple_devices(void)
{
D3DTEXTUREHANDLE texture_handle, texture_handle2;
IDirect3DDevice2 *device, *device2, *device3;
IDirectDrawSurface *surface, *texture_surf;
D3DMATERIALHANDLE mat_handle, mat_handle2;
IDirect3DViewport2 *viewport, *viewport2;
IDirectDraw2 *ddraw, *ddraw2;
IDirect3DMaterial2 *material;
DDSURFACEDESC surface_desc;
IDirect3DTexture2 *texture;
IDirect3D2 *d3d;
ULONG refcount;
DWORD value;
HWND window;
HRESULT hr;
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
if (!(device = create_device_ex(ddraw, window, DDSCL_NORMAL, &IID_IDirect3DHALDevice, &surface)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
hr = IDirect3DDevice2_GetDirect3D(device, &d3d);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ddraw2 = create_ddraw();
ok(!!ddraw2, "Failed to create a ddraw object.\n");
device3 = create_device(ddraw2, window, DDSCL_NORMAL);
ok(!!device3, "got NULL.\n");
viewport = create_viewport(device, 0, 0, 640, 480);
viewport2 = create_viewport(device2, 0, 0, 640, 480);
hr = IDirect3DDevice2_SetCurrentViewport(device, viewport);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice2_SetCurrentViewport(device2, viewport);
ok(hr == DDERR_INVALIDPARAMS, "got %#lx.\n", hr);
hr = IDirect3DDevice2_SetCurrentViewport(device2, viewport2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f);
hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(mat_handle == mat_handle2, "got different handles.\n");
hr = IDirect3DMaterial2_GetHandle(material, device2, &mat_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
todo_wine ok(mat_handle != mat_handle2, "got same handles.\n");
hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice2_SetLightState(device2, D3DLIGHTSTATE_MATERIAL, mat_handle);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice2_SetLightState(device3, D3DLIGHTSTATE_MATERIAL, mat_handle);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle2);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport2_SetBackground(viewport, mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DViewport2_SetBackground(viewport2, mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice2_SetRenderState(device2, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice2_SetRenderState(device3, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
value = 0xdeadbeef;
hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(value == TRUE, "got %#lx.\n", value);
hr = IDirect3DDevice2_GetRenderState(device2, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(!value, "got %#lx.\n", value);
hr = IDirect3DDevice2_GetRenderState(device3, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(!value, "got %#lx.\n", value);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
surface_desc.dwWidth = 256;
surface_desc.dwHeight = 256;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &texture_surf, NULL);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirectDrawSurface_QueryInterface(texture_surf, &IID_IDirect3DTexture2, (void **)&texture);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DTexture2_GetHandle(texture, device, &texture_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DTexture2_GetHandle(texture, device2, &texture_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(texture_handle == texture_handle2, "got different handles.\n");
hr = IDirect3DTexture2_GetHandle(texture, device3, &texture_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(texture_handle == texture_handle2, "got different handles.\n");
hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice2_SetRenderState(device2, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice2_SetRenderState(device3, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
IDirect3DTexture2_Release(texture);
IDirectDrawSurface_Release(texture_surf);
IDirect3DMaterial2_Release(material);
IDirect3DViewport2_Release(viewport);
IDirect3DViewport2_Release(viewport2);
refcount = IDirect3DDevice2_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice2_Release(device2);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice2_Release(device3);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirectDrawSurface_Release(surface);
ok(!refcount, "Surface has %lu references left.\n", refcount);
IDirectDraw2_Release(ddraw);
IDirectDraw_Release(ddraw2);
IDirect3D2_Release(d3d);
DestroyWindow(window);
}
START_TEST(ddraw2)
{
DDDEVICEIDENTIFIER identifier;
@ -16567,4 +16756,5 @@ START_TEST(ddraw2)
run_for_each_device_type(test_texture_wrong_caps);
test_filling_convention();
test_enum_devices();
test_multiple_devices();
}

View file

@ -450,7 +450,8 @@ static IDirectDraw4 *create_ddraw(void)
return ddraw4;
}
static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid)
static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid,
IDirectDrawSurface4 **ret_surface)
{
IDirectDrawSurface4 *surface, *ds;
IDirect3DDevice3 *device = NULL;
@ -539,16 +540,22 @@ static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, const G
hr = IDirect3D3_CreateDevice(d3d3, device_guid, surface, &device, NULL);
IDirect3D3_Release(d3d3);
IDirectDrawSurface4_Release(surface);
if (FAILED(hr))
{
IDirectDrawSurface4_Release(surface);
return NULL;
}
if (ret_surface)
*ret_surface = surface;
else
IDirectDrawSurface4_Release(surface);
return device;
}
static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
{
return create_device_ex(window, coop_level, &IID_IDirect3DHALDevice);
return create_device_ex(window, coop_level, &IID_IDirect3DHALDevice, NULL);
}
static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UINT y, UINT w, UINT h)
@ -1506,7 +1513,7 @@ static void test_depth_blit(const GUID *device_guid)
D3DRECT d3drect;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -2101,7 +2108,7 @@ static void test_zenable(const GUID *device_guid)
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -2213,7 +2220,7 @@ static void test_ck_rgba(const GUID *device_guid)
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -6615,6 +6622,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(const GUID *device_guid)
{
DWORD fourcc_codes[64], fourcc_code_count;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
BOOL software_device;
@ -6632,6 +6640,12 @@ static void test_rt_caps(const GUID *device_guid)
sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED8 | DDPF_RGB, 0,
{8}, {0x00000000}, {0x00000000}, {0x00000000}, {0x00000000},
};
static const DDPIXELFORMAT fourcc_fmt =
{
.dwSize = sizeof(DDPIXELFORMAT),
.dwFlags = DDPF_FOURCC,
.dwFourCC = MAKEFOURCC('Y','U','Y','2'),
};
const struct
{
@ -6819,6 +6833,14 @@ static void test_rt_caps(const GUID *device_guid)
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
},
{
&fourcc_fmt,
DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_OFFSCREENPLAIN,
0,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
},
};
software_device = is_software_device_type(device_guid);
@ -6853,6 +6875,10 @@ static void test_rt_caps(const GUID *device_guid)
hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
fourcc_code_count = ARRAY_SIZE(fourcc_codes);
hr = IDirectDraw4_GetFourCCCodes(ddraw, &fourcc_code_count, fourcc_codes);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
{
IDirectDrawSurface4 *surface, *rt, *expected_rt, *tmp;
@ -6870,9 +6896,29 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.ddsCaps.dwCaps2 = test_data[i].caps2_in;
if (test_data[i].pf)
{
if (test_data[i].pf->dwFlags & DDPF_FOURCC)
{
unsigned int j;
for (j = 0; j < fourcc_code_count; ++j)
{
if (test_data[i].pf->dwFourCC == fourcc_codes[j])
break;
}
if (j == fourcc_code_count)
{
skip("Fourcc format %#lx is not supported, skipping test.\n", test_data[i].pf->dwFourCC);
continue;
}
}
surface_desc.dwFlags |= DDSD_PIXELFORMAT;
surface_desc.ddpfPixelFormat = *test_data[i].pf;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if ((caps_in & DDSCAPS_VIDEOMEMORY) && !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
@ -6898,6 +6944,9 @@ static void test_rt_caps(const GUID *device_guid)
else
expected_caps = caps_in | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
if (caps_in & DDSCAPS_FLIP)
expected_caps |= DDSCAPS_FRONTBUFFER;
ok(surface_desc.ddsCaps.dwCaps == expected_caps || (test_data[i].pf == &p8_fmt
&& surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY))
|| (software_device && test_data[i].pf == &z_fmt
@ -6962,6 +7011,11 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.dwFlags |= DDSD_PIXELFORMAT;
surface_desc.ddpfPixelFormat = *test_data[i].pf;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &rt, NULL);
@ -18750,7 +18804,7 @@ static void test_texture_wrong_caps(const GUID *device_guid)
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -19506,6 +19560,109 @@ static void test_enum_devices(void)
ok(!refcount, "Device has %lu references left.\n", refcount);
}
static void test_multiple_devices(void)
{
IDirect3DDevice3 *device, *device2, *device3;
D3DMATERIALHANDLE mat_handle, mat_handle2;
IDirect3DViewport3 *viewport, *viewport2;
IDirect3DMaterial3 *material;
IDirectDrawSurface4 *surface;
IDirectDraw4 *ddraw;
IDirect3D3 *d3d;
ULONG refcount;
DWORD value;
HWND window;
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, &IID_IDirect3DHALDevice, &surface)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
hr = IDirect3DDevice3_GetDirect3D(device, &d3d);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device2, NULL);
ok(hr == D3D_OK, "got %#lx.\n", hr);
device3 = create_device(window, DDSCL_NORMAL);
ok(!!device3, "got NULL.\n");
viewport = create_viewport(device, 0, 0, 640, 480);
viewport2 = create_viewport(device2, 0, 0, 640, 480);
hr = IDirect3DDevice3_SetCurrentViewport(device, viewport);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice3_SetCurrentViewport(device2, viewport);
ok(hr == DDERR_INVALIDPARAMS, "got %#lx.\n", hr);
hr = IDirect3DDevice3_SetCurrentViewport(device2, viewport2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f);
hr = IDirect3DMaterial3_GetHandle(material, device, &mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DMaterial3_GetHandle(material, device, &mat_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
ok(mat_handle == mat_handle2, "got different handles.\n");
hr = IDirect3DMaterial3_GetHandle(material, device2, &mat_handle2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
todo_wine ok(mat_handle != mat_handle2, "got same handles.\n");
hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetLightState(device2, D3DLIGHTSTATE_MATERIAL, mat_handle);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetLightState(device3, D3DLIGHTSTATE_MATERIAL, mat_handle);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle2);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DViewport3_SetBackground(viewport, mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DViewport3_SetBackground(viewport2, mat_handle);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device2, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device3, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
value = 0xdeadbeef;
hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(value == TRUE, "got %#lx.\n", value);
hr = IDirect3DDevice3_GetRenderState(device2, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(!value, "got %#lx.\n", value);
hr = IDirect3DDevice3_GetRenderState(device3, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(!value, "got %#lx.\n", value);
IDirect3DMaterial3_Release(material);
IDirect3DViewport3_Release(viewport);
IDirect3DViewport3_Release(viewport2);
refcount = IDirect3DDevice3_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice3_Release(device2);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice3_Release(device3);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirectDrawSurface4_Release(surface);
ok(!refcount, "Surface has %lu references left.\n", refcount);
IDirectDraw4_Release(ddraw);
IDirect3D3_Release(d3d);
DestroyWindow(window);
}
START_TEST(ddraw4)
{
DDDEVICEIDENTIFIER identifier;
@ -19647,4 +19804,5 @@ START_TEST(ddraw4)
run_for_each_device_type(test_texture_wrong_caps);
test_filling_convention();
test_enum_devices();
test_multiple_devices();
}

View file

@ -498,7 +498,8 @@ static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7
return DDENUMRET_OK;
}
static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid)
static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const GUID *device_guid,
IDirectDrawSurface7 **ret_surface)
{
IDirectDrawSurface7 *surface, *ds;
IDirect3DDevice7 *device = NULL;
@ -586,9 +587,16 @@ static IDirect3DDevice7 *create_device_ex(HWND window, DWORD coop_level, const G
hr = IDirect3D7_CreateDevice(d3d7, device_guid, surface, &device);
IDirect3D7_Release(d3d7);
IDirectDrawSurface7_Release(surface);
if (FAILED(hr))
{
IDirectDrawSurface7_Release(surface);
return NULL;
}
if (ret_surface)
*ret_surface = surface;
else
IDirectDrawSurface7_Release(surface);
return device;
}
@ -615,7 +623,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
IDirect3D7_Release(d3d7);
return create_device_ex(window, coop_level, device_guid);
return create_device_ex(window, coop_level, device_guid, NULL);
}
static bool init_3d_test_context_guid(struct ddraw_test_context *context, const GUID *device_guid)
@ -625,7 +633,7 @@ static bool init_3d_test_context_guid(struct ddraw_test_context *context, const
memset(context, 0, sizeof(*context));
context->window = create_window();
if (!(context->device = create_device_ex(context->window, DDSCL_NORMAL, device_guid)))
if (!(context->device = create_device_ex(context->window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a D3D device.\n");
DestroyWindow(context->window);
@ -1586,7 +1594,7 @@ static void test_depth_blit(const GUID *device_guid)
HWND window;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -1844,7 +1852,7 @@ static void test_zenable(const GUID *device_guid)
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -1948,7 +1956,7 @@ static void test_ck_rgba(const GUID *device_guid)
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -6468,6 +6476,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(const GUID *device_guid)
{
DWORD fourcc_codes[64], fourcc_code_count;
PALETTEENTRY palette_entries[256];
IDirectDrawPalette *palette;
BOOL software_device;
@ -6485,6 +6494,12 @@ static void test_rt_caps(const GUID *device_guid)
sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED8 | DDPF_RGB, 0,
{8}, {0x00000000}, {0x00000000}, {0x00000000}, {0x00000000},
};
static const DDPIXELFORMAT fourcc_fmt =
{
.dwSize = sizeof(DDPIXELFORMAT),
.dwFlags = DDPF_FOURCC,
.dwFourCC = MAKEFOURCC('Y','U','Y','2'),
};
const struct
{
@ -6672,6 +6687,14 @@ static void test_rt_caps(const GUID *device_guid)
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
},
{
&fourcc_fmt,
DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_OFFSCREENPLAIN,
0,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
DDERR_INVALIDCAPS,
},
};
software_device = is_software_device_type(device_guid);
@ -6706,6 +6729,10 @@ static void test_rt_caps(const GUID *device_guid)
hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
fourcc_code_count = ARRAY_SIZE(fourcc_codes);
hr = IDirectDraw4_GetFourCCCodes(ddraw, &fourcc_code_count, fourcc_codes);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
{
IDirectDrawSurface7 *surface, *rt, *expected_rt, *tmp;
@ -6723,9 +6750,29 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.ddsCaps.dwCaps2 = test_data[i].caps2_in;
if (test_data[i].pf)
{
if (test_data[i].pf->dwFlags & DDPF_FOURCC)
{
unsigned int j;
for (j = 0; j < fourcc_code_count; ++j)
{
if (test_data[i].pf->dwFourCC == fourcc_codes[j])
break;
}
if (j == fourcc_code_count)
{
skip("Fourcc format %#lx is not supported, skipping test.\n", test_data[i].pf->dwFourCC);
continue;
}
}
surface_desc.dwFlags |= DDSD_PIXELFORMAT;
surface_desc.ddpfPixelFormat = *test_data[i].pf;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
if ((caps_in & DDSCAPS_VIDEOMEMORY) && !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
@ -6751,6 +6798,9 @@ static void test_rt_caps(const GUID *device_guid)
else
expected_caps = caps_in | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
if (caps_in & DDSCAPS_FLIP)
expected_caps |= DDSCAPS_FRONTBUFFER;
ok(surface_desc.ddsCaps.dwCaps == expected_caps || (test_data[i].pf == &p8_fmt
&& surface_desc.ddsCaps.dwCaps == (caps_in | DDSCAPS_SYSTEMMEMORY))
|| (software_device && test_data[i].pf == &z_fmt
@ -6810,6 +6860,11 @@ static void test_rt_caps(const GUID *device_guid)
surface_desc.dwFlags |= DDSD_PIXELFORMAT;
surface_desc.ddpfPixelFormat = *test_data[i].pf;
}
if (caps_in & DDSCAPS_FLIP)
{
surface_desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
surface_desc.dwBackBufferCount = 1;
}
surface_desc.dwWidth = 640;
surface_desc.dwHeight = 480;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &rt, NULL);
@ -19134,7 +19189,7 @@ static void test_texture_wrong_caps(const GUID *device_guid)
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid)))
if (!(device = create_device_ex(window, DDSCL_NORMAL, device_guid, NULL)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
@ -20001,6 +20056,69 @@ static void run_for_each_device_type(void (*test_func)(const GUID *))
winetest_pop_context();
}
static void test_multiple_devices(void)
{
IDirect3DDevice7 *device, *device2;
IDirectDrawSurface7 *surface;
IDirectDraw7 *ddraw;
IDirect3D7 *d3d;
ULONG refcount;
DWORD stateblock;
DWORD value;
HWND window;
HRESULT hr;
window = create_window();
if (!(device = create_device_ex(window, DDSCL_NORMAL, &IID_IDirect3DTnLHalDevice, &surface)))
{
skip("Failed to create a 3D device, skipping test.\n");
DestroyWindow(window);
return;
}
hr = IDirect3DDevice7_GetDirect3D(device, &d3d);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3D7_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device2);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice7_CreateStateBlock(device, D3DSBT_ALL, &stateblock);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice7_CaptureStateBlock(device2, stateblock);
ok(hr == D3DERR_INVALIDSTATEBLOCK, "got %#lx.\n", hr);
hr = IDirect3DDevice7_CaptureStateBlock(device, stateblock);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice7_DeleteStateBlock(device, stateblock);
ok(hr == D3D_OK, "got %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device2, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
value = 0xdeadbeef;
hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(value == TRUE, "got %#lx.\n", value);
hr = IDirect3DDevice3_GetRenderState(device2, D3DRENDERSTATE_ALPHABLENDENABLE, &value);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(!value, "got %#lx.\n", value);
refcount = IDirect3DDevice3_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirect3DDevice3_Release(device2);
ok(!refcount, "Device has %lu references left.\n", refcount);
refcount = IDirectDrawSurface4_Release(surface);
ok(!refcount, "Surface has %lu references left.\n", refcount);
IDirectDraw4_Release(ddraw);
IDirect3D3_Release(d3d);
DestroyWindow(window);
}
START_TEST(ddraw7)
{
DDDEVICEIDENTIFIER2 identifier;
@ -20176,4 +20294,5 @@ START_TEST(ddraw7)
test_enum_devices();
run_for_each_device_type(test_user_memory);
test_flip_3d();
test_multiple_devices();
}

View file

@ -75,6 +75,7 @@ static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
{
struct d3d_vertex_buffer *buffer = impl_from_IDirect3DVertexBuffer7(iface);
ULONG ref = InterlockedDecrement(&buffer->ref);
struct d3d_device *device;
TRACE("%p decreasing refcount to %lu.\n", buffer, ref);
@ -85,8 +86,12 @@ static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
* stream source in wined3d and they should get unset there before
* they are destroyed. */
wined3d_mutex_lock();
if (buffer->ddraw->stateblock_state->streams[0].buffer == buffer->wined3d_buffer)
wined3d_stateblock_set_stream_source(buffer->ddraw->state, 0, NULL, 0, 0);
LIST_FOR_EACH_ENTRY(device, &buffer->ddraw->d3ddevice_list, struct d3d_device, ddraw_entry)
{
if (device->stateblock_state->streams[0].buffer == buffer->wined3d_buffer)
wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0);
}
wined3d_vertex_declaration_decref(buffer->wined3d_declaration);
wined3d_buffer_decref(buffer->wined3d_buffer);

Some files were not shown because too many files have changed in this diff Show more