From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/ntdll/alpc.c | 19 +++++++++++++++++++ dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/tests/alpc.c | 1 - 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/alpc.c b/dlls/ntdll/alpc.c index 81e4641876d..cba85e19a83 100644 --- a/dlls/ntdll/alpc.c +++ b/dlls/ntdll/alpc.c @@ -58,6 +58,25 @@ SIZE_T WINAPI AlpcGetHeaderSize(ULONG attribute_flags) return size; } +void * WINAPI AlpcGetMessageAttribute(ALPC_MESSAGE_ATTRIBUTES *attributes, ULONG attribute_flag) +{ + TRACE("%p, %lx.\n", attributes, attribute_flag); + + /* If no flag is specified */ + if (!attribute_flag) + return NULL; + + /* If more than one flag is specified */ + if (attribute_flag & (attribute_flag - 1)) + return NULL; + + /* If the specified flag is not in allocated attributes */ + if ((attribute_flag & attributes->AllocatedAttributes & ALPC_MESSAGE_ATTRIBUTE_ALL) != attribute_flag) + return NULL; + + return (unsigned char *)attributes + AlpcGetHeaderSize(attributes->AllocatedAttributes & ~(attribute_flag | (attribute_flag - 1))); +} + NTSTATUS WINAPI AlpcInitializeMessageAttribute(ULONG attribute_flags, ALPC_MESSAGE_ATTRIBUTES *buffer, SIZE_T buffer_size, SIZE_T *required_buffer_size) { diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 578bfc7963e..f396c334e2d 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -8,6 +8,7 @@ @ stdcall A_SHAUpdate(ptr ptr long) @ stdcall AlpcGetHeaderSize(long) @ stdcall AlpcInitializeMessageAttribute(long ptr long ptr) +@ stdcall AlpcGetMessageAttribute(ptr long) @ stdcall ApiSetQueryApiSetPresence(ptr ptr) @ stdcall ApiSetQueryApiSetPresenceEx(ptr ptr ptr) @ stub CsrAllocateCaptureBuffer diff --git a/dlls/ntdll/tests/alpc.c b/dlls/ntdll/tests/alpc.c index 667a2899ec5..f34da209041 100644 --- a/dlls/ntdll/tests/alpc.c +++ b/dlls/ntdll/tests/alpc.c @@ -154,7 +154,6 @@ static void test_AlpcGetMessageAttribute(void) if (!pAlpcGetMessageAttribute) { - todo_wine win_skip("AlpcGetMessageAttribute is unavailable.\n"); return; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10492