Added patch to fix wrong return values of RtlFindActivationContextSectionString for NULL data (by Mark Jansen).

This commit is contained in:
Sebastian Lackner 2015-03-16 03:48:50 +01:00
parent 547d1a988d
commit ec4e719cd6
7 changed files with 599 additions and 32 deletions

View File

@ -38,11 +38,12 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
===================================
**Bugfixes and features included in the next upcoming release [9]:**
**Bugfixes and features included in the next upcoming release [10]:**
* Add stub for PowerCreateRequest
* Fix caps lock state issues with multiple processes ([Wine Bug #35907](https://bugs.winehq.org/show_bug.cgi?id=35907))
* Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087))
* Fix wrong return values of RtlFindActivationContextSectionString for NULL data
* Fix wrong version of ID3DXEffect interface for d3dx9_24
* Fix wrong version of ID3DXEffect interface for d3dx9_25
* GetMessage should remove already seen messages with higher priority ([Wine Bug #28884](https://bugs.winehq.org/show_bug.cgi?id=28884))

2
debian/changelog vendored
View File

@ -12,6 +12,8 @@ wine-staging (1.7.39) UNRELEASED; urgency=low
* Added patch to silence repeated 'Unhandled blend factor 0' FIXME messages.
* Added patch for stub of PowerCreateRequest.
* Added patch to invalidate key state cache globally after calling LL hooks.
* Added patch to fix Wine Staging Bug #162 - Caesar III demo installer crashes.
* Added patch to fix wrong return values of RtlFindActivationContextSectionString for NULL data (by Mark Jansen).
* Removed patch to avoid hardcoded values for sizeof(GUID) (accepted upstream).
* Removed patches for SLGetWindowsInformationDWORD (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 09 Mar 2015 16:52:35 +0100

View File

@ -0,0 +1,209 @@
From bf350677af12ec558208b215f6fcff61c7082bac Mon Sep 17 00:00:00 2001
From: Mark Jansen <learn0more@gmail.com>
Date: Sun, 15 Mar 2015 23:39:09 +0100
Subject: kernel32: Parameter validation tests for FindActCtxSectionString
Highlight some differences between FindActCtxSectionString parameter validation, and its Rtl implementation.
---
dlls/kernel32/tests/actctx.c | 150 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 148 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 60763b1..887c6b0 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "wine/test.h"
#include <winbase.h>
#include <windef.h>
@@ -39,6 +41,10 @@ static BOOL (WINAPI *pQueryActCtxW)(DWORD,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE
static VOID (WINAPI *pReleaseActCtx)(HANDLE);
static BOOL (WINAPI *pFindActCtxSectionGuid)(DWORD,const GUID*,ULONG,const GUID*,PACTCTX_SECTION_KEYED_DATA);
+static NTSTATUS(NTAPI *pRtlFindActivationContextSectionString)(DWORD,const GUID *,ULONG,PUNICODE_STRING,PACTCTX_SECTION_KEYED_DATA);
+static BOOLEAN (NTAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, PCSZ);
+static VOID (NTAPI *pRtlFreeUnicodeString)(PUNICODE_STRING);
+
static const char* strw(LPCWSTR x)
{
static char buffer[1024];
@@ -2048,6 +2054,140 @@ static void test_app_manifest(void)
}
}
+static HANDLE create_manifest(const char *filename, const char *data, int line)
+{
+ HANDLE handle;
+ create_manifest_file(filename, data, -1, NULL, NULL);
+
+ handle = test_create(filename);
+ ok_(__FILE__, line)(handle != INVALID_HANDLE_VALUE,
+ "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
+
+ DeleteFileA(filename);
+ return handle;
+}
+
+static void kernel32_find(ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
+{
+ UNICODE_STRING string_to_findW;
+ ACTCTX_SECTION_KEYED_DATA data;
+ BOOL ret;
+ DWORD err;
+
+ pRtlCreateUnicodeStringFromAsciiz(&string_to_findW, string_to_find);
+
+ memset(&data, 0xfe, sizeof(data));
+ data.cbSize = sizeof(data);
+
+ SetLastError(0);
+ ret = pFindActCtxSectionStringA(0, NULL, section, string_to_find, &data);
+ err = GetLastError();
+ ok_(__FILE__, line)(ret == should_find,
+ "FindActCtxSectionStringA: expected ret = %u, got %u\n", should_find, ret);
+ if (todo)
+ todo_wine
+ ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
+ "FindActCtxSectionStringA: unexpected error %u\n", err);
+ else
+ ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
+ "FindActCtxSectionStringA: unexpected error %u\n", err);
+
+ memset(&data, 0xfe, sizeof(data));
+ data.cbSize = sizeof(data);
+
+ SetLastError(0);
+ ret = pFindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, &data);
+ err = GetLastError();
+ ok_(__FILE__, line)(ret == should_find,
+ "FindActCtxSectionStringW: expected ret = %u, got %u\n", should_find, ret);
+ if (todo)
+ todo_wine
+ ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
+ "FindActCtxSectionStringW: unexpected error %u\n", err);
+ else
+ ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
+ "FindActCtxSectionStringW: unexpected error %u\n", err);
+
+ SetLastError(0);
+ ret = pFindActCtxSectionStringA(0, NULL, section, string_to_find, NULL);
+ err = GetLastError();
+ ok_(__FILE__, line)(!ret,
+ "FindActCtxSectionStringA: expected failure, got %u\n", ret);
+ ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER,
+ "FindActCtxSectionStringA: unexpected error %u\n", err);
+
+ SetLastError(0);
+ ret = pFindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, NULL);
+ err = GetLastError();
+ ok_(__FILE__, line)(!ret,
+ "FindActCtxSectionStringW: expected failure, got %u\n", ret);
+ ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER,
+ "FindActCtxSectionStringW: unexpected error %u\n", err);
+
+ pRtlFreeUnicodeString(&string_to_findW);
+}
+
+static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
+{
+ UNICODE_STRING string_to_findW;
+ ACTCTX_SECTION_KEYED_DATA data;
+ NTSTATUS ret;
+
+ pRtlCreateUnicodeStringFromAsciiz(&string_to_findW, string_to_find);
+
+ memset(&data, 0xfe, sizeof(data));
+ data.cbSize = sizeof(data);
+
+ ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, &data);
+ if (todo)
+ todo_wine
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+ else
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+
+ ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
+ todo_wine
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+
+ pRtlFreeUnicodeString(&string_to_findW);
+}
+
+static void test_findsectionstring(void)
+{
+ HANDLE handle;
+ BOOL ret;
+ ULONG_PTR cookie;
+
+ handle = create_manifest("test.manifest", testdep_manifest3, __LINE__);
+ ret = pActivateActCtx(handle, &cookie);
+ ok(ret, "ActivateActCtx failed: %u\n", GetLastError());
+
+ /* first we show the parameter validation from kernel32 */
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
+
+ /* then we show that ntdll plays by different rules */
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
+
+ ret = pDeactivateActCtx(0, cookie);
+ ok(ret, "DeactivateActCtx failed: %u\n", GetLastError());
+ pReleaseActCtx(handle);
+}
+
static void run_child_process(void)
{
char cmdline[MAX_PATH];
@@ -2263,9 +2403,9 @@ todo_wine
static BOOL init_funcs(void)
{
- HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");
+ HMODULE hLibrary = GetModuleHandleA("kernel32.dll");
-#define X(f) if (!(p##f = (void*)GetProcAddress(hKernel32, #f))) return FALSE;
+#define X(f) if (!(p##f = (void*)GetProcAddress(hLibrary, #f))) return FALSE;
X(ActivateActCtx);
X(CreateActCtxA);
X(CreateActCtxW);
@@ -2277,6 +2417,11 @@ static BOOL init_funcs(void)
X(QueryActCtxW);
X(ReleaseActCtx);
X(FindActCtxSectionGuid);
+
+ hLibrary = GetModuleHandleA("ntdll.dll");
+ X(RtlFindActivationContextSectionString);
+ X(RtlCreateUnicodeStringFromAsciiz);
+ X(RtlFreeUnicodeString);
#undef X
return TRUE;
@@ -2303,5 +2448,6 @@ START_TEST(actctx)
test_actctx();
test_CreateActCtx();
+ test_findsectionstring();
run_child_process();
}
--
2.3.2

View File

@ -0,0 +1,188 @@
From ff94fa5c83c5f8c9e74ada24dfa8bc5c4e87f848 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 16 Mar 2015 03:38:58 +0100
Subject: ntdll: RtlFindActivationContextSectionString should accept a NULL
pointer as data.
---
dlls/kernel32/actctx.c | 8 ++++-
dlls/kernel32/tests/actctx.c | 10 ++++--
dlls/ntdll/actctx.c | 81 ++++++++++++++++++++++++--------------------
3 files changed, 59 insertions(+), 40 deletions(-)
diff --git a/dlls/kernel32/actctx.c b/dlls/kernel32/actctx.c
index bcf95ec..2eb1c2a 100644
--- a/dlls/kernel32/actctx.c
+++ b/dlls/kernel32/actctx.c
@@ -227,7 +227,7 @@ BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID* lpExtGuid,
TRACE("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
ulId, debugstr_a(lpSearchStr), pInfo);
- if (!lpSearchStr)
+ if (!lpSearchStr || !pInfo)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
@@ -255,6 +255,12 @@ BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID* lpExtGuid,
UNICODE_STRING us;
NTSTATUS status;
+ if (!pInfo)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
RtlInitUnicodeString(&us, lpSearchStr);
if ((status = RtlFindActivationContextSectionString(dwFlags, lpExtGuid, ulId, &us, pInfo)))
{
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 887c6b0..7512aed 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -2148,9 +2148,13 @@ static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_fi
"RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
- todo_wine
- ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
- "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+ if (todo)
+ todo_wine
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+ else
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
pRtlFreeUnicodeString(&string_to_findW);
}
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 20a98ec..638daac 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -3134,19 +3134,22 @@ static NTSTATUS find_dll_redirection(ACTIVATION_CONTEXT* actctx, const UNICODE_S
index = find_string_index(actctx->dllredirect_section, name);
if (!index) return STATUS_SXS_KEY_NOT_FOUND;
- dll = get_dllredirect_data(actctx, index);
+ if (data)
+ {
+ dll = get_dllredirect_data(actctx, index);
- data->ulDataFormatVersion = 1;
- data->lpData = dll;
- data->ulLength = dll->size;
- data->lpSectionGlobalData = NULL;
- data->ulSectionGlobalDataLength = 0;
- data->lpSectionBase = actctx->dllredirect_section;
- data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
- data->hActCtx = NULL;
+ data->ulDataFormatVersion = 1;
+ data->lpData = dll;
+ data->ulLength = dll->size;
+ data->lpSectionGlobalData = NULL;
+ data->ulSectionGlobalDataLength = 0;
+ data->lpSectionBase = actctx->dllredirect_section;
+ data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
+ data->hActCtx = NULL;
- if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
- data->ulAssemblyRosterIndex = index->rosterindex;
+ if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
+ data->ulAssemblyRosterIndex = index->rosterindex;
+ }
return STATUS_SUCCESS;
}
@@ -3343,20 +3346,23 @@ static NTSTATUS find_window_class(ACTIVATION_CONTEXT* actctx, const UNICODE_STRI
if (!index) return STATUS_SXS_KEY_NOT_FOUND;
- class = get_wndclass_data(actctx, index);
+ if (data)
+ {
+ class = get_wndclass_data(actctx, index);
- data->ulDataFormatVersion = 1;
- data->lpData = class;
- /* full length includes string length with nulls */
- data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
- data->lpSectionGlobalData = NULL;
- data->ulSectionGlobalDataLength = 0;
- data->lpSectionBase = actctx->wndclass_section;
- data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
- data->hActCtx = NULL;
+ data->ulDataFormatVersion = 1;
+ data->lpData = class;
+ /* full length includes string length with nulls */
+ data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
+ data->lpSectionGlobalData = NULL;
+ data->ulSectionGlobalDataLength = 0;
+ data->lpSectionBase = actctx->wndclass_section;
+ data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
+ data->hActCtx = NULL;
- if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
- data->ulAssemblyRosterIndex = index->rosterindex;
+ if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
+ data->ulAssemblyRosterIndex = index->rosterindex;
+ }
return STATUS_SUCCESS;
}
@@ -4398,19 +4404,22 @@ static NTSTATUS find_progid_redirection(ACTIVATION_CONTEXT* actctx, const UNICOD
index = find_string_index(actctx->progid_section, name);
if (!index) return STATUS_SXS_KEY_NOT_FOUND;
- progid = get_progid_data(actctx, index);
+ if (data)
+ {
+ progid = get_progid_data(actctx, index);
- data->ulDataFormatVersion = 1;
- data->lpData = progid;
- data->ulLength = progid->size;
- data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
- data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
- data->lpSectionBase = actctx->progid_section;
- data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
- data->hActCtx = NULL;
+ data->ulDataFormatVersion = 1;
+ data->lpData = progid;
+ data->ulLength = progid->size;
+ data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
+ data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
+ data->lpSectionBase = actctx->progid_section;
+ data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
+ data->hActCtx = NULL;
- if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
- data->ulAssemblyRosterIndex = index->rosterindex;
+ if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
+ data->ulAssemblyRosterIndex = index->rosterindex;
+ }
return STATUS_SUCCESS;
}
@@ -4442,7 +4451,7 @@ static NTSTATUS find_string(ACTIVATION_CONTEXT* actctx, ULONG section_kind,
if (status != STATUS_SUCCESS) return status;
- if (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
+ if (data && (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX))
{
actctx_addref(actctx);
data->hActCtx = actctx;
@@ -5009,7 +5018,7 @@ NTSTATUS WINAPI RtlFindActivationContextSectionString( ULONG flags, const GUID *
FIXME("unknown flags %08x\n", flags);
return STATUS_INVALID_PARAMETER;
}
- if (!data || data->cbSize < offsetof(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) ||
+ if ((data && data->cbSize < offsetof(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex)) ||
!section_name || !section_name->Buffer)
{
WARN("invalid parameter\n");
--
2.3.2

View File

@ -0,0 +1,146 @@
From 37837138f0124582ae9af34643710d619b5b48bc Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 16 Mar 2015 03:46:36 +0100
Subject: ntdll: Fix return value for missing
ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION key.
---
dlls/kernel32/tests/actctx.c | 68 ++++++++++++++++----------------------------
dlls/ntdll/actctx.c | 3 ++
2 files changed, 27 insertions(+), 44 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 7512aed..6d5f2da 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -2067,7 +2067,7 @@ static HANDLE create_manifest(const char *filename, const char *data, int line)
return handle;
}
-static void kernel32_find(ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
+static void kernel32_find(ULONG section, const char *string_to_find, BOOL should_find, int line)
{
UNICODE_STRING string_to_findW;
ACTCTX_SECTION_KEYED_DATA data;
@@ -2084,13 +2084,8 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should
err = GetLastError();
ok_(__FILE__, line)(ret == should_find,
"FindActCtxSectionStringA: expected ret = %u, got %u\n", should_find, ret);
- if (todo)
- todo_wine
- ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
- "FindActCtxSectionStringA: unexpected error %u\n", err);
- else
- ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
- "FindActCtxSectionStringA: unexpected error %u\n", err);
+ ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
+ "FindActCtxSectionStringA: unexpected error %u\n", err);
memset(&data, 0xfe, sizeof(data));
data.cbSize = sizeof(data);
@@ -2100,13 +2095,8 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should
err = GetLastError();
ok_(__FILE__, line)(ret == should_find,
"FindActCtxSectionStringW: expected ret = %u, got %u\n", should_find, ret);
- if (todo)
- todo_wine
- ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
- "FindActCtxSectionStringW: unexpected error %u\n", err);
- else
- ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
- "FindActCtxSectionStringW: unexpected error %u\n", err);
+ ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
+ "FindActCtxSectionStringW: unexpected error %u\n", err);
SetLastError(0);
ret = pFindActCtxSectionStringA(0, NULL, section, string_to_find, NULL);
@@ -2127,7 +2117,7 @@ static void kernel32_find(ULONG section, const char *string_to_find, BOOL should
pRtlFreeUnicodeString(&string_to_findW);
}
-static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
+static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_find, int line)
{
UNICODE_STRING string_to_findW;
ACTCTX_SECTION_KEYED_DATA data;
@@ -2139,22 +2129,12 @@ static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_fi
data.cbSize = sizeof(data);
ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, &data);
- if (todo)
- todo_wine
- ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
- "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
- else
- ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
- "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
- if (todo)
- todo_wine
- ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
- "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
- else
- ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
- "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
+ ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
+ "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
pRtlFreeUnicodeString(&string_to_findW);
}
@@ -2170,22 +2150,22 @@ static void test_findsectionstring(void)
ok(ret, "ActivateActCtx failed: %u\n", GetLastError());
/* first we show the parameter validation from kernel32 */
- kernel32_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__);
- kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, FALSE, __LINE__);
- kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, FALSE, __LINE__);
- kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, FALSE, __LINE__);
- kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, FALSE, __LINE__);
- kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, FALSE, __LINE__);
- kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, __LINE__);
+ kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, __LINE__);
/* then we show that ntdll plays by different rules */
- ntdll_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__);
- ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, FALSE, __LINE__);
- ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, FALSE, __LINE__);
- ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, FALSE, __LINE__);
- ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, FALSE, __LINE__);
- ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, FALSE, __LINE__);
- ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, __LINE__);
+ ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, __LINE__);
ret = pDeactivateActCtx(0, cookie);
ok(ret, "DeactivateActCtx failed: %u\n", GetLastError());
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 638daac..08f5b04 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -4432,6 +4432,9 @@ static NTSTATUS find_string(ACTIVATION_CONTEXT* actctx, ULONG section_kind,
switch (section_kind)
{
+ case ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION:
+ FIXME("Unsupported yet section_kind %x\n", section_kind);
+ return STATUS_SXS_KEY_NOT_FOUND;
case ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION:
status = find_dll_redirection(actctx, section_name, data);
break;
--
2.3.2

View File

@ -0,0 +1 @@
Fixes: Fix wrong return values of RtlFindActivationContextSectionString for NULL data

View File

@ -127,6 +127,7 @@ patch_enable_all ()
enable_netprofm_IConnectionPoint="$1"
enable_ntdll_APC_Performance="$1"
enable_ntdll_APC_Start_Process="$1"
enable_ntdll_Activation_Context="$1"
enable_ntdll_DOS_Attributes="$1"
enable_ntdll_DVD_Read_Size="$1"
enable_ntdll_DllRedirects="$1"
@ -431,6 +432,9 @@ patch_enable ()
ntdll-APC_Start_Process)
enable_ntdll_APC_Start_Process="$2"
;;
ntdll-Activation_Context)
enable_ntdll_Activation_Context="$2"
;;
ntdll-DOS_Attributes)
enable_ntdll_DOS_Attributes="$2"
;;
@ -2388,22 +2392,6 @@ if test "$enable_kernel32_Console_Handles" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-SetFileInformationByHandle
# |
# | Modified files:
# | * dlls/kernel32/file.c, dlls/ntdll/file.c, include/winbase.h, include/winternl.h
# |
if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then
patch_apply kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch
patch_apply kernel32-SetFileInformationByHandle/0002-include-Declare-a-couple-more-file-information-class.patch
patch_apply kernel32-SetFileInformationByHandle/0003-kernel32-Implement-SetFileInformationByHandle.patch
(
echo '+ { "Michael Müller", "ntdll: Define a couple more information classes.", 1 },';
echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },';
echo '+ { "Michael Müller", "kernel32: Implement SetFileInformationByHandle.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-FileDispositionInformation
# |
# | This patchset fixes the following Wine bugs:
@ -2423,6 +2411,22 @@ if test "$enable_ntdll_FileDispositionInformation" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-SetFileInformationByHandle
# |
# | Modified files:
# | * dlls/kernel32/file.c, dlls/ntdll/file.c, include/winbase.h, include/winternl.h
# |
if test "$enable_kernel32_SetFileInformationByHandle" -eq 1; then
patch_apply kernel32-SetFileInformationByHandle/0001-ntdll-Define-a-couple-more-information-classes.patch
patch_apply kernel32-SetFileInformationByHandle/0002-include-Declare-a-couple-more-file-information-class.patch
patch_apply kernel32-SetFileInformationByHandle/0003-kernel32-Implement-SetFileInformationByHandle.patch
(
echo '+ { "Michael Müller", "ntdll: Define a couple more information classes.", 1 },';
echo '+ { "Michael Müller", "include: Declare a couple more file information class structures.", 1 },';
echo '+ { "Michael Müller", "kernel32: Implement SetFileInformationByHandle.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-CopyFileEx
# |
# | This patchset fixes the following Wine bugs:
@ -2784,6 +2788,22 @@ if test "$enable_ntdll_APC_Start_Process" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-Activation_Context
# |
# | Modified files:
# | * dlls/kernel32/actctx.c, dlls/kernel32/tests/actctx.c, dlls/ntdll/actctx.c
# |
if test "$enable_ntdll_Activation_Context" -eq 1; then
patch_apply ntdll-Activation_Context/0001-kernel32-Parameter-validation-tests-for-FindActCtxSe.patch
patch_apply ntdll-Activation_Context/0002-ntdll-RtlFindActivationContextSectionString-should-a.patch
patch_apply ntdll-Activation_Context/0003-ntdll-Fix-return-value-for-missing-ACTIVATION_CONTEX.patch
(
echo '+ { "Mark Jansen", "kernel32: Parameter validation tests for FindActCtxSectionString.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll: RtlFindActivationContextSectionString should accept a NULL pointer as data.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll: Fix return value for missing ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION key.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-DOS_Attributes
# |
# | This patchset fixes the following Wine bugs:
@ -3560,6 +3580,21 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-OpenProcess
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c, server/process.h
# |
if test "$enable_server_OpenProcess" -eq 1; then
patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch
(
echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },';
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
@ -3577,21 +3612,6 @@ if test "$enable_server_Misc_ACL" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-OpenProcess
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c, server/process.h
# |
if test "$enable_server_OpenProcess" -eq 1; then
patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch
(
echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },';
) >> "$patchlist"
fi
# Patchset server-JobObjects
# |
# | This patchset fixes the following Wine bugs: