You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
12d1613d90 | ||
|
3414a0cc0e | ||
|
78204c282f | ||
|
cd3a07933a | ||
|
d7da67b4de | ||
|
9660c304bc | ||
|
f99ef3c9eb | ||
|
6022983803 | ||
|
afb16555cd | ||
|
c8eb156226 | ||
|
cbf392300d | ||
|
f1045ce6bb | ||
|
76f5985038 | ||
|
f3b30373fb | ||
|
1dc5f2f601 | ||
|
ca01e366ef | ||
|
323b73a1f2 | ||
|
428f65dd68 | ||
|
f28931a026 | ||
|
9a74e72f1b | ||
|
869b164ece | ||
|
f5f1c89973 | ||
|
092a14a3f6 | ||
|
ab06aee23d | ||
|
b1ede54d23 | ||
|
3fe5ad7aef | ||
|
3e9b40f5b6 | ||
|
c0bdcaecf5 | ||
|
cc04af2457 | ||
|
68bdb355dc | ||
|
9e203d3b8f | ||
|
b5534bc463 | ||
|
84aaa8ff12 | ||
|
79253e6534 | ||
|
67f1219393 | ||
|
1de318660f | ||
|
b8546ff85a | ||
|
faac0015a6 | ||
|
2c35b17c61 | ||
|
671aa4f38e | ||
|
e7fceb902c | ||
|
e265cf1024 | ||
|
6b398014f2 | ||
|
dcc8c25285 | ||
|
8f49524c86 | ||
|
288c9a031d | ||
|
c97628a0e5 | ||
|
03a15069bc | ||
|
e95a773114 |
29
README.md
29
README.md
@@ -39,7 +39,7 @@ Wine. All those differences are also documented on the
|
||||
Included bug fixes and improvements
|
||||
-----------------------------------
|
||||
|
||||
**Bug fixes and features in Wine Staging 1.7.49 [235]:**
|
||||
**Bug fixes and features in Wine Staging 1.7.50 [242]:**
|
||||
|
||||
*Note: The following list only contains features and bug fixes which are not
|
||||
yet available in vanilla Wine. They are removed from the list as soon as they
|
||||
@@ -49,6 +49,7 @@ releases, take a look at the
|
||||
for more details.*
|
||||
|
||||
* Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest ([Wine Bug #28911](https://bugs.winehq.org/show_bug.cgi?id=28911))
|
||||
* Add IDragSourceHelper stub interface ([Wine Bug #24699](https://bugs.winehq.org/show_bug.cgi?id=24699))
|
||||
* Add a ProfileList\<UserSID> registry subkey ([Wine Bug #15670](https://bugs.winehq.org/show_bug.cgi?id=15670))
|
||||
* Add implementation for mfplat.MFTRegister ([Wine Bug #37811](https://bugs.winehq.org/show_bug.cgi?id=37811))
|
||||
* Add implementation for shlwapi.AssocGetPerceivedType
|
||||
@@ -73,7 +74,6 @@ for more details.*
|
||||
* Add stub for winscard.SCardListReadersA/W ([Wine Bug #26978](https://bugs.winehq.org/show_bug.cgi?id=26978))
|
||||
* Add stub for winsta.WinStationEnumerateW ([Wine Bug #38102](https://bugs.winehq.org/show_bug.cgi?id=38102))
|
||||
* Add stubbed ISWbemSecurity interfaces in wbemdisp
|
||||
* Add stubs for D3DCompile2 and D3DCompileFromFile
|
||||
* Add stubs for D3DXCreateAnimationController interface
|
||||
* Add stubs for additional wininet options in InternetSetOption
|
||||
* Add stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W ([Wine Bug #27739](https://bugs.winehq.org/show_bug.cgi?id=27739))
|
||||
@@ -104,10 +104,12 @@ for more details.*
|
||||
* Black & White needs DXTn software decoding support ([Wine Bug #14939](https://bugs.winehq.org/show_bug.cgi?id=14939))
|
||||
* CPU-Z fails to start because GetLogicalProcessorInformationEx returns FALSE
|
||||
* Calculate msvcrt exponential math operations with higher precision ([Wine Bug #37149](https://bugs.winehq.org/show_bug.cgi?id=37149))
|
||||
* Catch invalid memory accesses in imagehlp.CheckSumMappedFile
|
||||
* Check architecture before trying to load libraries ([Wine Bug #38021](https://bugs.winehq.org/show_bug.cgi?id=38021))
|
||||
* Create stub files for system32/drivers/etc/{services,hosts,networks,protocol} ([Wine Bug #12076](https://bugs.winehq.org/show_bug.cgi?id=12076))
|
||||
* CreateProcess does not prioritize the working directory over the system search path ([Wine Bug #23934](https://bugs.winehq.org/show_bug.cgi?id=23934))
|
||||
* D3DCompileShader should filter specific warning messages ([Wine Bug #33770](https://bugs.winehq.org/show_bug.cgi?id=33770))
|
||||
* Do not allow to deallocate thread stack for current thread
|
||||
* Do not fail when a used context is passed to wglShareLists ([Wine Bug #11436](https://bugs.winehq.org/show_bug.cgi?id=11436))
|
||||
* Do not use unixfs for devices without mountpoint
|
||||
* Enforce that surfaces are flushed after ReleaseDC
|
||||
@@ -127,6 +129,7 @@ for more details.*
|
||||
* Fix crash in Space Rangers2 caused by missing DXTn support ([Wine Bug #24983](https://bugs.winehq.org/show_bug.cgi?id=24983))
|
||||
* Fix crash of winedevice when relocation entry crosses page boundary ([Wine Bug #28254](https://bugs.winehq.org/show_bug.cgi?id=28254))
|
||||
* Fix cursor clip regression / broken raw input in multiple games ([Wine Bug #33479](https://bugs.winehq.org/show_bug.cgi?id=33479))
|
||||
* Fix detection of case-insensitive systems in MSYS2
|
||||
* Fix device paths in HKLM\SYSTEM\MountedDevices ([Wine Bug #38235](https://bugs.winehq.org/show_bug.cgi?id=38235))
|
||||
* Fix endless loop in regedit when importing files with very long lines
|
||||
* Fix flickering introduced by pixelformat changes. ([Wine Bug #35718](https://bugs.winehq.org/show_bug.cgi?id=35718))
|
||||
@@ -137,13 +140,12 @@ for more details.*
|
||||
* Fix handling of ANSI NTLM credentials ([Wine Bug #37063](https://bugs.winehq.org/show_bug.cgi?id=37063))
|
||||
* Fix handling of empty section and key name for profile files. ([Wine Bug #8036](https://bugs.winehq.org/show_bug.cgi?id=8036))
|
||||
* Fix handling of invert_y in DrawTextExW ([Wine Bug #22109](https://bugs.winehq.org/show_bug.cgi?id=22109))
|
||||
* Fix handling of opening a file with RootDirectory pointing to a file handle
|
||||
* Fix handling of opening read-only files for FILE_DELETE_ON_CLOSE ([Wine Bug #38417](https://bugs.winehq.org/show_bug.cgi?id=38417))
|
||||
* Fix handling of window attributes for WS_EX_LAYERED | WS_EX_COMPOSITED ([Wine Bug #37876](https://bugs.winehq.org/show_bug.cgi?id=37876))
|
||||
* Fix implementation of msvcrt.close when stdout == stderr
|
||||
* Fix issues with dragging layers between images in Adobe Photoshop 7.0 ([Wine Bug #12007](https://bugs.winehq.org/show_bug.cgi?id=12007))
|
||||
* Fix missing video introduced by pixelformat changes. ([Wine Bug #36900](https://bugs.winehq.org/show_bug.cgi?id=36900))
|
||||
* Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087))
|
||||
* Fix possible integer overflow in VarR4FromDec ([Wine Bug #38988](https://bugs.winehq.org/show_bug.cgi?id=38988))
|
||||
* Fix possible segfault in pulse_rd_loop of PulseAudio backend
|
||||
* Fix race-condition when threads are killed during shutdown
|
||||
* Fix regression caused by blacklisting supported OpenGL extensions ([Wine Bug #38480](https://bugs.winehq.org/show_bug.cgi?id=38480))
|
||||
@@ -174,6 +176,7 @@ for more details.*
|
||||
* Implement combase.WindowsSubstring function
|
||||
* Implement default homepage button in inetcpl.cpl
|
||||
* Implement empty enumerator for IWiaDevMgr::EnumDeviceInfo ([Wine Bug #27775](https://bugs.winehq.org/show_bug.cgi?id=27775))
|
||||
* Implement enumeration of sound devices and basic properties to dxdiagn ([Wine Bug #32613](https://bugs.winehq.org/show_bug.cgi?id=32613))
|
||||
* Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042))
|
||||
* Implement general tab for file property dialog
|
||||
* Implement locking and synchronization of key states ([Wine Bug #31899](https://bugs.winehq.org/show_bug.cgi?id=31899))
|
||||
@@ -181,12 +184,14 @@ for more details.*
|
||||
* Implement ntoskrnl driver testing framework.
|
||||
* Implement ntoskrnl.KeInitializeMutex
|
||||
* Implement proper handling of CLI .NET images in Wine library loader ([Wine Bug #38661](https://bugs.winehq.org/show_bug.cgi?id=38661))
|
||||
* Implement shell32 NewMenu class with new folder item ([Wine Bug #24812](https://bugs.winehq.org/show_bug.cgi?id=24812))
|
||||
* Implement special handling for calling GetChildContainer with an empty string ([Wine Bug #38014](https://bugs.winehq.org/show_bug.cgi?id=38014))
|
||||
* Implement stub for ntoskrnl.IoGetAttachedDeviceReference
|
||||
* Implement stub for ntoskrnl.KeDelayExecutionThread.
|
||||
* Implement stub for vcomp._vcomp_flush ([Wine Bug #39058](https://bugs.winehq.org/show_bug.cgi?id=39058))
|
||||
* Implement stubs for ntoskrnl.Ex{Acquire,Release}FastMutexUnsafe
|
||||
* Implement stubs for ntoskrnl.ObReferenceObjectByPointer and ntoskrnl.ObDereferenceObject
|
||||
* Improve ReadDataAvailable handling in FilePipeLocalInformation class
|
||||
* Improve startup performance by delaying font initialization
|
||||
* Improve stub for AEV_GetVolumeRange ([Wine Bug #35658](https://bugs.winehq.org/show_bug.cgi?id=35658))
|
||||
* Improve stub for ID3DXEffectImpl_CloneEffect
|
||||
* Improve stub for NtQueryEaFile
|
||||
@@ -201,15 +206,20 @@ for more details.*
|
||||
* MSYS2 expects correct handling of WRITECOPY memory protection ([Wine Bug #35561](https://bugs.winehq.org/show_bug.cgi?id=35561))
|
||||
* Make it possible to change media center / tablet pc status ([Wine Bug #18732](https://bugs.winehq.org/show_bug.cgi?id=18732))
|
||||
* MediaCoder needs CUDA for video encoding ([Wine Bug #37664](https://bugs.winehq.org/show_bug.cgi?id=37664))
|
||||
* Move cookie initialization code from memory management to loader ([Wine Bug #39040](https://bugs.winehq.org/show_bug.cgi?id=39040))
|
||||
* Multiple applications need EnumDisplayDevicesW implementation ([Wine Bug #34978](https://bugs.winehq.org/show_bug.cgi?id=34978))
|
||||
* Need for Speed 3 installer requires devices in HKEY_DYN_DATA ([Wine Bug #7115](https://bugs.winehq.org/show_bug.cgi?id=7115))
|
||||
* Notepad should create new files immediately ([Wine Bug #19425](https://bugs.winehq.org/show_bug.cgi?id=19425))
|
||||
* Only set SFGAO_HASSUBFOLDER when there are really subfolders ([Wine Bug #24851](https://bugs.winehq.org/show_bug.cgi?id=24851))
|
||||
* Other Pipelight-specific enhancements
|
||||
* Port Royale doesn't display ocean correctly ([Wine Bug #17913](https://bugs.winehq.org/show_bug.cgi?id=17913))
|
||||
* Prevent window managers from grouping all wine programs together ([Wine Bug #32699](https://bugs.winehq.org/show_bug.cgi?id=32699))
|
||||
* Process APC calls before starting process
|
||||
* Process Hacker 2.x needs ntoskrnl.ProbeForRead ([Wine Bug #38103](https://bugs.winehq.org/show_bug.cgi?id=38103))
|
||||
* Properly implement imagehlp.ImageLoad and ImageUnload
|
||||
* Reduced SetTimer minimum value from 10 ms to 5 ms (improves Silverlight framerates)
|
||||
* Report correct ObjectName for NamedPipe wineserver objects
|
||||
* Return STATUS_OBJECT_NAME_INVALID in wine_nt_to_unix_file_name for paths that only contain a prefix ([Wine Bug #39133](https://bugs.winehq.org/show_bug.cgi?id=39133))
|
||||
* Return a valid mesh in D3DXCreateTeapot ([Wine Bug #36884](https://bugs.winehq.org/show_bug.cgi?id=36884))
|
||||
* Return an error when trying to open a terminated process ([Wine Bug #37087](https://bugs.winehq.org/show_bug.cgi?id=37087))
|
||||
* Return correct IMediaSeeking stream positions in quartz
|
||||
* Return correct values for GetThreadTimes function ([Wine Bug #20230](https://bugs.winehq.org/show_bug.cgi?id=20230))
|
||||
@@ -220,6 +230,7 @@ for more details.*
|
||||
* SO_CONNECT_TIME returns the appropriate time
|
||||
* Scrolling causes mouse and screen to lock in Call to Power II ([Wine Bug #34559](https://bugs.winehq.org/show_bug.cgi?id=34559))
|
||||
* Send WM_PAINT event during dialog creation ([Wine Bug #35652](https://bugs.winehq.org/show_bug.cgi?id=35652))
|
||||
* Set EOF on file which has a memory mapping should fail
|
||||
* Set NamedPipeState to FILE_PIPE_CLOSING_STATE on broken pipe in NtQueryInformationFile
|
||||
* Share source of d3dx9_36 with d3dx9_33 to avoid Wine DLL forwards ([Wine Bug #21817](https://bugs.winehq.org/show_bug.cgi?id=21817))
|
||||
* Show unmounted devices in winecfg and allow changing the unix path
|
||||
@@ -227,7 +238,6 @@ for more details.*
|
||||
* Silence repeated wbemprox "timeout not supported" fixme ([Wine Bug #37618](https://bugs.winehq.org/show_bug.cgi?id=37618))
|
||||
* Skip unknown item when decoding a CMS certificate ([Wine Bug #34388](https://bugs.winehq.org/show_bug.cgi?id=34388))
|
||||
* Software support for Environmental Audio Extensions (EAX)
|
||||
* Store registry timestamps with nanoseconds precision ([Wine Bug #38927](https://bugs.winehq.org/show_bug.cgi?id=38927))
|
||||
* Super Mario 3: Mario Forever fails to load keyboard mapping from profile files. ([Wine Bug #18099](https://bugs.winehq.org/show_bug.cgi?id=18099))
|
||||
* Support for AllocateAndGetTcpExTableFromStack ([Wine Bug #34372](https://bugs.winehq.org/show_bug.cgi?id=34372))
|
||||
* Support for BindImageEx ([Wine Bug #3591](https://bugs.winehq.org/show_bug.cgi?id=3591))
|
||||
@@ -247,9 +257,6 @@ for more details.*
|
||||
* Support for MPEG2 DXVA2 GPU video decoding through vaapi
|
||||
* Support for NVIDIA video encoder library (nvencodeapi)
|
||||
* Support for NtQuerySection ([Wine Bug #37338](https://bugs.winehq.org/show_bug.cgi?id=37338))
|
||||
* Support for NtSetInformationFile class FileDispositionInformation ([Wine Bug #30397](https://bugs.winehq.org/show_bug.cgi?id=30397))
|
||||
* Support for NtSetInformationFile class FileLinkInformation
|
||||
* Support for NtSetInformationFile class FileRenameInformation ([Wine Bug #30399](https://bugs.winehq.org/show_bug.cgi?id=30399))
|
||||
* Support for PulseAudio backend for audio ([Wine Bug #10495](https://bugs.winehq.org/show_bug.cgi?id=10495))
|
||||
* Support for SHCreateSessionKey ([Wine Bug #35630](https://bugs.winehq.org/show_bug.cgi?id=35630))
|
||||
* Support for TransmitFile ([Wine Bug #5048](https://bugs.winehq.org/show_bug.cgi?id=5048))
|
||||
@@ -273,11 +280,11 @@ for more details.*
|
||||
* Use NVX_GPU_MEMORY_INFO extension for more exact video memory accounting on NVIDIA graphic cards
|
||||
* Use POSIX implementation to enumerate directory content on FreeBSD ([Wine Bug #35397](https://bugs.winehq.org/show_bug.cgi?id=35397))
|
||||
* Use actual program name if available to describe PulseAudio streams
|
||||
* Use helper function for NtWaitForMultipleObjects and NtWaitForSingleObject ([Wine Bug #39127](https://bugs.winehq.org/show_bug.cgi?id=39127))
|
||||
* Use manual relay for RunDLL_CallEntry16 in shell32 ([Wine Bug #23033](https://bugs.winehq.org/show_bug.cgi?id=23033))
|
||||
* Use video memory for rendering targets if possible ([Wine Bug #34906](https://bugs.winehq.org/show_bug.cgi?id=34906))
|
||||
* Voobly expects correct handling of WRITECOPY memory protection ([Wine Bug #29384](https://bugs.winehq.org/show_bug.cgi?id=29384))
|
||||
* Wine ignores IDF_CHECKFIRST flag in SetupPromptForDisk ([Wine Bug #20465](https://bugs.winehq.org/show_bug.cgi?id=20465))
|
||||
* Winhttp raw request headers must be terminated using double \r\n ([Wine Bug #35953](https://bugs.winehq.org/show_bug.cgi?id=35953))
|
||||
* Workaround for shlwapi URLs with relative paths
|
||||
* XEMBED support for embedding Wine windows inside Linux applications
|
||||
* eRacer Demo doesn't correctly display text ([Wine Bug #29598](https://bugs.winehq.org/show_bug.cgi?id=29598))
|
||||
|
52
debian/changelog
vendored
52
debian/changelog
vendored
@@ -1,3 +1,55 @@
|
||||
wine-staging (1.7.50) unstable; urgency=low
|
||||
* Updated GTK3 patchset to fix "division by zero" exception errors (fixes Wine
|
||||
Staging Bug #523).
|
||||
* Add patch to implement remaining OpenMP locking functions.
|
||||
* Added various patches for imagehlp cleanup (fixes Wine Staging Bug #502).
|
||||
* Added patch to fix implementation of ntdll.MapViewOfSection.
|
||||
* Added patch to implement enumeration of sound devices and basic properties
|
||||
to dxdiagn.
|
||||
* Added patch to implement special handling for calling GetChildContainer with
|
||||
an empty string.
|
||||
* Added patch for shell32 IDragSourceHelper stub interface.
|
||||
* Added patch to improve startup performance by delaying font initialization
|
||||
(fixes Wine Staging Bug #401).
|
||||
* Added patch to set SFGAO_HASSUBFOLDER only when there are really subfolders.
|
||||
* Added patch to fix multiple uninitialized memory issues in wineserver.
|
||||
* Added patch to implement shell32 NewMenu class with new folder item.
|
||||
* Added patch to report correct ObjectName for NamedPipe wineserver objects
|
||||
(fixes Wine Staging Bug #363).
|
||||
* Added patch fix detection of case-insensitive systems in MSYS2.
|
||||
* Added patch to fix implementation of krnl386.exe16.GetTempDrive.
|
||||
* Added patch for forward/backward compatibility of previous format of high
|
||||
precision registry timestamps.
|
||||
* Added patch to use a helper function for NtWaitForMultipleObjects and
|
||||
NtWaitForSingleObject.
|
||||
* Added patch to block deallocation of thread stack for current thread (fixes
|
||||
Wine Staging Bug #241).
|
||||
* Added patch to reject setting EOF on memory mapped files (fixes Wine Staging
|
||||
Bug #471).
|
||||
* Added patch to fix implementation of msvcrt.close when stdout == stderr
|
||||
(fixes Wine Staging Bug #485).
|
||||
* Added patch to return STATUS_OBJECT_NAME_INVALID in
|
||||
wine_nt_to_unix_file_name for paths that only contain a prefix.
|
||||
* Added patch to make sure Notepad creates new files immediately.
|
||||
* Added patch to return a valid mesh in D3DXCreateTeapot.
|
||||
* Removed patch to move security cookie initialization from memory management
|
||||
to loader (accepted upstream).
|
||||
* Removed patches for stub of D3DCompileFromFile and D3DCompile2 (accepted
|
||||
upstream).
|
||||
* Removed patch to fix multiple uninitialized memory issues in wineserver.
|
||||
* Removed patch fix implementation of ntdll.NtMapViewOfSection (accepted
|
||||
upstream).
|
||||
* Removed patches to implement additional vcomp functions (accepted upstream).
|
||||
* Removed patch to store registry timestamps with nanoseconds precision (fixed
|
||||
upstream).
|
||||
* Removed patch to ensure winhttp raw request headers are terminated with
|
||||
double \r\n (accepted upstream).
|
||||
* Removed compatibility patchset for deprecated ACL string format. The format
|
||||
was changed in version 1.7.25, released about one year ago.
|
||||
* Removed patches for FileDispositionInformation and FileRenameInformation
|
||||
(accepted upstream).
|
||||
-- Sebastian Lackner <sebastian@fds-team.de> Sun, 23 Aug 2015 02:10:01 +0200
|
||||
|
||||
wine-staging (1.7.49) unstable; urgency=low
|
||||
* Added patch to improve stubs for dxgi MakeWindowAssociation and
|
||||
GetWindowAssociation.
|
||||
|
10
debian/tools/patchupdate.py
vendored
10
debian/tools/patchupdate.py
vendored
@@ -436,7 +436,7 @@ def resolve_dependencies(all_patches, index = None, depends = None):
|
||||
"""Returns a sorted list with all dependencies for a given patch."""
|
||||
|
||||
def _resolve(depends):
|
||||
for i in depends:
|
||||
for i in sorted(depends):
|
||||
# Check for disabled patch
|
||||
if all_patches[i].disabled:
|
||||
raise PatchUpdaterError("Encountered dependency on disabled patchset %s" % all_patches[i].name)
|
||||
@@ -682,6 +682,14 @@ def generate_script(all_patches):
|
||||
lines.append("# Patchset %s\n" % patch.name)
|
||||
lines.append("# |\n")
|
||||
|
||||
# List dependencies (if any)
|
||||
if len(patch.depends):
|
||||
depends = resolve_dependencies(all_patches, i)
|
||||
lines.append("# | This patchset has the following (direct or indirect) dependencies:\n")
|
||||
lines.append("# | *\t%s\n" % "\n# | \t".join(textwrap.wrap(
|
||||
", ".join([all_patches[j].name for j in depends]), 120)))
|
||||
lines.append("# |\n")
|
||||
|
||||
# List all bugs fixed by this patchset
|
||||
if any([bugid is not None for bugid, bugname in patch.fixes]):
|
||||
lines.append("# | This patchset fixes the following Wine bugs:\n")
|
||||
|
3
debian/tools/patchutils.py
vendored
3
debian/tools/patchutils.py
vendored
@@ -55,9 +55,6 @@ class PatchObject(object):
|
||||
self.patch_subject = header['subject']
|
||||
self.patch_revision = header['revision'] if header.has_key('revision') else 1
|
||||
|
||||
# self.extracted_patch = None
|
||||
self.unique_hash = None
|
||||
|
||||
self.filename = filename
|
||||
self.offset_begin = None
|
||||
self.offset_end = None
|
||||
|
@@ -1,57 +0,0 @@
|
||||
From 13f3dd44fe48a06d9b8dafd4b499383cf17ff3e9 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 23 Jul 2015 19:09:32 +1000
|
||||
Subject: d3dcompiler_43: Add D3DCompileFromFile stub. (try 3)
|
||||
|
||||
---
|
||||
dlls/d3dcompiler_43/compiler.c | 9 +++++++++
|
||||
dlls/d3dcompiler_46/d3dcompiler_46.spec | 2 +-
|
||||
dlls/d3dcompiler_47/d3dcompiler_47.spec | 2 +-
|
||||
3 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
|
||||
index 114b4c1..5dce856 100644
|
||||
--- a/dlls/d3dcompiler_43/compiler.c
|
||||
+++ b/dlls/d3dcompiler_43/compiler.c
|
||||
@@ -763,3 +763,12 @@ HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T size, UINT flags, const c
|
||||
data, size, flags, comments, disassembly);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
+
|
||||
+HRESULT WINAPI D3DCompileFromFile(const WCHAR *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *includes,
|
||||
+ const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors)
|
||||
+{
|
||||
+ FIXME("filename %s, defines %p, includes %p, entrypoint %s, target %s, flags1 %x, flags2 %x, code %p, errors %p\n",
|
||||
+ debugstr_w(filename), defines, includes, debugstr_a(entrypoint), debugstr_a(target), flags1, flags2, code, errors);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
diff --git a/dlls/d3dcompiler_46/d3dcompiler_46.spec b/dlls/d3dcompiler_46/d3dcompiler_46.spec
|
||||
index 5811b40..e36a8c0 100644
|
||||
--- a/dlls/d3dcompiler_46/d3dcompiler_46.spec
|
||||
+++ b/dlls/d3dcompiler_46/d3dcompiler_46.spec
|
||||
@@ -1,7 +1,7 @@
|
||||
@ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr)
|
||||
@ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr)
|
||||
@ stub D3DCompile2
|
||||
-@ stub D3DCompileFromFile
|
||||
+@ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr)
|
||||
@ stub D3DCompressShaders
|
||||
@ stdcall D3DCreateBlob(long ptr)
|
||||
@ stub D3DDecompressShaders
|
||||
diff --git a/dlls/d3dcompiler_47/d3dcompiler_47.spec b/dlls/d3dcompiler_47/d3dcompiler_47.spec
|
||||
index 40ad977..a0df93e 100644
|
||||
--- a/dlls/d3dcompiler_47/d3dcompiler_47.spec
|
||||
+++ b/dlls/d3dcompiler_47/d3dcompiler_47.spec
|
||||
@@ -1,7 +1,7 @@
|
||||
@ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr)
|
||||
@ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr)
|
||||
@ stub D3DCompile2
|
||||
-@ stub D3DCompileFromFile
|
||||
+@ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr)
|
||||
@ stub D3DCompressShaders
|
||||
@ stdcall D3DCreateBlob(long ptr)
|
||||
@ stub D3DCreateFunctionLinkingGraph
|
||||
--
|
||||
2.4.5
|
||||
|
@@ -1,90 +0,0 @@
|
||||
From 8e9d8ee497c06533082707f091339a20f2af5be1 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Wed, 29 Jul 2015 17:58:02 +0200
|
||||
Subject: d3dcompiler_43: Implement semi-stub for D3DCompile2.
|
||||
|
||||
---
|
||||
dlls/d3dcompiler_43/compiler.c | 28 ++++++++++++++++++++++++----
|
||||
dlls/d3dcompiler_46/d3dcompiler_46.spec | 2 +-
|
||||
dlls/d3dcompiler_47/d3dcompiler_47.spec | 2 +-
|
||||
3 files changed, 26 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
|
||||
index 5dce856..33ef916 100644
|
||||
--- a/dlls/d3dcompiler_43/compiler.c
|
||||
+++ b/dlls/d3dcompiler_43/compiler.c
|
||||
@@ -692,16 +692,23 @@ static HRESULT compile_shader(const char *preproc_shader, const char *target, co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
-HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
|
||||
+HRESULT WINAPI D3DCompile2(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)
|
||||
+ const char *target, UINT sflags, UINT eflags, UINT secondary_flags,
|
||||
+ const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader,
|
||||
+ ID3DBlob **error_messages)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n"
|
||||
- "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n",
|
||||
+ "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p,\n"
|
||||
+ "secondary_data_size %lu, shader %p, error_messages %p\n",
|
||||
data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
|
||||
- debugstr_a(target), sflags, eflags, shader, error_messages);
|
||||
+ debugstr_a(target), sflags, eflags, secondary_flags, secondary_data,
|
||||
+ secondary_data_size, shader, error_messages);
|
||||
+
|
||||
+ if (secondary_data)
|
||||
+ FIXME("secondary data not implemented yet\n");
|
||||
|
||||
if (shader) *shader = NULL;
|
||||
if (error_messages) *error_messages = NULL;
|
||||
@@ -717,6 +724,19 @@ HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filena
|
||||
return hr;
|
||||
}
|
||||
|
||||
+HRESULT WINAPI D3DCompile(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)
|
||||
+{
|
||||
+ TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n"
|
||||
+ "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n",
|
||||
+ data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
|
||||
+ debugstr_a(target), sflags, eflags, shader, error_messages);
|
||||
+
|
||||
+ return D3DCompile2(data, data_size, filename, defines, include, entrypoint, target, sflags,
|
||||
+ eflags, 0, NULL, 0, shader, error_messages);
|
||||
+}
|
||||
+
|
||||
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename,
|
||||
const D3D_SHADER_MACRO *defines, ID3DInclude *include,
|
||||
ID3DBlob **shader, ID3DBlob **error_messages)
|
||||
diff --git a/dlls/d3dcompiler_46/d3dcompiler_46.spec b/dlls/d3dcompiler_46/d3dcompiler_46.spec
|
||||
index e36a8c0..1b145c8a 100644
|
||||
--- a/dlls/d3dcompiler_46/d3dcompiler_46.spec
|
||||
+++ b/dlls/d3dcompiler_46/d3dcompiler_46.spec
|
||||
@@ -1,6 +1,6 @@
|
||||
@ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr)
|
||||
@ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr)
|
||||
-@ stub D3DCompile2
|
||||
+@ stdcall D3DCompile2(ptr long str ptr ptr str str long long long ptr long ptr ptr)
|
||||
@ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr)
|
||||
@ stub D3DCompressShaders
|
||||
@ stdcall D3DCreateBlob(long ptr)
|
||||
diff --git a/dlls/d3dcompiler_47/d3dcompiler_47.spec b/dlls/d3dcompiler_47/d3dcompiler_47.spec
|
||||
index a0df93e..efa4767 100644
|
||||
--- a/dlls/d3dcompiler_47/d3dcompiler_47.spec
|
||||
+++ b/dlls/d3dcompiler_47/d3dcompiler_47.spec
|
||||
@@ -1,6 +1,6 @@
|
||||
@ stdcall D3DAssemble(ptr long str ptr ptr long ptr ptr)
|
||||
@ stdcall D3DCompile(ptr long str ptr ptr str str long long ptr ptr)
|
||||
-@ stub D3DCompile2
|
||||
+@ stdcall D3DCompile2(ptr long str ptr ptr str str long long long ptr long ptr ptr)
|
||||
@ stdcall D3DCompileFromFile(wstr ptr ptr str str long long ptr ptr)
|
||||
@ stub D3DCompressShaders
|
||||
@ stdcall D3DCreateBlob(long ptr)
|
||||
--
|
||||
2.4.5
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: Add stubs for D3DCompile2 and D3DCompileFromFile
|
@@ -0,0 +1,26 @@
|
||||
From 34607775675c9475973fd249b8a68a59935b0391 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 30 Jul 2015 11:57:28 +1000
|
||||
Subject: d3dx9_36: Return a mesh in D3DXCreateTeapot
|
||||
|
||||
Fixes https://bugs.winehq.org/show_bug.cgi?id=36884
|
||||
---
|
||||
dlls/d3dx9_36/mesh.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
|
||||
index 39d279d..59e385e4 100644
|
||||
--- a/dlls/d3dx9_36/mesh.c
|
||||
+++ b/dlls/d3dx9_36/mesh.c
|
||||
@@ -5153,7 +5153,7 @@ HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device,
|
||||
{
|
||||
FIXME("(%p, %p, %p): stub\n", device, mesh, adjacency);
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ return D3DXCreateSphere(device, 1.0f, 4, 4, mesh, adjacency);
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation,
|
||||
--
|
||||
2.5.0
|
||||
|
1
patches/d3dx9_36-D3DXCreateTeapot/definition
Normal file
1
patches/d3dx9_36-D3DXCreateTeapot/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [36884] Return a valid mesh in D3DXCreateTeapot
|
@@ -0,0 +1,317 @@
|
||||
From b9c35ad92af95d7ee45a698d7282fd896247c128 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 15 Aug 2015 02:59:17 +0200
|
||||
Subject: dxdiagn: Enumerate DirectSound devices and add some basic properties.
|
||||
|
||||
---
|
||||
dlls/dxdiagn/Makefile.in | 2 +-
|
||||
dlls/dxdiagn/provider.c | 91 ++++++++++++++++++++++++++
|
||||
dlls/dxdiagn/tests/container.c | 141 +++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 233 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dxdiagn/Makefile.in b/dlls/dxdiagn/Makefile.in
|
||||
index df3fc77..9d67410 100644
|
||||
--- a/dlls/dxdiagn/Makefile.in
|
||||
+++ b/dlls/dxdiagn/Makefile.in
|
||||
@@ -1,5 +1,5 @@
|
||||
MODULE = dxdiagn.dll
|
||||
-IMPORTS = strmiids dxguid uuid d3d9 ddraw version ole32 oleaut32 psapi user32 advapi32
|
||||
+IMPORTS = strmiids dxguid uuid d3d9 ddraw version ole32 oleaut32 psapi user32 advapi32 dsound
|
||||
|
||||
C_SRCS = \
|
||||
container.c \
|
||||
diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c
|
||||
index 3b5fcab..a5f06e3 100644
|
||||
--- a/dlls/dxdiagn/provider.c
|
||||
+++ b/dlls/dxdiagn/provider.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "fil_data.h"
|
||||
#include "psapi.h"
|
||||
#include "wbemcli.h"
|
||||
+#include "dsound.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
@@ -1189,11 +1190,85 @@ static HRESULT build_displaydevices_tree(IDxDiagContainerImpl_Container *node)
|
||||
return fill_display_information_fallback(node);
|
||||
}
|
||||
|
||||
+struct enum_context
|
||||
+{
|
||||
+ IDxDiagContainerImpl_Container *cont;
|
||||
+ HRESULT hr;
|
||||
+ int index;
|
||||
+};
|
||||
+
|
||||
+static const WCHAR szGUIDFmt[] =
|
||||
+{
|
||||
+ '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%','0',
|
||||
+ '2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2',
|
||||
+ 'x','%','0','2','x','%','0','2','x','%','0','2','x',0
|
||||
+};
|
||||
+
|
||||
+static LPWSTR guid_to_string(LPWSTR lpwstr, REFGUID lpcguid)
|
||||
+{
|
||||
+ wsprintfW(lpwstr, szGUIDFmt, lpcguid->Data1, lpcguid->Data2,
|
||||
+ lpcguid->Data3, lpcguid->Data4[0], lpcguid->Data4[1],
|
||||
+ lpcguid->Data4[2], lpcguid->Data4[3], lpcguid->Data4[4],
|
||||
+ lpcguid->Data4[5], lpcguid->Data4[6], lpcguid->Data4[7]);
|
||||
+
|
||||
+ return lpwstr;
|
||||
+}
|
||||
+
|
||||
+BOOL CALLBACK dsound_enum(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID context)
|
||||
+{
|
||||
+ static const WCHAR deviceid_fmtW[] = {'%','u',0};
|
||||
+ static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
|
||||
+ static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
|
||||
+
|
||||
+ struct enum_context *enum_ctx = context;
|
||||
+ IDxDiagContainerImpl_Container *device;
|
||||
+ WCHAR buffer[256];
|
||||
+ const WCHAR *p, *name;
|
||||
+
|
||||
+ /* the default device is enumerated twice, one time without GUID */
|
||||
+ if (!guid) return TRUE;
|
||||
+
|
||||
+ snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), deviceid_fmtW, enum_ctx->index);
|
||||
+ device = allocate_information_node(buffer);
|
||||
+ if (!device)
|
||||
+ {
|
||||
+ enum_ctx->hr = E_OUTOFMEMORY;
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ add_subcontainer(enum_ctx->cont, device);
|
||||
+
|
||||
+ guid_to_string(buffer, guid);
|
||||
+ enum_ctx->hr = add_bstr_property(device, szGuidDeviceID, buffer);
|
||||
+ if (FAILED(enum_ctx->hr))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ enum_ctx->hr = add_bstr_property(device, szDescription, desc);
|
||||
+ if (FAILED(enum_ctx->hr))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ enum_ctx->hr = add_bstr_property(device, szDriverPath, module);
|
||||
+ if (FAILED(enum_ctx->hr))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ name = module;
|
||||
+ if ((p = strrchrW(name, '\\'))) name = p + 1;
|
||||
+ if ((p = strrchrW(name, '/'))) name = p + 1;
|
||||
+
|
||||
+ enum_ctx->hr = add_bstr_property(device, szDriverName, name);
|
||||
+ if (FAILED(enum_ctx->hr))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ enum_ctx->index++;
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node)
|
||||
{
|
||||
static const WCHAR DxDiag_SoundDevices[] = {'D','x','D','i','a','g','_','S','o','u','n','d','D','e','v','i','c','e','s',0};
|
||||
static const WCHAR DxDiag_SoundCaptureDevices[] = {'D','x','D','i','a','g','_','S','o','u','n','d','C','a','p','t','u','r','e','D','e','v','i','c','e','s',0};
|
||||
|
||||
+ struct enum_context enum_ctx;
|
||||
IDxDiagContainerImpl_Container *cont;
|
||||
|
||||
cont = allocate_information_node(DxDiag_SoundDevices);
|
||||
@@ -1202,12 +1277,28 @@ static HRESULT build_directsound_tree(IDxDiagContainerImpl_Container *node)
|
||||
|
||||
add_subcontainer(node, cont);
|
||||
|
||||
+ enum_ctx.cont = cont;
|
||||
+ enum_ctx.hr = S_OK;
|
||||
+ enum_ctx.index = 0;
|
||||
+
|
||||
+ DirectSoundEnumerateW(dsound_enum, &enum_ctx);
|
||||
+ if (FAILED(enum_ctx.hr))
|
||||
+ return enum_ctx.hr;
|
||||
+
|
||||
cont = allocate_information_node(DxDiag_SoundCaptureDevices);
|
||||
if (!cont)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
add_subcontainer(node, cont);
|
||||
|
||||
+ enum_ctx.cont = cont;
|
||||
+ enum_ctx.hr = S_OK;
|
||||
+ enum_ctx.index = 0;
|
||||
+
|
||||
+ DirectSoundCaptureEnumerateW(dsound_enum, &enum_ctx);
|
||||
+ if (FAILED(enum_ctx.hr))
|
||||
+ return enum_ctx.hr;
|
||||
+
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
diff --git a/dlls/dxdiagn/tests/container.c b/dlls/dxdiagn/tests/container.c
|
||||
index 5bc5161..2ffe0fb 100644
|
||||
--- a/dlls/dxdiagn/tests/container.c
|
||||
+++ b/dlls/dxdiagn/tests/container.c
|
||||
@@ -36,6 +36,11 @@ static IDxDiagContainer *pddc;
|
||||
|
||||
static const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0};
|
||||
static const WCHAR DxDiag_DisplayDevices[] = {'D','x','D','i','a','g','_','D','i','s','p','l','a','y','D','e','v','i','c','e','s',0};
|
||||
+static const WCHAR DxDiag_SoundDevices[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d','.',
|
||||
+ 'D','x','D','i','a','g','_','S','o','u','n','d','D','e','v','i','c','e','s',0};
|
||||
+static const WCHAR DxDiag_SoundCaptureDevices[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d','.',
|
||||
+ 'D','x','D','i','a','g','_','S','o','u','n','d','C','a','p','t','u','r','e',
|
||||
+ 'D','e','v','i','c','e','s',0};
|
||||
|
||||
/* Based on debugstr_variant in dlls/jscript/jsutils.c. */
|
||||
static const char *debugstr_variant(const VARIANT *var)
|
||||
@@ -1020,6 +1025,140 @@ cleanup:
|
||||
IDxDiagProvider_Release(pddp);
|
||||
}
|
||||
|
||||
+static void test_DxDiag_SoundDevices(void)
|
||||
+{
|
||||
+ static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0};
|
||||
+ static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
|
||||
+ static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
|
||||
+ static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
|
||||
+
|
||||
+ static const struct property_test property_tests[] =
|
||||
+ {
|
||||
+ {szDescription, VT_BSTR},
|
||||
+ {szGuidDeviceID, VT_BSTR},
|
||||
+ {szDriverName, VT_BSTR},
|
||||
+ {szDriverPath, VT_BSTR},
|
||||
+ };
|
||||
+
|
||||
+ IDxDiagContainer *sound_cont = NULL;
|
||||
+ DWORD count, i;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!create_root_IDxDiagContainer())
|
||||
+ {
|
||||
+ skip("Unable to create the root IDxDiagContainer\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SoundDevices, &sound_cont);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ if (hr != S_OK)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetNumberOfProps(sound_cont, &count);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
|
||||
+ if (hr == S_OK)
|
||||
+ ok(count == 0, "Expected count to be 0, got %u\n", count);
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetNumberOfChildContainers(sound_cont, &count);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ if (hr != S_OK)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ for (i = 0; i < count; i++)
|
||||
+ {
|
||||
+ WCHAR child_container[256];
|
||||
+ IDxDiagContainer *child;
|
||||
+
|
||||
+ hr = IDxDiagContainer_EnumChildContainerNames(sound_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR));
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetChildContainer(sound_cont, child_container, &child);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ if (hr == S_OK)
|
||||
+ {
|
||||
+ trace("Testing container %s\n", wine_dbgstr_w(child_container));
|
||||
+ test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
|
||||
+ }
|
||||
+ IDxDiagContainer_Release(child);
|
||||
+ }
|
||||
+
|
||||
+cleanup:
|
||||
+ if (sound_cont) IDxDiagContainer_Release(sound_cont);
|
||||
+ IDxDiagContainer_Release(pddc);
|
||||
+ IDxDiagProvider_Release(pddp);
|
||||
+}
|
||||
+
|
||||
+static void test_DxDiag_SoundCaptureDevices(void)
|
||||
+{
|
||||
+ static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0};
|
||||
+ static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
|
||||
+ static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
|
||||
+ static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
|
||||
+
|
||||
+ static const struct property_test property_tests[] =
|
||||
+ {
|
||||
+ {szDescription, VT_BSTR},
|
||||
+ {szGuidDeviceID, VT_BSTR},
|
||||
+ {szDriverName, VT_BSTR},
|
||||
+ {szDriverPath, VT_BSTR},
|
||||
+ };
|
||||
+
|
||||
+ IDxDiagContainer *sound_cont = NULL;
|
||||
+ DWORD count, i;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!create_root_IDxDiagContainer())
|
||||
+ {
|
||||
+ skip("Unable to create the root IDxDiagContainer\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SoundCaptureDevices, &sound_cont);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ if (hr != S_OK)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetNumberOfProps(sound_cont, &count);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
|
||||
+ if (hr == S_OK)
|
||||
+ ok(count == 0, "Expected count to be 0, got %u\n", count);
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetNumberOfChildContainers(sound_cont, &count);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ if (hr != S_OK)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ for (i = 0; i < count; i++)
|
||||
+ {
|
||||
+ WCHAR child_container[256];
|
||||
+ IDxDiagContainer *child;
|
||||
+
|
||||
+ hr = IDxDiagContainer_EnumChildContainerNames(sound_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR));
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ hr = IDxDiagContainer_GetChildContainer(sound_cont, child_container, &child);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
+
|
||||
+ if (hr == S_OK)
|
||||
+ {
|
||||
+ trace("Testing container %s\n", wine_dbgstr_w(child_container));
|
||||
+ test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
|
||||
+ }
|
||||
+ IDxDiagContainer_Release(child);
|
||||
+ }
|
||||
+
|
||||
+cleanup:
|
||||
+ if (sound_cont) IDxDiagContainer_Release(sound_cont);
|
||||
+ IDxDiagContainer_Release(pddc);
|
||||
+ IDxDiagProvider_Release(pddp);
|
||||
+}
|
||||
+
|
||||
START_TEST(container)
|
||||
{
|
||||
CoInitialize(NULL);
|
||||
@@ -1034,5 +1173,7 @@ START_TEST(container)
|
||||
test_root_children();
|
||||
test_DxDiag_SystemInfo();
|
||||
test_DxDiag_DisplayDevices();
|
||||
+ test_DxDiag_SoundDevices();
|
||||
+ test_DxDiag_SoundCaptureDevices();
|
||||
CoUninitialize();
|
||||
}
|
||||
--
|
||||
2.5.0
|
||||
|
1
patches/dxdiagn-Enumerate_DirectSound/definition
Normal file
1
patches/dxdiagn-Enumerate_DirectSound/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [32613] Implement enumeration of sound devices and basic properties to dxdiagn
|
@@ -0,0 +1,122 @@
|
||||
From 0b45d42b25aecc86e19aba20d9114b4c76947c9c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 15 Aug 2015 03:58:04 +0200
|
||||
Subject: dxdiagn: Calling GetChildContainer with an empty string on a leaf
|
||||
container returns the object itself
|
||||
|
||||
---
|
||||
dlls/dxdiagn/container.c | 12 ++++++++++--
|
||||
dlls/dxdiagn/tests/container.c | 25 +++++++++++++++++++++++--
|
||||
2 files changed, 33 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/dxdiagn/container.c b/dlls/dxdiagn/container.c
|
||||
index d167043..6e068e5 100644
|
||||
--- a/dlls/dxdiagn/container.c
|
||||
+++ b/dlls/dxdiagn/container.c
|
||||
@@ -162,6 +162,14 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *i
|
||||
if (NULL == tmp) return E_FAIL;
|
||||
lstrcpynW(tmp, pwszContainer, tmp_len);
|
||||
|
||||
+ /* special handling for an empty string and leaf container */
|
||||
+ if (!tmp[0] && list_empty(&pContainer->subContainers)) {
|
||||
+ hr = DXDiag_CreateDXDiagContainer(&IID_IDxDiagContainer, pContainer, This->pProv, (void **)ppInstance);
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ TRACE("Succeeded in getting the container instance\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
cur = strchrW(tmp, '.');
|
||||
while (NULL != cur) {
|
||||
*cur = '\0'; /* cut tmp string to '.' */
|
||||
@@ -169,7 +177,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *i
|
||||
TRACE("Trying to get parent container %s\n", debugstr_w(tmp));
|
||||
hr = IDxDiagContainerImpl_GetChildContainerInternal(pContainer, tmp, &pContainer);
|
||||
if (FAILED(hr))
|
||||
- goto on_error;
|
||||
+ goto out;
|
||||
cur++; /* go after '.' (just replaced by \0) */
|
||||
tmp = cur;
|
||||
cur = strchrW(tmp, '.');
|
||||
@@ -183,7 +191,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(IDxDiagContainer *i
|
||||
TRACE("Succeeded in getting the container instance\n");
|
||||
}
|
||||
|
||||
-on_error:
|
||||
+out:
|
||||
HeapFree(GetProcessHeap(), 0, orig_tmp);
|
||||
return hr;
|
||||
}
|
||||
diff --git a/dlls/dxdiagn/tests/container.c b/dlls/dxdiagn/tests/container.c
|
||||
index 2ffe0fb..aab6122 100644
|
||||
--- a/dlls/dxdiagn/tests/container.c
|
||||
+++ b/dlls/dxdiagn/tests/container.c
|
||||
@@ -901,7 +901,8 @@ static void test_DxDiag_SystemInfo(void)
|
||||
{szProcessorEnglish, VT_BSTR},
|
||||
};
|
||||
|
||||
- IDxDiagContainer *container;
|
||||
+ IDxDiagContainer *container, *container2;
|
||||
+ static const WCHAR empty[] = {0};
|
||||
HRESULT hr;
|
||||
|
||||
if (!create_root_IDxDiagContainer())
|
||||
@@ -910,6 +911,9 @@ static void test_DxDiag_SystemInfo(void)
|
||||
return;
|
||||
}
|
||||
|
||||
+ hr = IDxDiagContainer_GetChildContainer(pddc, empty, &container2);
|
||||
+ ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
|
||||
+
|
||||
hr = IDxDiagContainer_GetChildContainer(pddc, DxDiag_SystemInfo, &container);
|
||||
ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
|
||||
@@ -917,6 +921,14 @@ static void test_DxDiag_SystemInfo(void)
|
||||
{
|
||||
trace("Testing container DxDiag_SystemInfo\n");
|
||||
test_container_properties(container, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
|
||||
+
|
||||
+ container2 = NULL;
|
||||
+ hr = IDxDiagContainer_GetChildContainer(container, empty, &container2);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
+ ok(container2 != NULL, "Expected container2 != NULL\n");
|
||||
+ ok(container2 != container, "Expected container != container2\n");
|
||||
+ if (hr == S_OK) IDxDiagContainer_Release(container2);
|
||||
+
|
||||
IDxDiagContainer_Release(container);
|
||||
}
|
||||
|
||||
@@ -1031,6 +1043,7 @@ static void test_DxDiag_SoundDevices(void)
|
||||
static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
|
||||
static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
|
||||
static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
|
||||
+ static const WCHAR empty[] = {0};
|
||||
|
||||
static const struct property_test property_tests[] =
|
||||
{
|
||||
@@ -1070,7 +1083,7 @@ static void test_DxDiag_SoundDevices(void)
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
WCHAR child_container[256];
|
||||
- IDxDiagContainer *child;
|
||||
+ IDxDiagContainer *child, *child2;
|
||||
|
||||
hr = IDxDiagContainer_EnumChildContainerNames(sound_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR));
|
||||
ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
|
||||
@@ -1083,6 +1096,14 @@ static void test_DxDiag_SoundDevices(void)
|
||||
trace("Testing container %s\n", wine_dbgstr_w(child_container));
|
||||
test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
|
||||
}
|
||||
+
|
||||
+ child2 = NULL;
|
||||
+ hr = IDxDiagContainer_GetChildContainer(child, empty, &child2);
|
||||
+ ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
|
||||
+ ok(child2 != NULL, "Expected child2 != NULL\n");
|
||||
+ ok(child2 != child, "Expected child != child2\n");
|
||||
+ if (hr == S_OK) IDxDiagContainer_Release(child2);
|
||||
+
|
||||
IDxDiagContainer_Release(child);
|
||||
}
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
2
patches/dxdiagn-GetChildContainer_Leaf_Nodes/definition
Normal file
2
patches/dxdiagn-GetChildContainer_Leaf_Nodes/definition
Normal file
@@ -0,0 +1,2 @@
|
||||
Fixes: [38014] Implement special handling for calling GetChildContainer with an empty string
|
||||
Depends: dxdiagn-Enumerate_DirectSound
|
@@ -0,0 +1,170 @@
|
||||
From 029c387205b7a5d0d62df10512ae068980313bc3 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 15 Aug 2015 07:41:17 +0200
|
||||
Subject: gdi32: Perform lazy initialization of fonts to improve startup
|
||||
performance.
|
||||
|
||||
---
|
||||
dlls/gdi32/dc.c | 8 +++-----
|
||||
dlls/gdi32/freetype.c | 48 +++++++++++++++++++++++++++++++++---------------
|
||||
2 files changed, 36 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
|
||||
index 5146f5b..91ad953 100644
|
||||
--- a/dlls/gdi32/dc.c
|
||||
+++ b/dlls/gdi32/dc.c
|
||||
@@ -147,11 +147,9 @@ DC *alloc_dc_ptr( WORD magic )
|
||||
}
|
||||
dc->nulldrv.hdc = dc->hSelf;
|
||||
|
||||
- if (font_driver && !font_driver->pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL ))
|
||||
- {
|
||||
- free_dc_ptr( dc );
|
||||
- return NULL;
|
||||
- }
|
||||
+ if (font_driver)
|
||||
+ font_driver->pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL );
|
||||
+
|
||||
return dc;
|
||||
}
|
||||
|
||||
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
|
||||
index 1187598..446212f 100644
|
||||
--- a/dlls/gdi32/freetype.c
|
||||
+++ b/dlls/gdi32/freetype.c
|
||||
@@ -110,6 +110,9 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(font);
|
||||
|
||||
+static RTL_RUN_ONCE init_once = RTL_RUN_ONCE_INIT;
|
||||
+static DWORD WINAPI freetype_lazy_init(RTL_RUN_ONCE *once, void *param, void **context);
|
||||
+
|
||||
#ifdef HAVE_FREETYPE
|
||||
|
||||
#ifndef HAVE_FT_TRUETYPEENGINETYPE
|
||||
@@ -3112,6 +3115,7 @@ INT WineEngAddFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
|
||||
{
|
||||
INT ret = 0;
|
||||
|
||||
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
|
||||
GDI_CheckNotLock();
|
||||
|
||||
if (ft_handle) /* do it only if we have freetype up and running */
|
||||
@@ -3154,6 +3158,7 @@ INT WineEngAddFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
|
||||
*/
|
||||
HANDLE WineEngAddFontMemResourceEx(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts)
|
||||
{
|
||||
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
|
||||
GDI_CheckNotLock();
|
||||
|
||||
if (ft_handle) /* do it only if we have freetype up and running */
|
||||
@@ -3192,6 +3197,7 @@ BOOL WineEngRemoveFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv)
|
||||
{
|
||||
INT ret = 0;
|
||||
|
||||
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
|
||||
GDI_CheckNotLock();
|
||||
|
||||
if (ft_handle) /* do it only if we have freetype up and running */
|
||||
@@ -3513,10 +3519,13 @@ static BOOL create_fot( const WCHAR *resource, const WCHAR *font_file, const str
|
||||
BOOL WineEngCreateScalableFontResource( DWORD hidden, LPCWSTR resource,
|
||||
LPCWSTR font_file, LPCWSTR font_path )
|
||||
{
|
||||
- char *unix_name = get_ttf_file_name( font_file, font_path );
|
||||
+ char *unix_name;
|
||||
struct fontdir fontdir;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
|
||||
+
|
||||
+ unix_name = get_ttf_file_name( font_file, font_path );
|
||||
if (!unix_name || !get_fontdir( unix_name, &fontdir ))
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
else
|
||||
@@ -3948,8 +3957,6 @@ static BOOL init_freetype(void)
|
||||
FT_SimpleVersion = ((FT_Version.major << 16) & 0xff0000) |
|
||||
((FT_Version.minor << 8) & 0x00ff00) |
|
||||
((FT_Version.patch ) & 0x0000ff);
|
||||
-
|
||||
- font_driver = &freetype_funcs;
|
||||
return TRUE;
|
||||
|
||||
sym_not_found:
|
||||
@@ -4136,20 +4143,12 @@ static void reorder_font_list(void)
|
||||
set_default( default_sans_list );
|
||||
}
|
||||
|
||||
-/*************************************************************
|
||||
- * WineEngInit
|
||||
- *
|
||||
- * Initialize FreeType library and create a list of available faces
|
||||
- */
|
||||
-BOOL WineEngInit(void)
|
||||
+static DWORD WINAPI freetype_lazy_init(RTL_RUN_ONCE *once, void *param, void **context)
|
||||
{
|
||||
DWORD disposition;
|
||||
HANDLE font_mutex;
|
||||
|
||||
- /* update locale dependent font info in registry */
|
||||
- update_font_info();
|
||||
-
|
||||
- if(!init_freetype()) return FALSE;
|
||||
+ if(!init_freetype()) return TRUE;
|
||||
|
||||
#ifdef SONAME_LIBFONTCONFIG
|
||||
init_fontconfig();
|
||||
@@ -4158,7 +4157,7 @@ BOOL WineEngInit(void)
|
||||
if((font_mutex = CreateMutexW(NULL, FALSE, font_mutex_nameW)) == NULL)
|
||||
{
|
||||
ERR("Failed to create font mutex\n");
|
||||
- return FALSE;
|
||||
+ return TRUE;
|
||||
}
|
||||
WaitForSingleObject(font_mutex, INFINITE);
|
||||
|
||||
@@ -4185,6 +4184,20 @@ BOOL WineEngInit(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+/*************************************************************
|
||||
+ * WineEngInit
|
||||
+ *
|
||||
+ * Initialize FreeType library and create a list of available faces
|
||||
+ */
|
||||
+BOOL WineEngInit(void)
|
||||
+{
|
||||
+ /* update locale dependent font info in registry */
|
||||
+ update_font_info();
|
||||
+
|
||||
+ /* The rest will be initialized later in freetype_lazy_init */
|
||||
+ font_driver = &freetype_funcs;
|
||||
+ return TRUE;
|
||||
+}
|
||||
|
||||
static LONG calc_ppem_for_height(FT_Face ft_face, LONG height)
|
||||
{
|
||||
@@ -4856,8 +4869,12 @@ static BOOL select_charmap(FT_Face ft_face, FT_Encoding encoding)
|
||||
static BOOL freetype_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
|
||||
LPCWSTR output, const DEVMODEW *devmode )
|
||||
{
|
||||
- struct freetype_physdev *physdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physdev) );
|
||||
+ struct freetype_physdev *physdev;
|
||||
+
|
||||
+ RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL );
|
||||
+ if (!ft_handle) return FALSE;
|
||||
|
||||
+ physdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physdev) );
|
||||
if (!physdev) return FALSE;
|
||||
push_dc_driver( dev, &physdev->dev, &freetype_funcs );
|
||||
return TRUE;
|
||||
@@ -8124,6 +8141,7 @@ static BOOL freetype_FontIsLinked( PHYSDEV dev )
|
||||
*/
|
||||
BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
|
||||
{
|
||||
+ /* RtlRunOnceExecuteOnce( &init_once, freetype_lazy_init, NULL, NULL ); */
|
||||
lprs->nSize = sizeof(RASTERIZER_STATUS);
|
||||
lprs->wFlags = TT_AVAILABLE | TT_ENABLED;
|
||||
lprs->nLanguageID = 0;
|
||||
--
|
||||
2.5.0
|
||||
|
2
patches/gdi32-Lazy_Font_Initialization/definition
Normal file
2
patches/gdi32-Lazy_Font_Initialization/definition
Normal file
@@ -0,0 +1,2 @@
|
||||
Fixes: Improve startup performance by delaying font initialization
|
||||
|
@@ -0,0 +1,404 @@
|
||||
From a7ed2b13874bd662db8bf30df7b7f394e279e687 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 11 Aug 2015 02:23:20 +0200
|
||||
Subject: imagehlp: Catch invalid memory access in CheckSumMappedFile and add
|
||||
tests.
|
||||
|
||||
---
|
||||
dlls/imagehlp/modify.c | 55 +++++----
|
||||
dlls/imagehlp/tests/integrity.c | 252 +++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 283 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/dlls/imagehlp/modify.c b/dlls/imagehlp/modify.c
|
||||
index debccc0..aa29ca7 100644
|
||||
--- a/dlls/imagehlp/modify.c
|
||||
+++ b/dlls/imagehlp/modify.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "winternl.h"
|
||||
#include "winerror.h"
|
||||
#include "wine/debug.h"
|
||||
+#include "wine/exception.h"
|
||||
#include "imagehlp.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
|
||||
@@ -92,37 +93,45 @@ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
|
||||
IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *) BaseAddress;
|
||||
PIMAGE_NT_HEADERS32 Header32;
|
||||
PIMAGE_NT_HEADERS64 Header64;
|
||||
+ PIMAGE_NT_HEADERS ret = NULL;
|
||||
DWORD *ChecksumFile;
|
||||
DWORD CalcSum;
|
||||
- DWORD HdrSum;
|
||||
+ DWORD HdrSum = 0;
|
||||
|
||||
TRACE("(%p, %d, %p, %p)\n",
|
||||
BaseAddress, FileLength, HeaderSum, CheckSum
|
||||
);
|
||||
|
||||
- CalcSum = (DWORD)CalcCheckSum(0,
|
||||
- BaseAddress,
|
||||
- (FileLength + 1) / sizeof(WORD));
|
||||
+ CalcSum = (DWORD)CalcCheckSum(0, BaseAddress, (FileLength + 1) / sizeof(WORD));
|
||||
|
||||
- if (dos->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
- return NULL;
|
||||
-
|
||||
- Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew);
|
||||
-
|
||||
- if (Header32->Signature != IMAGE_NT_SIGNATURE)
|
||||
- return NULL;
|
||||
-
|
||||
- if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
|
||||
- ChecksumFile = &Header32->OptionalHeader.CheckSum;
|
||||
- else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
|
||||
+ __TRY
|
||||
{
|
||||
- Header64 = (IMAGE_NT_HEADERS64 *)Header32;
|
||||
- ChecksumFile = &Header64->OptionalHeader.CheckSum;
|
||||
+ if (dos->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
+ break;
|
||||
+
|
||||
+ Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew);
|
||||
+ if (Header32->Signature != IMAGE_NT_SIGNATURE)
|
||||
+ break;
|
||||
+
|
||||
+ ret = (PIMAGE_NT_HEADERS)Header32;
|
||||
+
|
||||
+ if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
|
||||
+ ChecksumFile = &Header32->OptionalHeader.CheckSum;
|
||||
+ else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
|
||||
+ {
|
||||
+ Header64 = (IMAGE_NT_HEADERS64 *)Header32;
|
||||
+ ChecksumFile = &Header64->OptionalHeader.CheckSum;
|
||||
+ }
|
||||
+ else
|
||||
+ break;
|
||||
+
|
||||
+ HdrSum = *ChecksumFile;
|
||||
}
|
||||
- else
|
||||
- return NULL;
|
||||
-
|
||||
- HdrSum = *ChecksumFile;
|
||||
+ __EXCEPT_PAGE_FAULT
|
||||
+ {
|
||||
+ /* nothing */
|
||||
+ }
|
||||
+ __ENDTRY
|
||||
|
||||
/* Subtract image checksum from calculated checksum. */
|
||||
/* fix low word of checksum */
|
||||
@@ -149,9 +158,9 @@ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
|
||||
CalcSum += FileLength;
|
||||
|
||||
*CheckSum = CalcSum;
|
||||
- *HeaderSum = *ChecksumFile;
|
||||
+ *HeaderSum = HdrSum;
|
||||
|
||||
- return (PIMAGE_NT_HEADERS) Header32;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
diff --git a/dlls/imagehlp/tests/integrity.c b/dlls/imagehlp/tests/integrity.c
|
||||
index 3fa359f..7dd8ff4 100644
|
||||
--- a/dlls/imagehlp/tests/integrity.c
|
||||
+++ b/dlls/imagehlp/tests/integrity.c
|
||||
@@ -26,8 +26,9 @@
|
||||
#include "winerror.h"
|
||||
#include "winnt.h"
|
||||
#include "imagehlp.h"
|
||||
+#include "psapi.h"
|
||||
|
||||
-static HMODULE hImageHlp;
|
||||
+static HMODULE hImageHlp, hPsapi;
|
||||
static char test_dll_path[MAX_PATH];
|
||||
|
||||
static BOOL (WINAPI *pImageAddCertificate)(HANDLE, LPWIN_CERTIFICATE, PDWORD);
|
||||
@@ -35,6 +36,9 @@ static BOOL (WINAPI *pImageEnumerateCertificates)(HANDLE, WORD, PDWORD, PDWORD,
|
||||
static BOOL (WINAPI *pImageGetCertificateData)(HANDLE, DWORD, LPWIN_CERTIFICATE, PDWORD);
|
||||
static BOOL (WINAPI *pImageGetCertificateHeader)(HANDLE, DWORD, LPWIN_CERTIFICATE);
|
||||
static BOOL (WINAPI *pImageRemoveCertificate)(HANDLE, DWORD);
|
||||
+static PIMAGE_NT_HEADERS (WINAPI *pCheckSumMappedFile)(PVOID, DWORD, PDWORD, PDWORD);
|
||||
+
|
||||
+static BOOL (WINAPI *pGetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD cb);
|
||||
|
||||
static const char test_cert_data[] =
|
||||
{0x30,0x82,0x02,0xE1,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02
|
||||
@@ -90,6 +94,27 @@ static const char test_cert_data[] =
|
||||
|
||||
static const char test_cert_data_2[] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02,0x03};
|
||||
|
||||
+static char test_pe_executable[] =
|
||||
+{
|
||||
+ 0x4d,0x5a,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0x00,
|
||||
+ 0x00,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,
|
||||
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
+ 0x80,0x00,0x00,0x00,0x0e,0x1f,0xba,0x0e,0x00,0xb4,0x09,0xcd,0x21,0xb8,0x01,
|
||||
+ 0x4c,0xcd,0x21,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,
|
||||
+ 0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6e,0x20,
|
||||
+ 0x69,0x6e,0x20,0x44,0x4f,0x53,0x20,0x6d,0x6f,0x64,0x65,0x2e,0x0d,0x0d,0x0a,
|
||||
+ 0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x45,0x00,0x00,0x4c,0x01,0x0f,
|
||||
+ 0x00,0xfd,0x38,0xc9,0x55,0x00,0x24,0x01,0x00,0xea,0x04,0x00,0x00,0xe0,0x00,
|
||||
+ 0x07,0x01,0x0b,0x01,0x02,0x18,0x00,0x1a,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,
|
||||
+ 0x06,0x00,0x00,0xe0,0x14,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x30,0x00,0x00,
|
||||
+ 0x00,0x00,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x04,0x00,0x00,
|
||||
+ 0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
|
||||
+ 0x01,0x00,0x00,0x04,0x00,0x00,/* checksum */ 0x11,0xEF,0xCD,0xAB,0x03,0x00,
|
||||
+ 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00,0x00,
|
||||
+ 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00
|
||||
+};
|
||||
+
|
||||
static BOOL copy_dll_file(void)
|
||||
{
|
||||
char sys_dir[MAX_PATH+15];
|
||||
@@ -239,6 +264,223 @@ static void test_remove_certificate(int index)
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
+static DWORD _get_checksum_offset(PVOID base, PIMAGE_NT_HEADERS *nt_header, DWORD *checksum)
|
||||
+{
|
||||
+ IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)base;
|
||||
+ PIMAGE_NT_HEADERS32 Header32;
|
||||
+ PIMAGE_NT_HEADERS64 Header64;
|
||||
+
|
||||
+ if (dos->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
+ return 0;
|
||||
+
|
||||
+ Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew);
|
||||
+ if (Header32->Signature != IMAGE_NT_SIGNATURE)
|
||||
+ return 0;
|
||||
+
|
||||
+ *nt_header = (PIMAGE_NT_HEADERS)Header32;
|
||||
+
|
||||
+ if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
|
||||
+ {
|
||||
+ *checksum = Header32->OptionalHeader.CheckSum;
|
||||
+ return (char *)&Header32->OptionalHeader.CheckSum - (char *)base;
|
||||
+ }
|
||||
+ else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
|
||||
+ {
|
||||
+ Header64 = (IMAGE_NT_HEADERS64 *)Header32;
|
||||
+ *checksum = Header64->OptionalHeader.CheckSum;
|
||||
+ return (char *)&Header64->OptionalHeader.CheckSum - (char *)base;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void test_pe_checksum(void)
|
||||
+{
|
||||
+ DWORD checksum_orig, checksum_new, checksum_off, checksum_correct;
|
||||
+ PIMAGE_NT_HEADERS nt_header;
|
||||
+ PIMAGE_NT_HEADERS ret;
|
||||
+ HMODULE quartz_data;
|
||||
+ char* quartz_base;
|
||||
+ MODULEINFO modinfo;
|
||||
+ char buffer[20];
|
||||
+ BOOL ret_bool;
|
||||
+
|
||||
+ if (!pCheckSumMappedFile)
|
||||
+ {
|
||||
+ win_skip("CheckSumMappedFile not supported, skipping tests\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(NULL, 0, &checksum_orig, &checksum_new);
|
||||
+ ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret);
|
||||
+ ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new);
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile((void *)0xdeadbeef, 0, &checksum_orig, &checksum_new);
|
||||
+ ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret);
|
||||
+ ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new);
|
||||
+
|
||||
+ if (0)
|
||||
+ {
|
||||
+ /* crashes on Windows */
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ pCheckSumMappedFile(0, 0x1000, &checksum_orig, &checksum_new);
|
||||
+ pCheckSumMappedFile((void *)0xdeadbeef, 0x1000, NULL, NULL);
|
||||
+ }
|
||||
+
|
||||
+ /* basic checksum tests */
|
||||
+ memset(buffer, 0x11, sizeof(buffer));
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new);
|
||||
+ ok(ret == NULL, "Expected NULL, got %p\n", ret);
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0xaabe, "Expected 0xaabe, got %x\n", checksum_new);
|
||||
+
|
||||
+ memset(buffer, 0x22, sizeof(buffer));
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new);
|
||||
+ ok(ret == NULL, "Expected NULL, got %p\n", ret);
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0x5569, "Expected 0x5569, got %x\n", checksum_new);
|
||||
+
|
||||
+ memset(buffer, 0x22, sizeof(buffer));
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(buffer, 10, &checksum_orig, &checksum_new);
|
||||
+ ok(ret == NULL, "Expected NULL, got %p\n", ret);
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0xaab4, "Expected 0xaab4, got %x\n", checksum_new);
|
||||
+
|
||||
+ memset(buffer, 0x22, sizeof(buffer));
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(buffer, 11, &checksum_orig, &checksum_new);
|
||||
+ ok(ret == NULL, "Expected NULL, got %p\n", ret);
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ todo_wine ok(checksum_new == 0xaad7, "Expected 0xaad7, got %x\n", checksum_new);
|
||||
+
|
||||
+ /* test checksum of PE module */
|
||||
+ memset(buffer, 0x22, sizeof(buffer));
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(test_pe_executable, sizeof(test_pe_executable),
|
||||
+ &checksum_orig, &checksum_new);
|
||||
+ ok((char *)ret == test_pe_executable + 0x80, "Expected %p, got %p\n", test_pe_executable + 0x80, ret);
|
||||
+ ok(checksum_orig == 0xabcdef11, "Expected 0xabcdef11, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0xaa4, "Expected 0xaa4, got %x\n", checksum_new);
|
||||
+
|
||||
+ if (!pGetModuleInformation)
|
||||
+ {
|
||||
+ win_skip("GetModuleInformation not supported, skipping tests\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ret_bool = pGetModuleInformation(GetCurrentProcess(), GetModuleHandleA(NULL),
|
||||
+ &modinfo, sizeof(modinfo));
|
||||
+ ok(ret_bool, "GetModuleInformation failed, error: %x\n", GetLastError());
|
||||
+
|
||||
+ if (0)
|
||||
+ {
|
||||
+ /* crashes on Windows */
|
||||
+ pCheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, NULL, NULL);
|
||||
+ }
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, &checksum_orig, &checksum_new);
|
||||
+ ok(ret != NULL, "Expected CheckSumMappedFile to succeed\n");
|
||||
+ ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
|
||||
+ ok(checksum_orig != 0xdeadbeef, "Expected orig checksum != 0xdeadbeef\n");
|
||||
+ ok(checksum_new != 0xdeadbeef, "Expected new checksum != 0xdeadbeef\n");
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile((char *)modinfo.lpBaseOfDll + 100, modinfo.SizeOfImage - 100,
|
||||
+ &checksum_orig, &checksum_new);
|
||||
+ ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret);
|
||||
+ ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
|
||||
+ ok(checksum_orig == 0, "Expected 0xdeadbeef, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_off = _get_checksum_offset(modinfo.lpBaseOfDll, &nt_header, &checksum_correct);
|
||||
+ ok(checksum_off != 0, "Failed to get checksum offset\n");
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, checksum_off, &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, (char *)nt_header - (char *)modinfo.lpBaseOfDll,
|
||||
+ &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, sizeof(IMAGE_DOS_HEADER),
|
||||
+ &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, 0, &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile((char *)modinfo.lpBaseOfDll + 1, 0,
|
||||
+ &checksum_orig, &checksum_new);
|
||||
+ ok(ret == NULL, "Expected NULL, got %p\n", ret);
|
||||
+ ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
+ ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new);
|
||||
+
|
||||
+ quartz_data = LoadLibraryExA("quartz.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
|
||||
+ if (!quartz_data)
|
||||
+ {
|
||||
+ skip("Failed to load quartz as datafile, skipping tests\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ quartz_base = (char *)((DWORD_PTR)quartz_data & ~1);
|
||||
+ checksum_off = _get_checksum_offset(quartz_base, &nt_header, &checksum_correct);
|
||||
+ ok(checksum_off != 0, "Failed to get checksum offset\n");
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(quartz_base, checksum_off, &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(quartz_base, (char *)nt_header - quartz_base,
|
||||
+ &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(quartz_base, sizeof(IMAGE_DOS_HEADER), &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ checksum_orig = checksum_new = 0xdeadbeef;
|
||||
+ ret = pCheckSumMappedFile(quartz_base, 0, &checksum_orig, &checksum_new);
|
||||
+ ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
|
||||
+ ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
|
||||
+ todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
|
||||
+
|
||||
+ FreeLibrary(quartz_data);
|
||||
+}
|
||||
+
|
||||
START_TEST(integrity)
|
||||
{
|
||||
DWORD file_size, file_size_orig, first, second;
|
||||
@@ -273,6 +515,11 @@ START_TEST(integrity)
|
||||
pImageGetCertificateData = (void *) GetProcAddress(hImageHlp, "ImageGetCertificateData");
|
||||
pImageGetCertificateHeader = (void *) GetProcAddress(hImageHlp, "ImageGetCertificateHeader");
|
||||
pImageRemoveCertificate = (void *) GetProcAddress(hImageHlp, "ImageRemoveCertificate");
|
||||
+ pCheckSumMappedFile = (void *) GetProcAddress(hImageHlp, "CheckSumMappedFile");
|
||||
+
|
||||
+ hPsapi = LoadLibraryA("psapi.dll");
|
||||
+ if (hPsapi)
|
||||
+ pGetModuleInformation = (void *) GetProcAddress(hPsapi, "GetModuleInformation");
|
||||
|
||||
first = test_add_certificate(test_cert_data, sizeof(test_cert_data));
|
||||
test_get_certificate(test_cert_data, first);
|
||||
@@ -299,6 +546,9 @@ START_TEST(integrity)
|
||||
file_size = get_file_size();
|
||||
ok(file_size == file_size_orig, "File size different after add and remove (old: %d; new: %d)\n", file_size_orig, file_size);
|
||||
|
||||
+ test_pe_checksum();
|
||||
+
|
||||
+ if (hPsapi) FreeLibrary(hPsapi);
|
||||
FreeLibrary(hImageHlp);
|
||||
DeleteFileA(test_dll_path);
|
||||
}
|
||||
--
|
||||
2.5.0
|
||||
|
@@ -0,0 +1,84 @@
|
||||
From 2255200233c348e56b17330c4836c34e3e6b7854 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 11 Aug 2015 02:46:06 +0200
|
||||
Subject: imagehlp: Fix checksum calculation for odd sizes.
|
||||
|
||||
---
|
||||
dlls/imagehlp/modify.c | 39 +++++++++++++++++++--------------------
|
||||
dlls/imagehlp/tests/integrity.c | 2 +-
|
||||
2 files changed, 20 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/dlls/imagehlp/modify.c b/dlls/imagehlp/modify.c
|
||||
index aa29ca7..2a0214b 100644
|
||||
--- a/dlls/imagehlp/modify.c
|
||||
+++ b/dlls/imagehlp/modify.c
|
||||
@@ -60,26 +60,25 @@ BOOL WINAPI BindImageEx(
|
||||
/***********************************************************************
|
||||
* CheckSum (internal)
|
||||
*/
|
||||
-static WORD CalcCheckSum(
|
||||
- DWORD StartValue, LPVOID BaseAddress, DWORD WordCount)
|
||||
+static WORD CalcCheckSum(DWORD StartValue, LPVOID BaseAddress, DWORD ByteCount)
|
||||
{
|
||||
- LPWORD Ptr;
|
||||
- DWORD Sum;
|
||||
- DWORD i;
|
||||
-
|
||||
- Sum = StartValue;
|
||||
- Ptr = (LPWORD)BaseAddress;
|
||||
- for (i = 0; i < WordCount; i++)
|
||||
- {
|
||||
- Sum += *Ptr;
|
||||
- if (HIWORD(Sum) != 0)
|
||||
- {
|
||||
- Sum = LOWORD(Sum) + HIWORD(Sum);
|
||||
- }
|
||||
- Ptr++;
|
||||
- }
|
||||
-
|
||||
- return (WORD)(LOWORD(Sum) + HIWORD(Sum));
|
||||
+ LPWORD Ptr;
|
||||
+ DWORD Sum, i;
|
||||
+
|
||||
+ Sum = StartValue;
|
||||
+ Ptr = (LPWORD)BaseAddress;
|
||||
+ for (i = ByteCount; i > 1; i -= 2)
|
||||
+ {
|
||||
+ Sum += *Ptr;
|
||||
+ if (HIWORD(Sum) != 0)
|
||||
+ Sum = LOWORD(Sum) + HIWORD(Sum);
|
||||
+ Ptr++;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 1)
|
||||
+ Sum += *(BYTE *)Ptr;
|
||||
+
|
||||
+ return (WORD)(LOWORD(Sum) + HIWORD(Sum));
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +101,7 @@ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
|
||||
BaseAddress, FileLength, HeaderSum, CheckSum
|
||||
);
|
||||
|
||||
- CalcSum = (DWORD)CalcCheckSum(0, BaseAddress, (FileLength + 1) / sizeof(WORD));
|
||||
+ CalcSum = (DWORD)CalcCheckSum(0, BaseAddress, FileLength);
|
||||
|
||||
__TRY
|
||||
{
|
||||
diff --git a/dlls/imagehlp/tests/integrity.c b/dlls/imagehlp/tests/integrity.c
|
||||
index 7dd8ff4..913c396 100644
|
||||
--- a/dlls/imagehlp/tests/integrity.c
|
||||
+++ b/dlls/imagehlp/tests/integrity.c
|
||||
@@ -362,7 +362,7 @@ static void test_pe_checksum(void)
|
||||
ret = pCheckSumMappedFile(buffer, 11, &checksum_orig, &checksum_new);
|
||||
ok(ret == NULL, "Expected NULL, got %p\n", ret);
|
||||
ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
|
||||
- todo_wine ok(checksum_new == 0xaad7, "Expected 0xaad7, got %x\n", checksum_new);
|
||||
+ ok(checksum_new == 0xaad7, "Expected 0xaad7, got %x\n", checksum_new);
|
||||
|
||||
/* test checksum of PE module */
|
||||
memset(buffer, 0x22, sizeof(buffer));
|
||||
--
|
||||
2.5.0
|
||||
|
@@ -0,0 +1,131 @@
|
||||
From 9156b97f5aab56ae2ab8b981b625bd46e1ef2056 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 11 Aug 2015 04:35:45 +0200
|
||||
Subject: imagehlp: Implement ImageLoad and cleanup ImageUnload.
|
||||
|
||||
---
|
||||
dlls/imagehlp/access.c | 85 ++++++++++++++++++++++++++++----------------------
|
||||
1 file changed, 48 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/dlls/imagehlp/access.c b/dlls/imagehlp/access.c
|
||||
index 6a33c0c..897f2d5 100644
|
||||
--- a/dlls/imagehlp/access.c
|
||||
+++ b/dlls/imagehlp/access.c
|
||||
@@ -33,8 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
|
||||
/***********************************************************************
|
||||
* Data
|
||||
*/
|
||||
-
|
||||
-static PLOADED_IMAGE IMAGEHLP_pFirstLoadedImage=NULL;
|
||||
+LIST_ENTRY image_list = { &image_list, &image_list };
|
||||
|
||||
DECLSPEC_HIDDEN extern HANDLE IMAGEHLP_hHeap;
|
||||
|
||||
@@ -69,57 +68,69 @@ DWORD WINAPI GetImageUnusedHeaderBytes(
|
||||
/***********************************************************************
|
||||
* ImageLoad (IMAGEHLP.@)
|
||||
*/
|
||||
-PLOADED_IMAGE WINAPI ImageLoad(PCSTR DllName, PCSTR DllPath)
|
||||
+PLOADED_IMAGE WINAPI ImageLoad(PCSTR dll_name, PCSTR dll_path)
|
||||
{
|
||||
- PLOADED_IMAGE pLoadedImage;
|
||||
-
|
||||
- FIXME("(%s, %s): stub\n", DllName, DllPath);
|
||||
-
|
||||
- pLoadedImage = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE));
|
||||
- if (pLoadedImage)
|
||||
- pLoadedImage->FileHeader = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(IMAGE_NT_HEADERS));
|
||||
-
|
||||
- return pLoadedImage;
|
||||
+ LOADED_IMAGE *image;
|
||||
+
|
||||
+ TRACE("(%s, %s)\n", dll_name, dll_path);
|
||||
+
|
||||
+ image = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(*image));
|
||||
+ if (!image) return NULL;
|
||||
+
|
||||
+ if (!MapAndLoad(dll_name, dll_path, image, TRUE, TRUE))
|
||||
+ {
|
||||
+ HeapFree(IMAGEHLP_hHeap, 0, image);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ image->Links.Flink = image_list.Flink;
|
||||
+ image->Links.Blink = &image_list;
|
||||
+ image_list.Flink->Blink = &image->Links;
|
||||
+ image_list.Flink = &image->Links;
|
||||
+
|
||||
+ return image;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ImageUnload (IMAGEHLP.@)
|
||||
*/
|
||||
-BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage)
|
||||
+BOOL WINAPI ImageUnload(PLOADED_IMAGE loaded_image)
|
||||
{
|
||||
- LIST_ENTRY *pCurrent, *pFind;
|
||||
+ LIST_ENTRY *entry, *mark;
|
||||
+ PLOADED_IMAGE image;
|
||||
+
|
||||
+ FIXME("(%p)\n", loaded_image);
|
||||
|
||||
- TRACE("(%p)\n", pLoadedImage);
|
||||
-
|
||||
- if(!IMAGEHLP_pFirstLoadedImage || !pLoadedImage)
|
||||
+ if (!loaded_image)
|
||||
{
|
||||
- /* No image loaded or null pointer */
|
||||
- SetLastError(ERROR_INVALID_PARAMETER);
|
||||
- return FALSE;
|
||||
+ /* No image loaded or null pointer */
|
||||
+ SetLastError(ERROR_INVALID_PARAMETER);
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
- pFind=&pLoadedImage->Links;
|
||||
- pCurrent=&IMAGEHLP_pFirstLoadedImage->Links;
|
||||
- while((pCurrent != pFind) &&
|
||||
- (pCurrent != NULL))
|
||||
- pCurrent = pCurrent->Flink;
|
||||
- if(!pCurrent)
|
||||
+ /* FIXME: do we really need to check this? */
|
||||
+ mark = &image_list;
|
||||
+ for (entry = mark->Flink; entry != mark; entry = entry->Flink)
|
||||
{
|
||||
- /* Not found */
|
||||
- SetLastError(ERROR_INVALID_PARAMETER);
|
||||
- return FALSE;
|
||||
+ image = CONTAINING_RECORD(entry, LOADED_IMAGE, Links);
|
||||
+ if (image == loaded_image)
|
||||
+ break;
|
||||
}
|
||||
|
||||
- if(pCurrent->Blink)
|
||||
- pCurrent->Blink->Flink = pCurrent->Flink;
|
||||
- else
|
||||
- IMAGEHLP_pFirstLoadedImage = pCurrent->Flink?CONTAINING_RECORD(
|
||||
- pCurrent->Flink, LOADED_IMAGE, Links):NULL;
|
||||
+ if (entry == mark)
|
||||
+ {
|
||||
+ /* Not found */
|
||||
+ SetLastError(ERROR_INVALID_PARAMETER);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
- if(pCurrent->Flink)
|
||||
- pCurrent->Flink->Blink = pCurrent->Blink;
|
||||
+ entry->Blink->Flink = entry->Flink;
|
||||
+ entry->Flink->Blink = entry->Blink;
|
||||
|
||||
- return FALSE;
|
||||
+ UnMapAndLoad(loaded_image);
|
||||
+ HeapFree(IMAGEHLP_hHeap, 0, loaded_image);
|
||||
+
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
--
|
||||
2.5.0
|
||||
|
2
patches/imagehlp-Cleanup/definition
Normal file
2
patches/imagehlp-Cleanup/definition
Normal file
@@ -0,0 +1,2 @@
|
||||
Fixes: Catch invalid memory accesses in imagehlp.CheckSumMappedFile
|
||||
Fixes: Properly implement imagehlp.ImageLoad and ImageUnload
|
@@ -56,7 +56,7 @@ index 3ff30f3..460f688 100644
|
||||
+
|
||||
+ if (!ppTcpTable) return ERROR_INVALID_PARAMETER;
|
||||
+
|
||||
+ if (family != AF_INET)
|
||||
+ if (family != WS_AF_INET)
|
||||
+ {
|
||||
+ FIXME( "family = %u not supported\n", family );
|
||||
+ return ERROR_NOT_SUPPORTED;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user