Rebase against b190a72bfe53a41a83ae55d75de8327c24512bee.

[uxtheme-CloseThemeData]
Removed patch to avoid crash when INVALID_HANDLE_VALUE is passed to
CloseThemeData (accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-02-15 19:00:07 +01:00
parent cb7a46b342
commit bcf8079573
5 changed files with 29 additions and 91 deletions

View File

@ -1,25 +1,23 @@
From 787df5f7b3137d116141bbe4fdba664a06a9c5af Mon Sep 17 00:00:00 2001
From 7bab64e071904df31e980969a19a231099cfd6c0 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov@etersoft.ru>
Date: Fri, 30 Jan 2015 00:01:37 +0100
Subject: ntoskrnl.exe: Add stubs for ObReferenceObjectByPointer and
ObDereferenceObject.
---
dlls/ntoskrnl.exe/ntoskrnl.c | 25 ++++++++++++++++++++++++-
dlls/ntoskrnl.exe/ntoskrnl.c | 24 +++++++++++++++++++++++-
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 ++--
include/ddk/wdm.h | 2 ++
3 files changed, 28 insertions(+), 3 deletions(-)
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index d33fe6f..0d6f730 100644
index 702cde7..3d22563 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -1720,6 +1720,29 @@ NTSTATUS WINAPI ObReferenceObjectByName( UNICODE_STRING *ObjectName,
return STATUS_NOT_IMPLEMENTED;
}
@@ -2067,6 +2067,28 @@ NTSTATUS WINAPI ObReferenceObjectByName( UNICODE_STRING *ObjectName,
+
+/***********************************************************************
/***********************************************************************
+ * ObReferenceObjectByPointer (NTOSKRNL.EXE.@)
+ */
+NTSTATUS WINAPI ObReferenceObjectByPointer(VOID *obj, ACCESS_MASK access,
@ -41,20 +39,21 @@ index d33fe6f..0d6f730 100644
+}
+
+
/***********************************************************************
* ObfDereferenceObject (NTOSKRNL.EXE.@)
+/***********************************************************************
* ObfReferenceObject (NTOSKRNL.EXE.@)
*/
@@ -1730,7 +1753,7 @@ void WINAPI __regs_ObfDereferenceObject( VOID *obj )
void WINAPI ObfDereferenceObject( VOID *obj )
#ifdef DEFINE_FASTCALL1_ENTRYPOINT
@@ -2090,7 +2112,7 @@ void WINAPI __regs_ObfDereferenceObject( void *obj )
void WINAPI ObfDereferenceObject( void *obj )
#endif
{
- FIXME( "stub: %p\n", obj );
- FIXME( "(%p): stub\n", obj );
+ ObDereferenceObject( obj );
}
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 2f08945..25624a6 100644
index 1a19fd5..acc1713 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -798,7 +798,7 @@
@ -76,10 +75,10 @@ index 2f08945..25624a6 100644
@ stub ObReleaseObjectSecurity
@ stub ObSetHandleAttributes
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 121ca45..f2eb6a5 100644
index f5efc59..fceb4b2 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1235,7 +1235,9 @@ PMDL WINAPI MmAllocatePagesForMdl(PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,PHYSICA
@@ -1252,7 +1252,9 @@ PMDL WINAPI MmAllocatePagesForMdl(PHYSICAL_ADDRESS,PHYSICAL_ADDRESS,PHYSICA
void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
MM_SYSTEMSIZE WINAPI MmQuerySystemSize(void);
@ -90,5 +89,5 @@ index 121ca45..f2eb6a5 100644
POWER_STATE WINAPI PoSetPowerState(PDEVICE_OBJECT,POWER_STATE_TYPE,POWER_STATE);
NTSTATUS WINAPI PsCreateSystemThread(PHANDLE,ULONG,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PKSTART_ROUTINE,PVOID);
--
2.2.2
2.7.1

View File

@ -1,18 +1,18 @@
From 2312e4f90d7f17f6e631ee7f1839d30ffa70241e Mon Sep 17 00:00:00 2001
From c4b9b10d49301e248612f06b984ed9c6e9968673 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 1 Feb 2015 12:53:09 +0100
Subject: ntoskrnl.exe: Implement MmMapLockedPages and MmUnmapLockedPages.
---
dlls/ntoskrnl.exe/ntoskrnl.c | 21 +++++++++++++++++++++
dlls/ntoskrnl.exe/ntoskrnl.c | 20 ++++++++++++++++++++
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 ++--
2 files changed, 23 insertions(+), 2 deletions(-)
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 715f302..10957e8 100644
index 9c88479..9b5058b 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -1673,6 +1673,16 @@ VOID WINAPI MmLockPagableSectionByHandle(PVOID ImageSectionHandle)
@@ -1991,6 +1991,16 @@ VOID WINAPI MmLockPagableSectionByHandle(PVOID ImageSectionHandle)
FIXME("stub %p\n", ImageSectionHandle);
}
@ -29,11 +29,10 @@ index 715f302..10957e8 100644
/***********************************************************************
* MmMapLockedPagesSpecifyCache (NTOSKRNL.EXE.@)
*/
@@ -1737,6 +1747,17 @@ VOID WINAPI MmUnmapIoSpace( PVOID BaseAddress, SIZE_T NumberOfBytes )
FIXME( "stub: %p, %lu\n", BaseAddress, NumberOfBytes );
@@ -2056,6 +2066,16 @@ VOID WINAPI MmUnmapIoSpace( PVOID BaseAddress, SIZE_T NumberOfBytes )
}
+
+/***********************************************************************
+ * MmUnmapLockedPages (NTOSKRNL.EXE.@)
+ */
@ -44,11 +43,11 @@ index 715f302..10957e8 100644
+}
+
+
/***********************************************************************
* ObfReferenceObject (NTOSKRNL.EXE.@)
/***********************************************************************
* ObReferenceObjectByHandle (NTOSKRNL.EXE.@)
*/
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 238c953..4a112ef 100644
index 7283510..0cd5c99 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -689,7 +689,7 @@
@ -70,5 +69,5 @@ index 238c953..4a112ef 100644
@ stub MmUnmapVideoDisplay
@ stub MmUnmapViewInSessionSpace
--
2.3.0
2.7.1

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "0f8a0fd4002f9d5d1cb6dadcb81ef430d8be21b7"
echo "b190a72bfe53a41a83ae55d75de8327c24512bee"
}
# Show version information
@ -320,7 +320,6 @@ patch_enable_all ()
enable_user32_SetCoalescableTimer="$1"
enable_user32_WM_MDICALCCHILDSCROLL="$1"
enable_user32_WndProc="$1"
enable_uxtheme_CloseThemeData="$1"
enable_uxtheme_GTK_Theming="$1"
enable_version_VerQueryValue="$1"
enable_wbemdisp_ISWbemSecurity="$1"
@ -1106,9 +1105,6 @@ patch_enable ()
user32-WndProc)
enable_user32_WndProc="$2"
;;
uxtheme-CloseThemeData)
enable_uxtheme_CloseThemeData="$2"
;;
uxtheme-GTK_Theming)
enable_uxtheme_GTK_Theming="$2"
;;
@ -6477,21 +6473,6 @@ if test "$enable_user32_WndProc" -eq 1; then
) >> "$patchlist"
fi
# Patchset uxtheme-CloseThemeData
# |
# | This patchset fixes the following Wine bugs:
# | * [#29862] Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData
# |
# | Modified files:
# | * dlls/uxtheme/system.c, dlls/uxtheme/tests/system.c
# |
if test "$enable_uxtheme_CloseThemeData" -eq 1; then
patch_apply uxtheme-CloseThemeData/0001-uxtheme-Do-not-crash-when-INVALID_HANDLE_VALUE-is-pa.patch
(
echo '+ { "Louis Lenders", "uxtheme: Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData.", 1 },';
) >> "$patchlist"
fi
# Patchset uxtheme-GTK_Theming
# |
# | This patchset has the following (direct or indirect) dependencies:

View File

@ -1,40 +0,0 @@
From ab3d3417ca146b9a72b395b082b4aae628c39d7c Mon Sep 17 00:00:00 2001
From: Louis Lenders <xerox_xerox2000@yahoo.co.uk>
Date: Wed, 27 Jan 2016 07:29:50 +0100
Subject: uxtheme: Do not crash when INVALID_HANDLE_VALUE is passed to
CloseThemeData.
---
dlls/uxtheme/system.c | 2 +-
dlls/uxtheme/tests/system.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 8947587..7d07680 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -746,7 +746,7 @@ void WINAPI SetThemeAppProperties(DWORD dwFlags)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
{
TRACE("(%p)\n", hTheme);
- if(!hTheme)
+ if(!hTheme || hTheme == INVALID_HANDLE_VALUE)
return E_HANDLE;
return MSSTYLES_CloseThemeClass(hTheme);
}
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 49eba64..4aeedbc 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -541,6 +541,8 @@ static void test_CloseThemeData(void)
hRes = pCloseThemeData(NULL);
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
+ hRes = pCloseThemeData(INVALID_HANDLE_VALUE);
+ ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
}
START_TEST(system)
--
2.6.4

View File

@ -1 +0,0 @@
Fixes: [29862] Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData