Compare commits

...

145 Commits

Author SHA1 Message Date
Sebastian Lackner
154a80f8be Release 2.10-3 (macOS preloader fixes). 2017-06-18 18:21:12 +02:00
Sebastian Lackner
dfdeb2e61a loader-OSX_Preloader: Add PAGEZERO section for wine-preloader executable.
For wine64-preloader we already do that, but apparently there are also kernel
versions which enforce a PAGEZERO section for 32-bit executables.

(cherry picked from commit 907dc4eae6)
2017-06-17 21:03:13 +02:00
Sebastian Lackner
abb1f3201c Release 2.10-2 (macOS preloader fixes). 2017-06-16 00:50:52 +02:00
Sebastian Lackner
0ef6e01258 loader-OSX_Preloader: Fall back to MAP_FIXED if address hint is ignored.
This should get rid of preloader warnings on old versions of macOS.
Thanks to Gijs Vermeulen for help with debugging and testing this patch.

Ideally, we would like to use vm_allocate, but since the preloader runs
very early during the startup of the process, we don't have all required
libc functions available. Also, we don't want to reimplement it ourself,
which would be very unreliable in practice.

For now, lets just use mincore() to check if there are any other pages
mapped within the area, and then fallback to MAP_FIXED.

(cherry picked from commit f254a73e66)
2017-06-15 18:52:12 +02:00
Sebastian Lackner
256e818da5 loader-OSX_Preloader: Temporarily map address ranges needed for Wine builtin DLLs.
(cherry picked from commit 463f2b02c9)
2017-06-15 05:31:20 +02:00
Sebastian Lackner
bc32032f02 loader-OSX_Preloader: Allocate pagezero for main wine binary.
This change should fix compatibility with old versions of macOS.
Thanks to Gijs Vermeulen for help with debugging and testing this patch.

Old versions of libsystem_c.dylib crash while running initializers when
the application does not contain a PAGEZERO section. This is probably
caused by an incorrect comparison against NULL instead of (void *)-1.

Unfortunately, when we just add a PAGEZERO section, we trigger the next
bug - no matter if we actually use the page at address (void *)0 or not,
it will not be used because the relocation code tries to find a memory
hole of size (highAddr - lowAddr) ~ 2GB.

We might be able to workaround this issue by manually reordering the
sections in the main executable, but for now lets just drop the fixed
image base. Please note that this introduces a risk of conflicts with
builtin DLLs, which will be resolved in the next patch.

(cherry picked from commit e9daff5bc8)
2017-06-15 05:31:05 +02:00
Sebastian Lackner
199b98a78b patchinstall.sh: Add workaround for mktemp on macOS <= 10.10.
(cherry picked from commit ecdf44fe29)
2017-06-15 05:30:50 +02:00
Sebastian Lackner
c0525850fc patchinstall.sh: Do not use 'readlink -f' to improve compatibility with macOS.
(cherry picked from commit 3a7c5ae711)
2017-06-15 05:30:33 +02:00
Sebastian Lackner
d4aa71ae9d loader-OSX_Preloader: Fix compile error with old SDK versions.
(cherry picked from commit 3fab2fbed2)
2017-06-15 05:30:13 +02:00
Sebastian Lackner
ce25cba7d0 Release 2.10. 2017-06-13 11:16:10 +02:00
Sebastian Lackner
d7712b4819 advapi32-Performance_Counters: Fix a handle leak (thanks Dmitry). 2017-06-13 10:32:55 +02:00
Sebastian Lackner
3c5f207230 Added patch to implement support for querying performance counters data. 2017-06-13 02:12:34 +02:00
Sebastian Lackner
af8052189f Added revert of patch which assumes a 1-to-1 axes mapping when no axes match. 2017-06-12 20:10:02 +02:00
Sebastian Lackner
22731b5aaa Added patch to fix handling of cursor position clipping. 2017-06-12 19:38:36 +02:00
Sebastian Lackner
7c8ec26efc ntdll-User_Shared_Data: Update patchset. 2017-06-12 17:01:33 +02:00
Sebastian Lackner
fbd1870547 dxdiagn-Display_Information: Add reference to additional bug report. 2017-06-12 16:51:31 +02:00
Sebastian Lackner
05a45207e2 server-Debug_Registers: Add reference to bug report. 2017-06-12 16:49:51 +02:00
Sebastian Lackner
ee5545a45f Added patch to fix holes in ELF mappings. 2017-06-12 16:45:10 +02:00
Sebastian Lackner
8881e4710a Added patch to prevent a possible nullpointer dereference in comctl32 tests. 2017-06-12 03:34:50 +02:00
Sebastian Lackner
0c5e30ba40 Compiler_Warnings: Update patchset. 2017-06-12 03:34:50 +02:00
Sebastian Lackner
c2c1e41e3c Added patch to expand environment strings in ShellExecute. 2017-06-12 03:34:50 +02:00
Sebastian Lackner
645ed054f2 Added patch to return MSIDBSTATE_ERROR when MsiGetDatabaseState is called from a custom action. 2017-06-12 03:34:38 +02:00
Sebastian Lackner
b5d451ae12 Added patch to implement preloader for Mac OS. 2017-06-12 00:50:05 +02:00
Sebastian Lackner
5392d42292 Added patches to fix two minor issues related to linked lists. 2017-06-11 02:46:31 +02:00
Sebastian Lackner
05f510a1be Added patch to simulate a more realistic kernel environment in ntoskrnl/winedevice. 2017-06-10 20:24:36 +02:00
Sebastian Lackner
630ff35489 Added patches to implement NtBuildNumber and ExInitializeNPagedLookasideList. 2017-06-10 16:35:54 +02:00
Sebastian Lackner
25e345194d Rebase against e0e4f9bbcda1243b9317dbfbeeff84a18b4e855c. 2017-06-10 00:47:39 +02:00
Sebastian Lackner
38cdf5d3f4 gdi32-Symbol_Truetype_Font: Update definition file. 2017-06-06 10:51:49 +02:00
Sebastian Lackner
d0ac86031a Rebase against e4c9a2ec81b8029876d588e09587db40ab65ee69. 2017-06-06 10:12:28 +02:00
Sebastian Lackner
6ca029a4f6 Rebase against e5733e7cd40b41bb4d8c0409e9ed5be8fe6d5618. 2017-06-05 13:00:54 +02:00
Sebastian Lackner
5d672b2839 Rebase against 6c752aaf8da225365b2bdbbf3c43d41afd4d1344. 2017-06-05 11:03:20 +02:00
Sebastian Lackner
e61bbfd48a Added patch to avoid conversion from unaligned pointer to M128A. 2017-06-04 23:24:22 +02:00
Sebastian Lackner
f5671acfdd Rebase against 1fbb661ed1745bdfdcd1287c730f63503ee3f13f.
This also merges several improvements to avoid compiler warnings with GCC 7.

FIXME: There seems to be a regression (random crashes) during prefix shutdown,
       needs further debugging.
