ntdll: RtlFindActivationContextSectionString should accept a NULL pointer as data.
This commit is contained in:
parent
f091ff5851
commit
ab91c01112
@ -227,7 +227,7 @@ BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID* lpExtGuid,
|
|||||||
TRACE("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
|
TRACE("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
|
||||||
ulId, debugstr_a(lpSearchStr), pInfo);
|
ulId, debugstr_a(lpSearchStr), pInfo);
|
||||||
|
|
||||||
if (!lpSearchStr)
|
if (!lpSearchStr || !pInfo)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -255,6 +255,12 @@ BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID* lpExtGuid,
|
|||||||
UNICODE_STRING us;
|
UNICODE_STRING us;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
|
if (!pInfo)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
RtlInitUnicodeString(&us, lpSearchStr);
|
RtlInitUnicodeString(&us, lpSearchStr);
|
||||||
if ((status = RtlFindActivationContextSectionString(dwFlags, lpExtGuid, ulId, &us, pInfo)))
|
if ((status = RtlFindActivationContextSectionString(dwFlags, lpExtGuid, ulId, &us, pInfo)))
|
||||||
{
|
{
|
||||||
|
@ -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);
|
"RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
|
||||||
|
|
||||||
ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
|
ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
|
||||||
todo_wine
|
if (todo)
|
||||||
ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
|
todo_wine
|
||||||
"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);
|
||||||
|
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);
|
pRtlFreeUnicodeString(&string_to_findW);
|
||||||
}
|
}
|
||||||
|
@ -3133,19 +3133,22 @@ static NTSTATUS find_dll_redirection(ACTIVATION_CONTEXT* actctx, const UNICODE_S
|
|||||||
index = find_string_index(actctx->dllredirect_section, name);
|
index = find_string_index(actctx->dllredirect_section, name);
|
||||||
if (!index) return STATUS_SXS_KEY_NOT_FOUND;
|
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->ulDataFormatVersion = 1;
|
||||||
data->lpData = dll;
|
data->lpData = dll;
|
||||||
data->ulLength = dll->size;
|
data->ulLength = dll->size;
|
||||||
data->lpSectionGlobalData = NULL;
|
data->lpSectionGlobalData = NULL;
|
||||||
data->ulSectionGlobalDataLength = 0;
|
data->ulSectionGlobalDataLength = 0;
|
||||||
data->lpSectionBase = actctx->dllredirect_section;
|
data->lpSectionBase = actctx->dllredirect_section;
|
||||||
data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
|
data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
|
||||||
data->hActCtx = NULL;
|
data->hActCtx = NULL;
|
||||||
|
|
||||||
if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
|
if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
|
||||||
data->ulAssemblyRosterIndex = index->rosterindex;
|
data->ulAssemblyRosterIndex = index->rosterindex;
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -3342,20 +3345,23 @@ static NTSTATUS find_window_class(ACTIVATION_CONTEXT* actctx, const UNICODE_STRI
|
|||||||
|
|
||||||
if (!index) return STATUS_SXS_KEY_NOT_FOUND;
|
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->ulDataFormatVersion = 1;
|
||||||
data->lpData = class;
|
data->lpData = class;
|
||||||
/* full length includes string length with nulls */
|
/* full length includes string length with nulls */
|
||||||
data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
|
data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
|
||||||
data->lpSectionGlobalData = NULL;
|
data->lpSectionGlobalData = NULL;
|
||||||
data->ulSectionGlobalDataLength = 0;
|
data->ulSectionGlobalDataLength = 0;
|
||||||
data->lpSectionBase = actctx->wndclass_section;
|
data->lpSectionBase = actctx->wndclass_section;
|
||||||
data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
|
data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
|
||||||
data->hActCtx = NULL;
|
data->hActCtx = NULL;
|
||||||
|
|
||||||
if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
|
if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
|
||||||
data->ulAssemblyRosterIndex = index->rosterindex;
|
data->ulAssemblyRosterIndex = index->rosterindex;
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -4397,19 +4403,22 @@ static NTSTATUS find_progid_redirection(ACTIVATION_CONTEXT* actctx, const UNICOD
|
|||||||
index = find_string_index(actctx->progid_section, name);
|
index = find_string_index(actctx->progid_section, name);
|
||||||
if (!index) return STATUS_SXS_KEY_NOT_FOUND;
|
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->ulDataFormatVersion = 1;
|
||||||
data->lpData = progid;
|
data->lpData = progid;
|
||||||
data->ulLength = progid->size;
|
data->ulLength = progid->size;
|
||||||
data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
|
data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
|
||||||
data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
|
data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
|
||||||
data->lpSectionBase = actctx->progid_section;
|
data->lpSectionBase = actctx->progid_section;
|
||||||
data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
|
data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
|
||||||
data->hActCtx = NULL;
|
data->hActCtx = NULL;
|
||||||
|
|
||||||
if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
|
if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
|
||||||
data->ulAssemblyRosterIndex = index->rosterindex;
|
data->ulAssemblyRosterIndex = index->rosterindex;
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -4441,7 +4450,7 @@ static NTSTATUS find_string(ACTIVATION_CONTEXT* actctx, ULONG section_kind,
|
|||||||
|
|
||||||
if (status != STATUS_SUCCESS) return status;
|
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);
|
actctx_addref(actctx);
|
||||||
data->hActCtx = actctx;
|
data->hActCtx = actctx;
|
||||||
@ -5008,7 +5017,7 @@ NTSTATUS WINAPI RtlFindActivationContextSectionString( ULONG flags, const GUID *
|
|||||||
FIXME("unknown flags %08x\n", flags);
|
FIXME("unknown flags %08x\n", flags);
|
||||||
return STATUS_INVALID_PARAMETER;
|
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)
|
!section_name || !section_name->Buffer)
|
||||||
{
|
{
|
||||||
WARN("invalid parameter\n");
|
WARN("invalid parameter\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user