2017-06-04 23:14:03 +02:00
Sebastian Lackner
ac2c2ffdb8 Rebase against 06eceb3af2d56f158dab2db5a7bc768cc2b1c391. 2017-05-31 07:06:29 +02:00
Sebastian Lackner
907f73aa4b Release 2.9. 2017-05-29 15:54:33 +02:00
Sebastian Lackner
76c2635a7a user32-Mouse_Message_Hwnd: Add back a missing return statement (thanks Dmitry). 2017-05-29 12:25:31 +02:00
Sebastian Lackner
5d31795ffc Added patch to implement support for layered window regions. 2017-05-29 08:46:07 +02:00
Sebastian Lackner
5cc0023094 wine.inf-Performance: Add 'Counters' to the perflib key as an alias for 'Counter'. 2017-05-29 03:40:40 +02:00
Sebastian Lackner
6e372d0550 Added patch to handle /dontskip parameter in dxdiag. 2017-05-29 01:12:35 +02:00
Sebastian Lackner
4d5cc8b76f Added patch to check for 'Brian Paul' to detect Mesa gl_vendor. 2017-05-28 23:34:20 +02:00
Sebastian Lackner
d7d4fde17e winebuild-Fake_Dlls: Do not use get_alignment for .balign instructions.
Spotted by Michael MĂĽller.
2017-05-28 21:52:48 +02:00
Sebastian Lackner
033c4b149f ntdll-NtQueryVirtualMemory: Skip get_dll_info wineserver call if address does not have VPROT_IMAGE permissions. 2017-05-28 16:16:15 +02:00
Sebastian Lackner
f957d2a812 Added patches to silence two noisy d3d11 FIXMEs. 2017-05-28 15:56:46 +02:00
Sebastian Lackner
7e80ff15e2 wined3d-QUERY_Stubs: Update patchset and add implementation for WINED3D_QUERY_TYPE_PIPELINE_STATISTICS. 2017-05-28 15:56:45 +02:00
Sebastian Lackner
43973275f2 ntdll-NtQueryVirtualMemory: Update patchset and return proper Nt paths. 2017-05-28 15:55:40 +02:00
Sebastian Lackner
70d09b1977 Added patch to implement opening files through nt device paths. 2017-05-27 18:47:06 +02:00
Sebastian Lackner
527b456839 ntoskrnl-Stubs: Remove some invalid Fixes lines. 2017-05-27 18:20:53 +02:00
Sebastian Lackner
cf4e195b49 Added patch to implement ntoskrnl.ExInterlockedPopEntrySList. 2017-05-27 18:02:35 +02:00
Sebastian Lackner
b7f1c682f3 Added patch to fix crash when a device driver segfaults during an open file request. 2017-05-27 17:46:03 +02:00
Sebastian Lackner
1a5a9b3087 gdi32-MultiMonitor: Update patchset and return more reasonable display DeviceID. 2017-05-27 04:23:12 +02:00
Sebastian Lackner
e5fb1dda8d Added patch to pass correct index to shader_glsl_ffp_vertex_lighting_footer. 2017-05-27 03:25:08 +02:00
Sebastian Lackner
27d1ed8f59 winebuild-Fake_Dlls: Use .balign instead of .fill.
Also remove the ntdll-Interrupt-0x2e dependency, which is no longer necessary.
2017-05-26 10:07:56 +02:00
Sebastian Lackner
857e9c1cd4 Rebase against 799230c78ab102fa0034cb4477ce1be78c456a87. 2017-05-26 04:26:33 +02:00
Sebastian Lackner
0a60add605 winebuild-Fake_Dlls: Merge several further improvements. 2017-05-25 21:59:41 +02:00
Sebastian Lackner
d36701371e Added patch with stub for ntdll.NtContinue. 2017-05-25 05:57:44 +02:00
Sebastian Lackner
b2904214bb winebuild-Fake_Dlls: Added patch to fix relocation information in fake dlls. 2017-05-25 05:52:41 +02:00
Michael MĂĽller
871cee39d0 winebuild-Fake_Dlls: Fill alignment with zero bytes. 2017-05-25 05:52:41 +02:00
Sebastian Lackner
0c46d1e8a2 Rebase against 8967e87c8a890aed7a81051c2d372f065e825bb2. 2017-05-25 03:05:27 +02:00
Sebastian Lackner
91f6a8ad80 Rebase against ef267f115f76a3041e0da4a0f0dbd7ffb4a022e1. 2017-05-25 01:24:35 +02:00
Sebastian Lackner
8b1d3d07ab Rebase against b8a8e1bde9382897927945ec0b58b8a2fcfcfe59. 2017-05-24 23:55:00 +02:00
Sebastian Lackner
2ca6aebfaa Rebase against 3f01ab4c39ffa50e26916a5f33d82dec1a2e42dc. 2017-05-20 00:45:45 +02:00
Sebastian Lackner
81571a4cb5 Rebase against 53bf72e266532f2f0533a0dfd7e90a25d7b6d901. 2017-05-19 22:31:19 +02:00
Sebastian Lackner
51dc575ef3 Rebase against 9baceabb88e2aeb90a32bb5f6923107904ed58ea. 2017-05-18 05:32:56 +02:00
Sebastian Lackner
73573b1dff kernel32-MoveFile: Fix a regression when copying addon to cache directory. 2017-05-17 16:45:13 +02:00
Sebastian Lackner
142cc2eda5 Rebase against 66c7b37a9819195d40f5ab053268548c4370fb06. 2017-05-17 01:00:41 +02:00
Sebastian Lackner
ebabcd69b5 Rebase against be12c5bc4f189901541fdca41da267f8a0ef873d. 2017-05-16 23:01:26 +02:00
Sebastian Lackner
20d1f21514 Release 2.8. 2017-05-16 14:17:16 +02:00
Sebastian Lackner
7ad2ee4c60 winebuild-Fake_Dlls: Avoid conflict with 16-bit code. 2017-05-16 04:52:55 +02:00
Sebastian Lackner
d00088e0fa winebuild-Fake_Dlls: Try to fix build failure on OSX. 2017-05-16 03:25:43 +02:00
Sebastian Lackner
633cceca94 user32-GetAutoRotationState: Remove definition file. 2017-05-16 01:31:39 +02:00
Sebastian Lackner
46006c692a Rename windowscodecs-Metadata -> windowscodecs-MetadataQueryParser. 2017-05-16 00:26:55 +02:00
Sebastian Lackner
d56994dbfa Added patches with multiple improvements for propsys functions. 2017-05-16 00:22:58 +02:00
Sebastian Lackner
5e70613512 Added patch to implement a basic security property tab. 2017-05-15 22:51:33 +02:00
Sebastian Lackner
6a14f80fdc Added patch with various improvements for fake dlls. 2017-05-15 21:07:42 +02:00
Sebastian Lackner
5d38a0fed0 ntdll-User_Shared_Data: Fix test failures on WinXP. 2017-05-14 00:48:30 +02:00
Sebastian Lackner
8748402001 Rebase against 4eaaf06ce4e5d7424eec2cf303c8256610544b39. 2017-05-13 01:14:10 +02:00
Sebastian Lackner
171d05fffe wined3d-CSMT_Main: Get rid of unnecessary wait. 2017-05-12 03:47:26 +02:00
Sebastian Lackner
975205155e Rebase against b77688102a84e1c7b7278340c46f53db3e1cda00. 2017-05-12 00:36:30 +02:00
Sebastian Lackner
d6c145fbf5 server-Debug_Registers: Remove bug reference.
The issue is mentioned in bug 32515, but Steam cache
validation still fails with this patch applied.
2017-05-11 03:36:48 +02:00
Sebastian Lackner
3207980517 Rebase against 0647abc5071913506e681bfc5239f9a6078dca54. 2017-05-11 01:46:17 +02:00
Sebastian Lackner
1bbe50aae8 Rebase against 8ef79b023a06f00ca6ab37afb8089d358b277d73. 2017-05-10 03:29:09 +02:00
Sebastian Lackner
bb180d38cc d3d11-Deferred_Context: Merge two patches. 2017-05-09 19:55:51 +02:00
Sebastian Lackner
c542f2432d Rebase against b6a4b2f593503a105dde01e7bd11ffdde243117a. 2017-05-09 05:33:36 +02:00
Sebastian Lackner
a36a97233a wined3d-CSMT_Main: Merge two patches. 2017-05-08 13:07:44 +02:00
Sebastian Lackner
f8e955a95a ntdll-User_Shared_Data: Add a missing CDECL. 2017-05-06 20:14:20 +02:00
Sebastian Lackner
d966bece72 Added patch to implement some additional windowscodecs metadata functions. 2017-05-06 17:04:02 +02:00
Sebastian Lackner
1447b56eeb Added patch to reset debug registers when creating threads. 2017-05-06 02:13:58 +02:00
Sebastian Lackner
afe018692b Added patch to fix some test failures in d3dx9_36/math tests. 2017-05-06 02:08:18 +02:00
Sebastian Lackner
52b5c90303 Rebase against 9f55292085392579568ff81b8adb926b32a8d99a. 2017-05-06 02:06:45 +02:00
Sebastian Lackner
4a4ebec642 dxva2-Video_Decoder: Remove dependency on winecfg-Staging patchset. 2017-05-05 20:34:33 +02:00
Sebastian Lackner
35ea3890a7 Add a separate script to plot patchset dependency graph. 2017-05-05 20:33:54 +02:00
Sebastian Lackner
26438ad74c Added patch to update user_shared_data timers. 2017-05-05 13:37:34 +02:00
Sebastian Lackner
31212d2845 Rebase against 10db51d5c26f0a71956989ecff83da90f4d94fda. 2017-05-05 02:26:52 +02:00
Sebastian Lackner
a08b6b2b62 Added patch for initial implementation of advapi32.BuildSecurityDescriptorW. 2017-05-05 00:25:14 +02:00
Sebastian Lackner
9985fe9035 Added patch to implement TokenIntegrityLevel stub in NtSetInformationToken. 2017-05-04 21:31:38 +02:00
Sebastian Lackner
3aa965e97f Added patch to implement TokenLogonSid stub in NtQueryInformationToken. 2017-05-04 21:27:41 +02:00
Sebastian Lackner
2e479e0954 Added patch to implement semi-stub for ntdll.NtCreateThreadEx. 2017-05-04 21:24:17 +02:00
Sebastian Lackner
9fe12a2175 Added patch to avoid crash if context_reacquire is called with NULL context. 2017-05-04 02:56:03 +02:00
Sebastian Lackner
d7c0a975ea Rebase against 8753a1b271795d2f977b41a814de7e4ace780d2e. 2017-05-04 02:13:14 +02:00
Sebastian Lackner
eb4a245bbb Rebase against b1203af6ba44ff8858ee9ca50fc05f4f3f633892. 2017-05-03 05:45:47 +02:00
Sebastian Lackner
5282f297be bcrypt-Improvements: Fix BCryptEncrypt with AES_GCM and no input and no output. 2017-05-02 18:36:51 +02:00
Sebastian Lackner
1446da2c50 fonts-Tahoma: Regenerate tahoma.ttf with ancient fontconfig.
To keep the changes small and to ensure the resulting TTF file
is better compatible with Windows.
2017-05-02 18:36:25 +02:00
Sebastian Lackner
2db34eca39 Rebase against 7cd7f14696dc3fb7aa41ef253ad144d458304a28. 2017-05-02 12:57:50 +02:00
Sebastian Lackner
d80c4a83fd Release 2.7. 2017-05-02 04:51:49 +02:00
Sebastian Lackner
0c62a31ae7 Added patch for U+FB01 and U+FB02 glyphs in Tahoma font. 2017-05-02 03:19:58 +02:00
Sebastian Lackner
6acc999e64 windowscodecs-TIFF_Support: Fix pixel format descriptors. 2017-05-02 02:22:42 +02:00
Sebastian Lackner
e0ec571af4 dmusic-SynthPort_IKsControl: Remote a Fixes line. 2017-05-02 01:27:48 +02:00
Sebastian Lackner
2c4db4ada1 Added patch to fix Param2 in SPFILENOTIFY_FILEINCABINET handler. 2017-05-02 01:26:37 +02:00
Sebastian Lackner
46bcbf913f Added patch to fix test failure in dmloader tests. 2017-05-01 19:50:27 +02:00
Sebastian Lackner
1d7d9cf626 kernel32-Locale_Definitions: Disable patchset which causes a test failure. 2017-05-01 18:34:32 +02:00
Sebastian Lackner
4e8721c714 ntdll-ProcessImageFileNameWin32: Fix test failures. 2017-05-01 18:20:51 +02:00
Sebastian Lackner
affad837a0 Rebase against 07cf14dc928a1a00baecbbc7ca5a6f3fe680238c. 2017-04-28 23:28:40 +02:00
Sebastian Lackner
c00520d3f8 Added patch to fix handling of ShowWindow when window is already visible. 2017-04-28 15:30:12 +02:00
Sebastian Lackner
bf3ff21ed7 Rebase against ae600c0b2c5b63d0c32a19f44629c204d1a0fc51. 2017-04-28 04:10:08 +02:00
Sebastian Lackner
18b192b7bd kernel32-Named_Pipe: Comment Fixes lines. 2017-04-27 01:26:18 +02:00
Sebastian Lackner
d3c3d2ab96 Rebase against 6f99cf01e1b88c9bb09fe6b9bff3443514db5ae2. 2017-04-27 01:22:20 +02:00
Sebastian Lackner
229bb38973 Rebase against 89ef7b59f548a76960b2278d819a8f915c81e132. 2017-04-26 04:01:25 +02:00
Sebastian Lackner
af6b4ace35 Rebase against e49feb63f489141c08a967a9c47930559e1de4f7. 2017-04-25 03:08:33 +02:00
Sebastian Lackner
e3e7950f4f kernel32-SetFileInformationByHandle: Remove patch with unnecessary include file change. 2017-04-24 16:50:23 +02:00
Sebastian Lackner
b6c2991af1 iexplore-Revert_ProductVersion: Remove deprecated patchset. 2017-04-24 16:31:33 +02:00
Sebastian Lackner
447795d20e wined3d-Revert_Pixel_Center_Offset: Remove deprecated patchset. 2017-04-24 02:27:04 +02:00
Sebastian Lackner
8fd38e80cd ntdll-Virtual_Memory_Stack: Delete disabled patchset. 2017-04-24 00:37:49 +02:00
Sebastian Lackner
7492968519 ntdll-Syscall_Wrappers: Delete disabled patchset. 2017-04-24 00:36:03 +02:00
Sebastian Lackner
c0304d7976 Exagear: Delete disabled patchset. 2017-04-24 00:18:25 +02:00
Sebastian Lackner
075da187c7 Rebase against cced5dfbde8b685022dd74e666f8ad4ea8473453. 2017-04-22 14:57:30 +02:00
Sebastian Lackner
89777bdb23 Rebase against 6c7760f2175e241b330cde0a902c96d9007922e0. 2017-04-21 13:20:03 +02:00
Sebastian Lackner
bd070a400c Rebase against f7402accc40b66140be4d27c5ad1b2fee8532dfc. 2017-04-20 02:16:00 +02:00
Sebastian Lackner
a65b6fa780 Release 2.6. 2017-04-19 10:54:39 +02:00
Sebastian Lackner
92bc06bd9e winecfg-Unmounted_Devices: Fix another compile issue on OSX. 2017-04-19 04:48:29 +02:00
Sebastian Lackner
2b4120187b Compiler_Warnings: Fix compililation error on OSX. 2017-04-19 04:04:24 +02:00
Sebastian Lackner
5dcd52a67f wined3d-CSMT_Main: Reenable patchset. 2017-04-19 01:34:24 +02:00
Sebastian Lackner
10837badd4 wined3d-Accounting: Do not use context on the main thread. 2017-04-17 00:43:21 +02:00
Sebastian Lackner
c9b2336f64 Added patch to implement support for recent OSMesa versions. 2017-04-16 19:19:34 +02:00
Sebastian Lackner
a06d982751 winecfg-Unmounted_Devices: Avoid access violation when autodetecting devices in winecfg. 2017-04-16 17:54:19 +02:00
Sebastian Lackner
e963b417b3 Added patches to fix error handling issues in wined3d. 2017-04-14 17:46:52 +02:00
Sebastian Lackner
079da46f96 Added patch to fix compilation with recent versions of gcc. 2017-04-14 16:02:12 +02:00
Sebastian Lackner
3003efacdb Rebase against 709935314458bd0ce27aab3986ae98cc556cb663. 2017-04-14 15:28:19 +02:00
Sebastian Lackner
14acf51a2d Rebase against aa1580398e4c9eda851d475213e07d865d9238bd. 2017-04-13 11:52:28 +02:00
Sebastian Lackner
830a8b9975 Rebase against d6557e812984e010a989a3360039453eb978bd12. 2017-04-13 11:06:17 +02:00
Sebastian Lackner
4a75337774 Rebase against 9e35dd15454be28c487b0f1bebefbbe530b2aca4. 2017-04-12 09:52:27 +02:00
Sebastian Lackner
b113596b6c Rebase against 692656467729c5548c45244aa05ca946620afa72. 2017-04-12 07:03:43 +02:00
Sebastian Lackner
e5d2247213 Rebase against 61a1a266faa9fa7c959136b0ab0b5d7e01326878. 2017-04-11 05:15:20 +02:00
Sebastian Lackner
fbc61357d3 Rebase against 0128e1a18f25848e6f47146580a8f0db69687dd6. 2017-04-10 22:39:05 +02:00
Sebastian Lackner
d06996cabd Rebase against 35ca862025fa14065d4ebed761783de225cb6690. 2017-04-10 18:41:57 +02:00
Sebastian Lackner
e4ac3ea735 Rebase against 8b1737c0fdf1d3d905bea281d9241f1f48f333e9. 2017-04-10 07:36:39 +02:00
286 changed files with 16167 additions and 16052 deletions

View File

@@ -0,0 +1,26 @@
From 43628d9b1905396ff6442e4f1e07c9dd48739b19 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 14 Apr 2017 15:57:18 +0200
Subject: ole32: Fix compilation with recent versions of gcc.
---
dlls/ole32/storage32.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index 4fcfd9c362..2b23ab8eb8 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -526,6 +526,9 @@ StgStreamImpl* StgStreamImpl_Construct(
/******************************************************************************
* Endian conversion macros
*/
+#undef htole32
+#undef htole16
+
#ifdef WORDS_BIGENDIAN
#define htole32(x) RtlUlongByteSwap(x)
--
2.12.2

View File

@@ -0,0 +1,25 @@
From 33717bde9e702520e23ae014c398bd7076902d43 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:56:47 +0200
Subject: shell32: Fix length parameter for ZeroMemory.
---
dlls/shell32/shfldr_fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c
index c7259276d1d..10653f92b52 100644
--- a/dlls/shell32/shfldr_fs.c
+++ b/dlls/shell32/shfldr_fs.c
@@ -1315,7 +1315,7 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl,
if (SUCCEEDED (IPersistFolder2_GetCurFolder (ppf2, &pidl))) {
SHGetPathFromIDListW (pidl, wszSrcPathRoot);
- ZeroMemory(wszDstPath, MAX_PATH+1);
+ ZeroMemory(wszDstPath, sizeof(wszDstPath));
if (This->sPathTarget)
lstrcpynW(wszDstPath, This->sPathTarget, MAX_PATH);
PathAddBackslashW(wszSrcPathRoot);
--
2.13.0

View File

@@ -0,0 +1,25 @@
From 2b5e9f330770221eee2eda2aab251eba8d370a60 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 13:17:54 +0200
Subject: fusion: Fix length parameter for ZeroMemory.
---
dlls/fusion/tests/asmname.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/fusion/tests/asmname.c b/dlls/fusion/tests/asmname.c
index 5fb14a48291..21cd4874edc 100644
--- a/dlls/fusion/tests/asmname.c
+++ b/dlls/fusion/tests/asmname.c
@@ -358,7 +358,7 @@ static void test_assembly_name_props_line(IAssemblyName *name,
to_widechar(expect, vals[i].val);
size = MAX_PATH;
- ZeroMemory(str, MAX_PATH);
+ ZeroMemory(str, sizeof(str));
hr = IAssemblyName_GetProperty(name, i, str, &size);
to_multibyte(val, str);
--
2.13.0

View File

@@ -0,0 +1,34 @@
From 3e59710a3091a4a61b7cce00606ed23b7b66dfda Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:55:31 +0200
Subject: fusion/tests: Avoid compiler warnings with GCC 7.
---
dlls/fusion/tests/asmenum.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/fusion/tests/asmenum.c b/dlls/fusion/tests/asmenum.c
index 1dc34a286e5..8b95f2a6bd5 100644
--- a/dlls/fusion/tests/asmenum.c
+++ b/dlls/fusion/tests/asmenum.c
@@ -223,7 +223,7 @@ typedef struct _tagASMNAME
static BOOL enum_gac_assemblies(struct list *assemblies, int depth, LPSTR path)
{
WIN32_FIND_DATAA ffd;
- CHAR buf[MAX_PATH];
+ CHAR buf[MAX_PATH + 37];
CHAR disp[MAX_PATH];
ASMNAME *name;
HANDLE hfind;
@@ -248,7 +248,7 @@ static BOOL enum_gac_assemblies(struct list *assemblies, int depth, LPSTR path)
else if (depth == 1)
{
char culture[MAX_PATH];
- char dll[MAX_PATH], exe[MAX_PATH];
+ char dll[MAX_PATH + 6], exe[MAX_PATH + 6];
/* Directories with no dll or exe will not be enumerated */
sprintf(dll, "%s\\%s\\%s.dll", path, ffd.cFileName, parent);
--
2.13.0

View File

@@ -0,0 +1,34 @@
From d1eafd34d4c0619f956afd365ddbde79680a18dc Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:56:10 +0200
Subject: kernel32/tests: Avoid compiler warnings with GCC 7.
---
dlls/kernel32/tests/heap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c
index 0acf109dff0..70ba674bc91 100644
--- a/dlls/kernel32/tests/heap.c
+++ b/dlls/kernel32/tests/heap.c
@@ -109,6 +109,9 @@ static void test_heap(void)
}
/* test some border cases of HeapAlloc and HeapReAlloc */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas"
+#pragma GCC diagnostic ignored "-Walloc-size-larger-than="
mem = HeapAlloc(GetProcessHeap(), 0, 0);
ok(mem != NULL, "memory not allocated for size 0\n");
msecond = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, ~(SIZE_T)0 - 7);
@@ -125,6 +128,7 @@ static void test_heap(void)
ok(size == 0 || broken(size == 1) /* some vista and win7 */,
"HeapSize should have returned 0 instead of %lu\n", size);
HeapFree(GetProcessHeap(), 0, msecond);
+#pragma GCC diagnostic pop
/* large blocks must be 16-byte aligned */
mem = HeapAlloc(GetProcessHeap(), 0, 512 * 1024);
--
2.13.1

View File

@@ -0,0 +1,25 @@
From 61ceddca38f26c2df2acc6361c35ced52fe9b098 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:58:31 +0200
Subject: rsaenh/tests: Avoid compiler warnings with GCC 7.
---
dlls/rsaenh/rsaenh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c
index 9af770dfc6e..6978c860278 100644
--- a/dlls/rsaenh/rsaenh.c
+++ b/dlls/rsaenh/rsaenh.c
@@ -1097,7 +1097,7 @@ static void store_key_permissions(HCRYPTKEY hCryptKey, HKEY hKey, DWORD dwKeySpe
*/
static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY *phKey)
{
- CHAR szRSABase[MAX_PATH];
+ CHAR szRSABase[MAX_PATH + 25];
HKEY hRootKey;
sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName);
--
2.13.0

View File

@@ -0,0 +1,46 @@
From 67ed53ca67214d7dbdea7f342b9f2ff0356a220b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:59:10 +0200
Subject: kernel32: Avoid compiler warnings with GCC 7.
---
dlls/kernel32/oldconfig.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/oldconfig.c b/dlls/kernel32/oldconfig.c
index 6c80dc614f0..3e628757283 100644
--- a/dlls/kernel32/oldconfig.c
+++ b/dlls/kernel32/oldconfig.c
@@ -290,7 +290,8 @@ static void create_hardware_branch(void)
{
if (strncmp(dent->d_name, "hd", 2) == 0)
{
- sprintf(cStr, procname_ide_media, dent->d_name);
+ result = snprintf(cStr, sizeof(cStr), procname_ide_media, dent->d_name);
+ if (result < 0 || result >= sizeof(cStr)) continue;
procfile = fopen(cStr, "r");
if (!procfile)
{
@@ -306,7 +307,8 @@ static void create_hardware_branch(void)
if (nType == DRIVE_UNKNOWN) continue;
}
- sprintf(cStr, procname_ide_model, dent->d_name);
+ result = snprintf(cStr, sizeof(cStr), procname_ide_model, dent->d_name);
+ if (result < 0 || result >= sizeof(cStr)) continue;
procfile = fopen(cStr, "r");
if (!procfile)
{
@@ -322,7 +324,8 @@ static void create_hardware_branch(void)
cDevModel[strlen(cDevModel) - 1] = 0;
}
- sprintf(cUnixDeviceName, "/dev/%s", dent->d_name);
+ result = snprintf(cUnixDeviceName, sizeof(cUnixDeviceName), "/dev/%s", dent->d_name);
+ if (result < 0 || result >= sizeof(cUnixDeviceName)) continue;
scsi_addr.PortNumber = (dent->d_name[2] - 'a') / 2;
scsi_addr.PathId = 0;
scsi_addr.TargetId = (dent->d_name[2] - 'a') % 2;
--
2.13.0

View File

@@ -0,0 +1,24 @@
From 560a25c662f7b56d2b895759be1ea65c64d0f5af Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 4 Jun 2017 12:57:17 +0200
Subject: ws2_32/tests: Work around an incorrect detection in GCC 7.
---
dlls/ws2_32/tests/sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 677a750ec6b..65c82e36524 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3601,6 +3601,7 @@ static DWORD WINAPI SelectReadThread(void *param)
struct sockaddr_in addr;
struct timeval select_timeout;
+ memset(&readfds, 0, sizeof(readfds));
FD_ZERO(&readfds);
FD_SET(par->s, &readfds);
select_timeout.tv_sec=5;
--
2.13.0

View File

@@ -0,0 +1,37 @@
From 9d0f651d9cb5c3ae68810e37dd6030373c7aeab6 Mon Sep 17 00:00:00 2001
From: Nils Kuhnhenn <kuhnhenn.nils@gmail.com>
Date: Wed, 24 Aug 2016 19:56:00 +0200
Subject: oleaut32: Use variable with the correct type in LIST_FOR_EACH_ENTRY_SAFE macro.
---
dlls/oleaut32/typelib.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index b9318fba423..5a6dad496ed 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -4830,10 +4830,9 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
if (!ref)
{
TLBImpLib *pImpLib, *pImpLibNext;
- TLBRefType *ref_type;
+ TLBRefType *ref_type, *ref_type_next;
TLBString *tlbstr, *tlbstr_next;
TLBGuid *tlbguid, *tlbguid_next;
- void *cursor2;
int i;
/* remove cache entry */
@@ -4883,7 +4882,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
heap_free(pImpLib);
}
- LIST_FOR_EACH_ENTRY_SAFE(ref_type, cursor2, &This->ref_list, TLBRefType, entry)
+ LIST_FOR_EACH_ENTRY_SAFE(ref_type, ref_type_next, &This->ref_list, TLBRefType, entry)
{
list_remove(&ref_type->entry);
heap_free(ref_type);
--
2.13.1

View File

@@ -0,0 +1,24 @@
From 380543910f8912374a13b9773738e018bd638341 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 11 Jun 2017 02:42:47 +0200
Subject: gdiplus: Initialize containers list in GdipCloneImage.
---
dlls/gdiplus/image.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index ce2194317ff..b28606e916c 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -1339,6 +1339,7 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
result->unit = metafile->unit;
result->metafile_type = metafile->metafile_type;
result->hemf = CopyEnhMetaFileW(metafile->hemf, NULL);
+ list_init(&result->containers);
if (!result->hemf)
{
--
2.13.1

View File

@@ -1,4 +1,4 @@
From 35e7be609df3c37eded9a3fd117ba0cef02f24c7 Mon Sep 17 00:00:00 2001
From b6b1e5da04ed867251253410e37d412109a4cec2 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Fri, 8 Aug 2014 19:33:14 -0600
Subject: Appease the blessed version of gcc (4.5) when -Werror is enabled.
@@ -12,10 +12,10 @@ Subject: Appease the blessed version of gcc (4.5) when -Werror is enabled.
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 55140c6..2facbfb 100644
index c8a6a1fa5a8..0261d3708e6 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -12034,7 +12034,7 @@ static void yuv_layout_test(void)
@@ -12304,7 +12304,7 @@ static void yuv_layout_test(void)
IDirect3D9 *d3d;
D3DCOLOR color;
DWORD ref_color;
@@ -25,7 +25,7 @@ index 55140c6..2facbfb 100644
IDirect3DDevice9 *device;
ULONG refcount;
diff --git a/dlls/netapi32/netapi32.c b/dlls/netapi32/netapi32.c
index bb61e7f..cf4c466 100644
index 278d4528b01..1c5f110b828 100644
--- a/dlls/netapi32/netapi32.c
+++ b/dlls/netapi32/netapi32.c
@@ -780,7 +780,7 @@ static NET_API_STATUS share_info_to_samba( DWORD level, const BYTE *buf, unsigne
@@ -38,7 +38,7 @@ index bb61e7f..cf4c466 100644
if (servername && !(server = strdup_unixcp( servername ))) return ERROR_OUTOFMEMORY;
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index 14eac39..ebff9f1 100644
index 2ecb111e218..b285705509c 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -359,7 +359,7 @@ static WCHAR *construct_device_id(EDataFlow flow, const WCHAR *chunk1, const cha
@@ -51,11 +51,11 @@ index 14eac39..ebff9f1 100644
static const WCHAR dashW[] = {' ','-',' ',0};
static const size_t dashW_len = (sizeof(dashW) / sizeof(*dashW)) - 1;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 44e7090..429ae90 100644
index ce960853362..f4275d8dd48 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -6893,7 +6893,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
GLuint vs_id = 0;
@@ -9316,7 +9316,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
GLuint ds_id = 0;
GLuint gs_id = 0;
GLuint ps_id = 0;
- struct list *ps_list, *vs_list;
@@ -64,10 +64,10 @@ index 44e7090..429ae90 100644
struct wined3d_string_buffer *tmp_name;
diff --git a/tools/makedep.c b/tools/makedep.c
index d8cf2f5..280f62f 100644
index add722f80a9..24b06bbfcb2 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1559,7 +1559,7 @@ static const char *get_make_variable( const struct makefile *make, const char *n
@@ -1608,7 +1608,7 @@ static const char *get_make_variable( const struct makefile *make, const char *n
static char *get_expanded_make_variable( const struct makefile *make, const char *name )
{
const char *var;
@@ -77,5 +77,5 @@ index d8cf2f5..280f62f 100644
var = get_make_variable( make, name );
if (!var) return NULL;
--
2.6.2
2.12.2

View File

@@ -1,287 +0,0 @@
From 472184e5801de5d1fb92d275d9c0c7e840c9a0bf Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 11 Nov 2014 03:11:33 +0100
Subject: ntdll: Implement emulation of SIDT instruction when using Exagear.
---
configure.ac | 8 ++
dlls/ntdll/signal_i386.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 231 insertions(+)
diff --git a/configure.ac b/configure.ac
index 1e6bba3..43bf0db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,7 @@ AC_ARG_ENABLE(win16, AS_HELP_STRING([--disable-win16],[do not include Win16 supp
AC_ARG_ENABLE(win64, AS_HELP_STRING([--enable-win64],[build a Win64 emulator on AMD64 (won't run Win32 binaries)]))
AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[do not build the regression tests]))
AC_ARG_ENABLE(maintainer-mode, AS_HELP_STRING([--enable-maintainer-mode],[enable maintainer-specific build rules]))
+AC_ARG_ENABLE(exagear-compat, AS_HELP_STRING([--enable-exagear-compat],[use workarounds for known problems in the Exagear emulator]))
AC_ARG_WITH(alsa, AS_HELP_STRING([--without-alsa],[do not use the Alsa sound support]),
[if test "x$withval" = "xno"; then ac_cv_header_sys_asoundlib_h=no; ac_cv_header_alsa_asoundlib_h=no; fi])
@@ -364,6 +365,13 @@ WINE_WARNING_WITH(gettext,[test "$MSGFMT" = false],
[gettext tools not found (or too old), translations won't be built.],
[enable_po])
+dnl **** Enable Exagear workarounds ****
+
+if test "x$enable_exagear_compat" = "xyes"
+then
+ AC_DEFINE(EXAGEAR_COMPAT, 1, [Define if you want to enable Exagear emulator workarounds])
+fi
+
dnl **** Check for some libraries ****
dnl Check for -li386 for NetBSD and OpenBSD
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index ee8855a..4269329 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -96,6 +96,14 @@ typedef struct
BYTE Reserved4[96];
} XMM_SAVE_AREA32;
+#include "pshpack1.h"
+struct idtr
+{
+ WORD limit;
+ BYTE *base;
+};
+#include "poppack.h"
+
/***********************************************************************
* signal context platform-specific definitions
*/
@@ -1898,6 +1906,213 @@ static inline DWORD get_fpu_code( const CONTEXT *context )
}
+#ifdef EXAGEAR_COMPAT
+
+/***********************************************************************
+ * INSTR_GetOperandAddr
+ *
+ * Return the address of an instruction operand (from the mod/rm byte).
+ */
+static BYTE *INSTR_GetOperandAddr( CONTEXT *context, const BYTE *instr,
+ int long_addr, int segprefix, int *len )
+{
+ int mod, rm, base = 0, index = 0, ss = 0, off;
+
+#define GET_VAL(val,type) \
+ { *val = *(type *)instr; instr += sizeof(type); *len += sizeof(type); }
+
+ *len = 0;
+ GET_VAL( &mod, BYTE );
+ rm = mod & 7;
+ mod >>= 6;
+
+ if (mod == 3)
+ {
+ switch(rm)
+ {
+ case 0: return (BYTE *)&context->Eax;
+ case 1: return (BYTE *)&context->Ecx;
+ case 2: return (BYTE *)&context->Edx;
+ case 3: return (BYTE *)&context->Ebx;
+ case 4: return (BYTE *)&context->Esp;
+ case 5: return (BYTE *)&context->Ebp;
+ case 6: return (BYTE *)&context->Esi;
+ case 7: return (BYTE *)&context->Edi;
+ }
+ }
+
+ if (long_addr)
+ {
+ if (rm == 4)
+ {
+ BYTE sib;
+ GET_VAL( &sib, BYTE );
+ rm = sib & 7;
+ ss = sib >> 6;
+ switch((sib >> 3) & 7)
+ {
+ case 0: index = context->Eax; break;
+ case 1: index = context->Ecx; break;
+ case 2: index = context->Edx; break;
+ case 3: index = context->Ebx; break;
+ case 4: index = 0; break;
+ case 5: index = context->Ebp; break;
+ case 6: index = context->Esi; break;
+ case 7: index = context->Edi; break;
+ }
+ }
+
+ switch(rm)
+ {
+ case 0: base = context->Eax; break;
+ case 1: base = context->Ecx; break;
+ case 2: base = context->Edx; break;
+ case 3: base = context->Ebx; break;
+ case 4: base = context->Esp; break;
+ case 5: base = context->Ebp; break;
+ case 6: base = context->Esi; break;
+ case 7: base = context->Edi; break;
+ }
+ switch (mod)
+ {
+ case 0:
+ if (rm == 5) /* special case: ds:(disp32) */
+ {
+ GET_VAL( &base, DWORD );
+ }
+ break;
+
+ case 1: /* 8-bit disp */
+ GET_VAL( &off, BYTE );
+ base += (signed char)off;
+ break;
+
+ case 2: /* 32-bit disp */
+ GET_VAL( &off, DWORD );
+ base += (signed long)off;
+ break;
+ }
+ }
+ else /* short address */
+ {
+ switch(rm)
+ {
+ case 0: /* ds:(bx,si) */
+ base = LOWORD(context->Ebx) + LOWORD(context->Esi);
+ break;
+ case 1: /* ds:(bx,di) */
+ base = LOWORD(context->Ebx) + LOWORD(context->Edi);
+ break;
+ case 2: /* ss:(bp,si) */
+ base = LOWORD(context->Ebp) + LOWORD(context->Esi);
+ break;
+ case 3: /* ss:(bp,di) */
+ base = LOWORD(context->Ebp) + LOWORD(context->Edi);
+ break;
+ case 4: /* ds:(si) */
+ base = LOWORD(context->Esi);
+ break;
+ case 5: /* ds:(di) */
+ base = LOWORD(context->Edi);
+ break;
+ case 6: /* ss:(bp) */
+ base = LOWORD(context->Ebp);
+ break;
+ case 7: /* ds:(bx) */
+ base = LOWORD(context->Ebx);
+ break;
+ }
+
+ switch(mod)
+ {
+ case 0:
+ if (rm == 6) /* special case: ds:(disp16) */
+ {
+ GET_VAL( &base, WORD );
+ }
+ break;
+
+ case 1: /* 8-bit disp */
+ GET_VAL( &off, BYTE );
+ base += (signed char)off;
+ break;
+
+ case 2: /* 16-bit disp */
+ GET_VAL( &off, WORD );
+ base += (signed short)off;
+ break;
+ }
+ base &= 0xffff;
+ }
+ /* FIXME: we assume that all segments have a base of 0 */
+ return (BYTE *)(base + (index << ss));
+#undef GET_VAL
+}
+
+
+/***********************************************************************
+ * check_invalid_instr
+ *
+ * Support for instructions not implemented by Exagear.
+ */
+static inline BOOL check_invalid_instr( CONTEXT *context )
+{
+ const BYTE *instr;
+ unsigned int prefix_count = 0;
+ int len, long_addr = 1;
+
+ if (!wine_ldt_is_system( context->SegCs )) return FALSE;
+ instr = (BYTE *)context->Eip;
+
+ for (;;) switch (*instr)
+ {
+ /* instruction prefixes */
+ case 0x2e: /* %cs: */
+ case 0x36: /* %ss: */
+ case 0x3e: /* %ds: */
+ case 0x26: /* %es: */
+ case 0x64: /* %fs: */
+ case 0x65: /* %gs: */
+ case 0x66: /* opcode size */
+ case 0x67: /* addr size */
+ case 0xf0: /* lock */
+ case 0xf2: /* repne */
+ case 0xf3: /* repe */
+ if (++prefix_count >= 15) return FALSE;
+ if (*instr == 0x67) long_addr = !long_addr; /* addr size */
+ instr++;
+ continue;
+ case 0x0f: /* extended instruction */
+ switch (instr[1])
+ {
+ case 0x01:
+ if (((instr[2] >> 3) & 7) == 1) /* sidt m */
+ {
+ struct idtr ret;
+ BYTE *addr;
+
+ if ((instr[2] >> 6) == 3) return FALSE; /* loading to register not allowed */
+ addr = INSTR_GetOperandAddr( context, instr + 2, long_addr, 0, &len );
+
+ /* fake IDT structure */
+ ret.limit = 0xfff;
+ ret.base = (void *)0xff000000;
+ memcpy(addr, &ret, sizeof(ret));
+
+ context->Eip += prefix_count + len + 2;
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+ default:
+ return FALSE;
+ }
+}
+
+#endif /* EXAGEAR_COMPAT */
+
+
/**********************************************************************
* raise_segv_exception
*/
@@ -1907,6 +2122,14 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
switch(rec->ExceptionCode)
{
+#ifdef EXAGEAR_COMPAT
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ {
+ if (check_invalid_instr( context ))
+ goto done;
+ }
+ break;
+#endif
case EXCEPTION_ACCESS_VIOLATION:
if (rec->NumberParameters == 2)
{
--
2.7.1

View File

@@ -1,51 +0,0 @@
From 5a4827d5c16aefd82029583710b9032a2356917b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 22 Nov 2014 05:49:30 +0100
Subject: ntdll: Fix issues with write watches when using Exagear.
---
dlls/ntdll/virtual.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index f7aae0b..3fa2027 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1558,6 +1558,26 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack )
{
void *page = ROUND_ADDR( addr, page_mask );
BYTE *vprot = &view->prot[((const char *)page - (const char *)view->base) >> page_shift];
+#ifdef EXAGEAR_COMPAT
+ /* Exagear doesn't correctly set err, so always check for write watches, and
+ * retry after removing the VPROT_WRITEWATCH or VPROT_WRITECOPY flag. In
+ * contrary to the general implementation below this is not completely race-
+ * condition safe. When multiple threads trigger the write watch at the same
+ * time only the first thread will properly continue the execution, the rest
+ * will crash. */
+ if ((view->protect & VPROT_WRITEWATCH) && (*vprot & VPROT_WRITEWATCH))
+ {
+ *vprot &= ~VPROT_WRITEWATCH;
+ VIRTUAL_SetProt( view, page, page_size, *vprot );
+ if (VIRTUAL_GetUnixProt( *vprot ) & PROT_WRITE) ret = STATUS_SUCCESS;
+ }
+ if (*vprot & VPROT_WRITECOPY)
+ {
+ *vprot = (*vprot & ~VPROT_WRITECOPY) | VPROT_WRITE;
+ VIRTUAL_SetProt( view, page, page_size, *vprot );
+ if (VIRTUAL_GetUnixProt( *vprot ) & PROT_WRITE) ret = STATUS_SUCCESS;
+ }
+#else
if (err & EXCEPTION_WRITE_FAULT)
{
if ((view->protect & VPROT_WRITEWATCH) && (*vprot & VPROT_WRITEWATCH))
@@ -1573,6 +1593,7 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack )
/* ignore fault if page is writable now */
if (VIRTUAL_GetUnixProt( *vprot ) & PROT_WRITE) ret = STATUS_SUCCESS;
}
+#endif
if (!on_signal_stack && (*vprot & VPROT_GUARD))
{
VIRTUAL_SetProt( view, page, page_size, *vprot & ~VPROT_GUARD );
--
2.2.2

View File

@@ -1,25 +0,0 @@
From 67cc0e23b26d5d9abda7eb771dc2bec309cb8650 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 23 Nov 2014 22:33:51 +0100
Subject: server: Don't attempt to use ptrace when running with Exagear.
---
server/ptrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/ptrace.c b/server/ptrace.c
index cb436b6..fb29b5a 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -531,7 +531,7 @@ void get_selector_entry( struct thread *thread, int entry, unsigned int *base,
#if defined(linux) && (defined(HAVE_SYS_USER_H) || defined(HAVE_ASM_USER_H)) \
- && (defined(__i386__) || defined(__x86_64__))
+ && (defined(__i386__) || defined(__x86_64__)) && !defined(EXAGEAR_COMPAT)
#ifdef HAVE_SYS_USER_H
#include <sys/user.h>
--
2.1.3

View File

@@ -1,2 +0,0 @@
Depends: ntdll-WRITECOPY
Disabled: true

View File

@@ -0,0 +1,268 @@
From 994fe46f1b68d851d285a29cce904bd9f22540ea Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Tue, 2 May 2017 00:59:49 -0500
Subject: advapi32: Implement BuildSecurityDescriptorW.
---
dlls/advapi32/security.c | 218 +++++++++++++++++++++++++++++++++++------------
1 file changed, 164 insertions(+), 54 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 24ec3099713..82bb6689d43 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -58,6 +58,7 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor(
SECURITY_DESCRIPTOR_RELATIVE* SecurityDescriptor,
LPDWORD cBytes);
static DWORD ParseAclStringFlags(LPCWSTR* StringAcl);
+static DWORD trustee_to_sid(DWORD nDestinationSidLength, PSID pDestinationSid, PTRUSTEEW pTrustee);
typedef struct _ACEFLAG
{
@@ -1264,16 +1265,122 @@ DWORD WINAPI BuildSecurityDescriptorW(
IN ULONG cCountOfAccessEntries,
IN PEXPLICIT_ACCESSW pListOfAccessEntries,
IN ULONG cCountOfAuditEntries,
- IN PEXPLICIT_ACCESSW pListofAuditEntries,
+ IN PEXPLICIT_ACCESSW pListOfAuditEntries,
IN PSECURITY_DESCRIPTOR pOldSD,
IN OUT PULONG lpdwBufferLength,
OUT PSECURITY_DESCRIPTOR* pNewSD)
{
- FIXME("(%p,%p,%d,%p,%d,%p,%p,%p,%p) stub!\n",pOwner,pGroup,
- cCountOfAccessEntries,pListOfAccessEntries,cCountOfAuditEntries,
- pListofAuditEntries,pOldSD,lpdwBufferLength,pNewSD);
+ SECURITY_DESCRIPTOR desc;
+ NTSTATUS status;
+ DWORD ret = ERROR_SUCCESS;
+
+ TRACE("(%p,%p,%d,%p,%d,%p,%p,%p,%p)\n", pOwner, pGroup,
+ cCountOfAccessEntries, pListOfAccessEntries, cCountOfAuditEntries,
+ pListOfAuditEntries, pOldSD, lpdwBufferLength, pNewSD);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ if (pOldSD)
+ {
+ SECURITY_DESCRIPTOR_CONTROL control;
+ DWORD desc_size, dacl_size = 0, sacl_size = 0, owner_size = 0, group_size = 0;
+ PACL dacl = NULL, sacl = NULL;
+ PSID owner = NULL, group = NULL;
+ DWORD revision;
+
+ if ((status = RtlGetControlSecurityDescriptor( pOldSD, &control, &revision )) != STATUS_SUCCESS)
+ return RtlNtStatusToDosError( status );
+ if (!(control & SE_SELF_RELATIVE))
+ return ERROR_INVALID_SECURITY_DESCR;
+
+ desc_size = sizeof(desc);
+ status = RtlSelfRelativeToAbsoluteSD( pOldSD, &desc, &desc_size, dacl, &dacl_size, sacl, &sacl_size,
+ owner, &owner_size, group, &group_size );
+ if (status == STATUS_BUFFER_TOO_SMALL)
+ {
+ if (dacl_size)
+ dacl = LocalAlloc( LMEM_FIXED, dacl_size );
+ if (sacl_size)
+ sacl = LocalAlloc( LMEM_FIXED, sacl_size );
+ if (owner_size)
+ owner = LocalAlloc( LMEM_FIXED, owner_size );
+ if (group_size)
+ group = LocalAlloc( LMEM_FIXED, group_size );
+
+ desc_size = sizeof(desc);
+ status = RtlSelfRelativeToAbsoluteSD( pOldSD, &desc, &desc_size, dacl, &dacl_size, sacl, &sacl_size,
+ owner, &owner_size, group, &group_size );
+ }
+ if (status != STATUS_SUCCESS)
+ {
+ LocalFree( dacl );
+ LocalFree( sacl );
+ LocalFree( owner );
+ LocalFree( group );
+ return RtlNtStatusToDosError( status );
+ }
+ }
+ else
+ {
+ if ((status = RtlCreateSecurityDescriptor( &desc, SECURITY_DESCRIPTOR_REVISION )) != STATUS_SUCCESS)
+ return RtlNtStatusToDosError( status );
+ }
+
+ if (pOwner)
+ {
+ LocalFree( desc.Owner );
+ desc.Owner = LocalAlloc( LMEM_FIXED, sizeof(MAX_SID) );
+ if ((ret = trustee_to_sid( sizeof(MAX_SID), desc.Owner, pOwner )))
+ goto done;
+ }
+
+ if (pGroup)
+ {
+ LocalFree( desc.Group );
+ desc.Group = LocalAlloc( LMEM_FIXED, sizeof(MAX_SID) );
+ if ((ret = trustee_to_sid( sizeof(MAX_SID), desc.Group, pGroup )))
+ goto done;
+ }
+
+ if (pListOfAccessEntries)
+ {
+ PACL new_dacl;
+
+ if ((ret = SetEntriesInAclW( cCountOfAccessEntries, pListOfAccessEntries, desc.Dacl, &new_dacl )))
+ goto done;
+
+ LocalFree( desc.Dacl );
+ desc.Dacl = new_dacl;
+ desc.Control |= SE_DACL_PRESENT;
+ }
+
+ if (pListOfAuditEntries)
+ {
+ PACL new_sacl;
+
+ if ((ret = SetEntriesInAclW( cCountOfAuditEntries, pListOfAuditEntries, desc.Sacl, &new_sacl )))
+ goto done;
+
+ LocalFree( desc.Sacl );
+ desc.Sacl = new_sacl;
+ desc.Control |= SE_SACL_PRESENT;
+ }
+
+ *lpdwBufferLength = RtlLengthSecurityDescriptor( &desc );
+ *pNewSD = LocalAlloc( LMEM_FIXED, *lpdwBufferLength );
+
+ if ((status = RtlMakeSelfRelativeSD( &desc, *pNewSD, lpdwBufferLength )) != STATUS_SUCCESS)
+ {
+ ret = RtlNtStatusToDosError( status );
+ LocalFree( *pNewSD );
+ *pNewSD = NULL;
+ }
+
+done:
+ /* free absolute descriptor */
+ LocalFree( desc.Owner );
+ LocalFree( desc.Group );
+ LocalFree( desc.Sacl );
+ LocalFree( desc.Dacl );
+ return ret;
}
/******************************************************************************
@@ -3766,6 +3873,56 @@ static void free_trustee_name(TRUSTEE_FORM form, WCHAR *trustee_nameW)
}
}
+static DWORD trustee_to_sid( DWORD nDestinationSidLength, PSID pDestinationSid, PTRUSTEEW pTrustee )
+{
+ if (pTrustee->MultipleTrusteeOperation == TRUSTEE_IS_IMPERSONATE)
+ {
+ WARN("bad multiple trustee operation %d\n", pTrustee->MultipleTrusteeOperation);
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ switch (pTrustee->TrusteeForm)
+ {
+ case TRUSTEE_IS_SID:
+ if (!CopySid(nDestinationSidLength, pDestinationSid, pTrustee->ptstrName))
+ {
+ WARN("bad sid %p\n", pTrustee->ptstrName);
+ return ERROR_INVALID_PARAMETER;
+ }
+ break;
+ case TRUSTEE_IS_NAME:
+ {
+ DWORD sid_size = nDestinationSidLength;
+ DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
+ SID_NAME_USE use;
+ if (!strcmpW( pTrustee->ptstrName, CURRENT_USER ))
+ {
+ if (!lookup_user_account_name( pDestinationSid, &sid_size, NULL, &domain_size, &use ))
+ {
+ return GetLastError();
+ }
+ }
+ else if (!LookupAccountNameW(NULL, pTrustee->ptstrName, pDestinationSid, &sid_size, NULL, &domain_size, &use))
+ {
+ WARN("bad user name %s\n", debugstr_w(pTrustee->ptstrName));
+ return ERROR_INVALID_PARAMETER;
+ }
+ break;
+ }
+ case TRUSTEE_IS_OBJECTS_AND_SID:
+ FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n");
+ break;
+ case TRUSTEE_IS_OBJECTS_AND_NAME:
+ FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n");
+ break;
+ default:
+ WARN("bad trustee form %d\n", pTrustee->TrusteeForm);
+ return ERROR_INVALID_PARAMETER;
+ }
+
+ return ERROR_SUCCESS;
+}
+
/******************************************************************************
* SetEntriesInAclA [ADVAPI32.@]
*/
@@ -3861,56 +4018,9 @@ DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries,
pEntries[i].Trustee.TrusteeForm, pEntries[i].Trustee.TrusteeType,
pEntries[i].Trustee.ptstrName);
- if (pEntries[i].Trustee.MultipleTrusteeOperation == TRUSTEE_IS_IMPERSONATE)
- {
- WARN("bad multiple trustee operation %d for trustee %d\n", pEntries[i].Trustee.MultipleTrusteeOperation, i);
- ret = ERROR_INVALID_PARAMETER;
- goto exit;
- }
-
- switch (pEntries[i].Trustee.TrusteeForm)
- {
- case TRUSTEE_IS_SID:
- if (!CopySid(FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]),
- ppsid[i], pEntries[i].Trustee.ptstrName))
- {
- WARN("bad sid %p for trustee %d\n", pEntries[i].Trustee.ptstrName, i);
- ret = ERROR_INVALID_PARAMETER;
- goto exit;
- }
- break;
- case TRUSTEE_IS_NAME:
- {
- DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]);
- DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
- SID_NAME_USE use;
- if (!strcmpW( pEntries[i].Trustee.ptstrName, CURRENT_USER ))
- {
- if (!lookup_user_account_name( ppsid[i], &sid_size, NULL, &domain_size, &use ))
- {
- ret = GetLastError();
- goto exit;
- }
- }
- else if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
- {
- WARN("bad user name %s for trustee %d\n", debugstr_w(pEntries[i].Trustee.ptstrName), i);
- ret = ERROR_INVALID_PARAMETER;
- goto exit;
- }
- break;
- }
- case TRUSTEE_IS_OBJECTS_AND_SID:
- FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n");
- break;
- case TRUSTEE_IS_OBJECTS_AND_NAME:
- FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n");
- break;
- default:
- WARN("bad trustee form %d for trustee %d\n", pEntries[i].Trustee.TrusteeForm, i);
- ret = ERROR_INVALID_PARAMETER;
+ ret = trustee_to_sid( FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]), ppsid[i], &pEntries[i].Trustee);
+ if (ret)
goto exit;
- }
/* Note: we overestimate the ACL size here as a tradeoff between
* instructions (simplicity) and memory */
--
2.12.2

View File

@@ -0,0 +1,69 @@
From 63082c3863d8be466ed14f532653ddf35e40328a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 5 May 2017 00:18:50 +0200
Subject: advapi32/tests: Add basic tests for BuildSecurityDescriptor.
---
dlls/advapi32/tests/security.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index d6ea3a19fad..c591f7b6e5f 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -7489,6 +7489,44 @@ static void test_child_token_sd(void)
HeapFree(GetProcessHeap(), 0, sd);
}
+static void test_BuildSecurityDescriptorW(void)
+{
+ SECURITY_DESCRIPTOR old_sd, *new_sd, *rel_sd;
+ ULONG new_sd_size;
+ DWORD buf_size;
+ char buf[1024];
+ BOOL success;
+ DWORD ret;
+
+ InitializeSecurityDescriptor(&old_sd, SECURITY_DESCRIPTOR_REVISION);
+
+ buf_size = sizeof(buf);
+ rel_sd = (SECURITY_DESCRIPTOR *)buf;
+ success = MakeSelfRelativeSD(&old_sd, rel_sd, &buf_size);
+ ok(success, "MakeSelfRelativeSD failed with %u\n", GetLastError());
+
+ new_sd = NULL;
+ new_sd_size = 0;
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, NULL, &new_sd_size, (void **)&new_sd);
+ ok(ret == ERROR_SUCCESS, "BuildSecurityDescriptor failed with %u\n", ret);
+ ok(new_sd != NULL, "expected new_sd != NULL\n");
+ ok(new_sd_size == sizeof(old_sd), "expected new_sd_size == sizeof(old_sd), got %u\n", new_sd_size);
+ LocalFree(new_sd);
+
+ new_sd = (void *)0xdeadbeef;
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, &old_sd, &new_sd_size, (void **)&new_sd);
+ ok(ret == ERROR_INVALID_SECURITY_DESCR, "expected ERROR_INVALID_SECURITY_DESCR, got %u\n", ret);
+ ok(new_sd == (void *)0xdeadbeef, "expected new_sd == 0xdeadbeef, got %p\n", new_sd);
+
+ new_sd = NULL;
+ new_sd_size = 0;
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, rel_sd, &new_sd_size, (void **)&new_sd);
+ ok(ret == ERROR_SUCCESS, "BuildSecurityDescriptor failed with %u\n", ret);
+ ok(new_sd != NULL, "expected new_sd != NULL\n");
+ ok(new_sd_size == sizeof(old_sd), "expected new_sd_size == sizeof(old_sd), got %u\n", new_sd_size);
+ LocalFree(new_sd);
+}
+
START_TEST(security)
{
init();
@@ -7542,6 +7580,7 @@ START_TEST(security)
test_pseudo_tokens();
test_maximum_allowed();
test_GetExplicitEntriesFromAclW();
+ test_BuildSecurityDescriptorW();
/* must be the last test, modifies process token */
test_token_security_descriptor();
--
2.12.2

View File

@@ -0,0 +1,2 @@
Fixes: Initial implementation of advapi32.BuildSecurityDescriptorW
Depends: server-LABEL_SECURITY_INFORMATION

View File

@@ -0,0 +1,267 @@
From e950724c38a4f81efb97bb9595dc59c5fb925da0 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 12 Apr 2017 12:33:31 +0800
Subject: advapi32/tests: Add more tests for performance counters.
---
dlls/advapi32/tests/registry.c | 196 ++++++++++++++++++++++++++++++++++++++++-
include/winreg.h | 2 +
2 files changed, 194 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 846f1c49628..d850f6a3aa7 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -3520,35 +3520,73 @@ static void test_RegNotifyChangeKeyValue(void)
CloseHandle(event);
}
+static const char *dbgstr_longlong(ULONGLONG ll)
+{
+ static char buf[16][64];
+ static int idx;
+
+ idx &= 0x0f;
+
+ if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
+ sprintf(buf[idx], "0x%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll);
+ else
+ sprintf(buf[idx], "0x%08lx", (unsigned long)ll);
+
+ return buf[idx++];
+}
+
+#define cmp_li(a, b, c) cmp_li_real(a, b, c, __LINE__)
+static void cmp_li_real(LARGE_INTEGER *l1, LARGE_INTEGER *l2, LONGLONG slack, int line)
+{
+ LONGLONG diff = l2->QuadPart - l1->QuadPart;
+ if (diff < 0) diff = -diff;
+ ok_(__FILE__, line)(diff <= slack, "values don't match: %s/%s\n",
+ dbgstr_longlong(l1->QuadPart), dbgstr_longlong(l2->QuadPart));
+}
+
static void test_RegQueryValueExPerformanceData(void)
{
- DWORD cbData, len;
+ static const WCHAR globalW[] = { 'G','l','o','b','a','l',0 };
+ static const WCHAR dummyW[5] = { 'd','u','m','m','y' };
+ static const char * const names[] = { NULL, "", "Global", "2" "invalid counter name" };
+ DWORD cbData, len, i, type;
BYTE *value;
DWORD dwret;
LONG limit = 6;
PERF_DATA_BLOCK *pdb;
+ HKEY hkey;
+ BYTE buf[256 + sizeof(PERF_DATA_BLOCK)];
/* Test with data == NULL */
dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, NULL, &cbData );
todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
+ dwret = RegQueryValueExW( HKEY_PERFORMANCE_DATA, globalW, NULL, NULL, NULL, &cbData );
+ todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
+
/* Test ERROR_MORE_DATA, start with small buffer */
len = 10;
value = HeapAlloc(GetProcessHeap(), 0, len);
cbData = len;
- dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, value, &cbData );
+ type = 0xdeadbeef;
+ dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, &type, value, &cbData );
todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
+todo_wine
+ ok(type == REG_BINARY, "got %u\n", type);
while( dwret == ERROR_MORE_DATA && limit)
{
len = len * 10;
value = HeapReAlloc( GetProcessHeap(), 0, value, len );
cbData = len;
- dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, value, &cbData );
+ type = 0xdeadbeef;
+ dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, &type, value, &cbData );
limit--;
}
ok(limit > 0, "too many times ERROR_MORE_DATA returned\n");
todo_wine ok(dwret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", dwret);
+todo_wine
+ ok(type == REG_BINARY, "got %u\n", type);
/* Check returned data */
if (dwret == ERROR_SUCCESS)
@@ -3565,8 +3603,158 @@ static void test_RegQueryValueExPerformanceData(void)
}
HeapFree(GetProcessHeap(), 0, value);
-}
+ for (i = 0; i < sizeof(names)/sizeof(names[0]); i++)
+ {
+ cbData = 0xdeadbeef;
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, names[i], NULL, NULL, NULL, &cbData);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
+ ok(cbData == 0, "got %u\n", cbData);
+
+ cbData = 0;
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, names[i], NULL, NULL, NULL, &cbData);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
+ ok(cbData == 0, "got %u\n", cbData);
+
+ cbData = 0xdeadbeef;
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_TEXT, names[i], NULL, NULL, NULL, &cbData);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
+ ok(cbData == 0, "got %u\n", cbData);
+
+ cbData = 0;
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_TEXT, names[i], NULL, NULL, NULL, &cbData);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
+ ok(cbData == 0, "got %u\n", cbData);
+
+ cbData = 0xdeadbeef;
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_NLSTEXT, names[i], NULL, NULL, NULL, &cbData);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
+ ok(cbData == 0, "got %u\n", cbData);
+
+ cbData = 0;
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_NLSTEXT, names[i], NULL, NULL, NULL, &cbData);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
+ ok(cbData == 0, "got %u\n", cbData);
+ }
+
+ memset(buf, 0x77, sizeof(buf));
+ type = 0xdeadbeef;
+ cbData = sizeof(buf);
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "invalid counter name", NULL, &type, buf, &cbData);
+todo_wine
+ ok(dwret == ERROR_SUCCESS, "got %u\n", dwret);
+todo_wine
+ ok(type == REG_BINARY, "got %u\n", type);
+ if (dwret == ERROR_SUCCESS)
+ {
+ SYSTEMTIME st;
+ WCHAR sysname[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD sysname_len;
+ LARGE_INTEGER counter, freq, ftime;
+
+ GetSystemTime(&st);
+ GetSystemTimeAsFileTime((FILETIME *)&ftime);
+ QueryPerformanceCounter(&counter);
+ QueryPerformanceFrequency(&freq);
+
+ sysname_len = MAX_COMPUTERNAME_LENGTH + 1;
+ GetComputerNameW(sysname, &sysname_len);
+
+ pdb = (PERF_DATA_BLOCK *)buf;
+ ok(pdb->Signature[0] == 'P', "got '%c'\n", pdb->Signature[0]);
+ ok(pdb->Signature[1] == 'E', "got '%c'\n", pdb->Signature[1]);
+ ok(pdb->Signature[2] == 'R', "got '%c'\n", pdb->Signature[2]);
+ ok(pdb->Signature[3] == 'F', "got '%c'\n", pdb->Signature[3]);
+
+ ok(pdb->LittleEndian == 1, "got %u\n", pdb->LittleEndian);
+ ok(pdb->Version == 1, "got %u\n", pdb->Version);
+ ok(pdb->Revision == 1, "got %u\n", pdb->Revision);
+ len = (sizeof(*pdb) + pdb->SystemNameLength + 7) & ~7;
+ ok(pdb->TotalByteLength == len, "got %u vs %u\n", pdb->TotalByteLength, len);
+ ok(pdb->HeaderLength == pdb->TotalByteLength, "got %u\n", pdb->HeaderLength);
+ ok(pdb->NumObjectTypes == 0, "got %u\n", pdb->NumObjectTypes);
+ ok(pdb->DefaultObject != 0, "got %u\n", pdb->DefaultObject);
+ ok(pdb->SystemTime.wYear == st.wYear, "got %u\n", pdb->SystemTime.wYear);
+ ok(pdb->SystemTime.wMonth == st.wMonth, "got %u\n", pdb->SystemTime.wMonth);
+ ok(pdb->SystemTime.wDayOfWeek == st.wDayOfWeek, "got %u\n", pdb->SystemTime.wDayOfWeek);
+ ok(pdb->SystemTime.wDay == st.wDay, "got %u\n", pdb->SystemTime.wDay);
+ if (U(pdb->PerfTime).LowPart != 0x77777777) /* TestBot is broken */
+ cmp_li(&pdb->PerfTime, &counter, freq.QuadPart);
+ if (U(pdb->PerfFreq).LowPart != 0x77777777) /* TestBot is broken */
+ cmp_li(&pdb->PerfFreq, &freq, 0);
+ cmp_li(&pdb->PerfTime100nSec, &ftime, 200000); /* TestBot needs huge slack value */
+ ok(pdb->SystemNameLength == (sysname_len + 1) * sizeof(WCHAR), "expected %u, got %u\n",
+ (sysname_len + 1) * sizeof(WCHAR), pdb->SystemNameLength);
+ ok(pdb->SystemNameOffset == sizeof(*pdb), "got %u\n", pdb->SystemNameOffset);
+ ok(!lstrcmpW(sysname, (LPCWSTR)(pdb + 1)), "%s != %s\n",
+ wine_dbgstr_w(sysname), wine_dbgstr_w((LPCWSTR)(pdb + 1)));
+
+ len = pdb->TotalByteLength - (sizeof(*pdb) + pdb->SystemNameLength);
+ if (len)
+ {
+ BYTE remainder[8], *p;
+
+ memset(remainder, 0x77, sizeof(remainder));
+ p = buf + sizeof(*pdb) + pdb->SystemNameLength;
+ ok(!memcmp(p, remainder, len), "remainder: %02x,%02x...\n", p[0], p[1]);
+ }
+ }
+
+ dwret = RegOpenKeyA(HKEY_PERFORMANCE_DATA, NULL, &hkey);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ dwret = RegOpenKeyA(HKEY_PERFORMANCE_DATA, "Global", &hkey);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ dwret = RegOpenKeyExA(HKEY_PERFORMANCE_DATA, "Global", 0, KEY_READ, &hkey);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ dwret = RegQueryValueA(HKEY_PERFORMANCE_DATA, "Global", NULL, (LONG *)&cbData);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ dwret = RegSetValueA(HKEY_PERFORMANCE_DATA, "Global", REG_SZ, "dummy", 4);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ dwret = RegSetValueExA(HKEY_PERFORMANCE_DATA, "Global", 0, REG_SZ, (const BYTE *)"dummy", 40);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ cbData = sizeof(buf);
+ dwret = RegEnumKeyA(HKEY_PERFORMANCE_DATA, 0, (LPSTR)buf, cbData);
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+
+ cbData = sizeof(buf);
+ dwret = RegEnumValueA(HKEY_PERFORMANCE_DATA, 0, (LPSTR)buf, &cbData, NULL, NULL, NULL, NULL);
+todo_wine
+ ok(dwret == ERROR_MORE_DATA, "got %u\n", dwret);
+todo_wine
+ ok(cbData == sizeof(buf), "got %u\n", cbData);
+
+ dwret = RegEnumValueA(HKEY_PERFORMANCE_DATA, 0, NULL, &cbData, NULL, NULL, NULL, NULL);
+ ok(dwret == ERROR_INVALID_PARAMETER, "got %u\n", dwret);
+
+ if (pRegSetKeyValueW)
+ {
+ dwret = pRegSetKeyValueW(HKEY_PERFORMANCE_DATA, NULL, globalW, REG_SZ, dummyW, sizeof(dummyW));
+todo_wine
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
+ }
+
+ dwret = RegCloseKey(HKEY_PERFORMANCE_DATA);
+ ok(dwret == ERROR_SUCCESS, "got %u\n", dwret);
+}
START_TEST(registry)
{
diff --git a/include/winreg.h b/include/winreg.h
index 42b77251ae4..ddbd9293783 100644
--- a/include/winreg.h
+++ b/include/winreg.h
@@ -32,6 +32,8 @@ extern "C" {
#define HKEY_PERFORMANCE_DATA ((HKEY)(LONG_PTR)(LONG)0x80000004)
#define HKEY_CURRENT_CONFIG ((HKEY)(LONG_PTR)(LONG)0x80000005)
#define HKEY_DYN_DATA ((HKEY)(LONG_PTR)(LONG)0x80000006)
+#define HKEY_PERFORMANCE_TEXT ((HKEY)(LONG_PTR)(LONG)0x80000050)
+#define HKEY_PERFORMANCE_NLSTEXT ((HKEY)(LONG_PTR)(LONG)0x80000060)
/*
* registry provider structs
--
2.13.1

View File

@@ -0,0 +1,139 @@
From f72de28ee3a7a3cb25165f0aaee0c7e17eb7e6d7 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 12 Apr 2017 12:48:29 +0800
Subject: include: Add more definitions for performance counters.
---
include/winperf.h | 113 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 97 insertions(+), 16 deletions(-)
diff --git a/include/winperf.h b/include/winperf.h
index dce1a6d648d..113bfbae40f 100644
--- a/include/winperf.h
+++ b/include/winperf.h
@@ -67,25 +67,106 @@
#define PERF_DETAIL_EXPERT 300
#define PERF_DETAIL_WIZARD 400
+#include <pshpack8.h>
+
/* Performance data structure header
* returned in answer to HKEY_PERFORMANCE_DATA request
*/
-typedef struct _PERF_DATA_BLOCK {
- WCHAR Signature[4];
- DWORD LittleEndian;
- DWORD Version;
- DWORD Revision;
- DWORD TotalByteLength;
- DWORD HeaderLength;
- DWORD NumObjectTypes;
- DWORD DefaultObject;
- SYSTEMTIME SystemTime;
- LARGE_INTEGER PerfTime;
- LARGE_INTEGER PerfFreq;
- LARGE_INTEGER PerfTime100nSec;
- DWORD SystemNameLength;
- DWORD SystemNameOffset;
-} PERF_DATA_BLOCK, *PPERF_DATA_BLOCK, *LPPERF_DATA_BLOCK;
+#define PERF_DATA_VERSION 1
+#define PERF_DATA_REVISION 1
+
+typedef struct _PERF_DATA_BLOCK
+{
+ WCHAR Signature[4];
+ DWORD LittleEndian;
+ DWORD Version;
+ DWORD Revision;
+ DWORD TotalByteLength;
+ DWORD HeaderLength;
+ DWORD NumObjectTypes;
+ DWORD DefaultObject;
+ SYSTEMTIME SystemTime;
+ LARGE_INTEGER PerfTime;
+ LARGE_INTEGER PerfFreq;
+ LARGE_INTEGER PerfTime100nSec;
+ DWORD SystemNameLength;
+ DWORD SystemNameOffset;
+} PERF_DATA_BLOCK, *PPERF_DATA_BLOCK;
+
+#define PERF_NO_INSTANCES -1
+
+typedef struct _PERF_OBJECT_TYPE
+{
+ DWORD TotalByteLength;
+ DWORD DefinitionLength;
+ DWORD HeaderLength;
+ DWORD ObjectNameTitleIndex;
+#ifdef _WIN64
+ DWORD ObjectNameTitle;
+#else
+ LPWSTR ObjectNameTitle;
+#endif
+ DWORD ObjectHelpTitleIndex;
+#ifdef _WIN64
+ DWORD ObjectHelpTitle;
+#else
+ LPWSTR ObjectHelpTitle;
+#endif
+ DWORD DetailLevel;
+ DWORD NumCounters;
+ LONG DefaultCounter;
+ LONG NumInstances;
+ DWORD CodePage;
+ LARGE_INTEGER PerfTime;
+ LARGE_INTEGER PerfFreq;
+} PERF_OBJECT_TYPE, *PPERF_OBJECT_TYPE;
+
+typedef struct _PERF_COUNTER_DEFINITION
+{
+ DWORD ByteLength;
+ DWORD CounterNameTitleIndex;
+#ifdef _WIN64
+ DWORD CounterNameTitle;
+#else
+ LPWSTR CounterNameTitle;
+#endif
+ DWORD CounterHelpTitleIndex;
+#ifdef _WIN64
+ DWORD CounterHelpTitle;
+#else
+ LPWSTR CounterHelpTitle;
+#endif
+ LONG DefaultScale;
+ DWORD DetailLevel;
+ DWORD CounterType;
+ DWORD CounterSize;
+ DWORD CounterOffset;
+} PERF_COUNTER_DEFINITION, *PPERF_COUNTER_DEFINITION;
+
+#define PERF_NO_UNIQUE_ID -1
+
+typedef struct _PERF_INSTANCE_DEFINITION
+{
+ DWORD ByteLength;
+ DWORD ParentObjectTitleIndex;
+ DWORD ParentObjectInstance;
+ LONG UniqueID;
+ DWORD NameOffset;
+ DWORD NameLength;
+} PERF_INSTANCE_DEFINITION, *PPERF_INSTANCE_DEFINITION;
+
+typedef struct _PERF_COUNTER_BLOCK
+{
+ DWORD ByteLength;
+} PERF_COUNTER_BLOCK, *PPERF_COUNTER_BLOCK;
+
+
+#include <poppack.h>
+
+typedef DWORD (APIENTRY PM_OPEN_PROC)(LPWSTR);
+typedef DWORD (APIENTRY PM_COLLECT_PROC)(LPWSTR,LPVOID *,LPDWORD,LPDWORD);
+typedef DWORD (APIENTRY PM_CLOSE_PROC)(void);
+typedef DWORD (APIENTRY PM_QUERY_PROC)(LPDWORD,LPVOID *,LPDWORD,LPDWORD);
#endif /* _WINPERF_ */
--
2.13.1

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