[PATCH v2 0/1] MR1016: ntoskrnl.exe: Implement IoCreateNotificationEvent
xigncode3 seems to use it -- v2: ntoskrnl.exe: Implement IoCreateNotificationEvent https://gitlab.winehq.org/wine/wine/-/merge_requests/1016
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> change handle to ret_handle in TRACE --- dlls/ntoskrnl.exe/ntoskrnl.c | 10 ---------- dlls/ntoskrnl.exe/sync.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index fd18ea706c2..6fa47dd05a4 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -4066,16 +4066,6 @@ NTSTATUS WINAPI IoCreateFile(HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUT create_options, ea_buffer, ea_length, file_type, parameters, options, NULL); } -/*********************************************************************** - * IoCreateNotificationEvent (NTOSKRNL.EXE.@) - */ -PKEVENT WINAPI IoCreateNotificationEvent(UNICODE_STRING *name, HANDLE *handle) -{ - FIXME( "stub: %s %p\n", debugstr_us(name), handle ); - return NULL; -} - - /************************************************************************** * __chkstk (NTOSKRNL.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index b8239b0cd7d..eab79789f10 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -215,7 +215,7 @@ PKEVENT WINAPI IoCreateSynchronizationEvent( UNICODE_STRING *name, HANDLE *ret_h KEVENT *event; NTSTATUS ret; - TRACE( "(%p %p)\n", name, ret_handle ); + TRACE( "(%s %p)\n", debugstr_us(name), ret_handle ); InitializeObjectAttributes( &attr, name, 0, 0, NULL ); ret = NtCreateEvent( &handle, EVENT_ALL_ACCESS, &attr, SynchronizationEvent, TRUE ); @@ -223,7 +223,33 @@ PKEVENT WINAPI IoCreateSynchronizationEvent( UNICODE_STRING *name, HANDLE *ret_h if (kernel_object_from_handle( handle, ExEventObjectType, (void**)&event )) { - NtClose( handle); + NtClose(handle); + return NULL; + } + + *ret_handle = handle; + return event; +} + +/*********************************************************************** + * IoCreateNotificationEvent (NTOSKRNL.EXE.@) + */ +PKEVENT WINAPI IoCreateNotificationEvent( UNICODE_STRING *name, HANDLE *ret_handle ) +{ + OBJECT_ATTRIBUTES attr; + HANDLE handle; + KEVENT *event; + NTSTATUS ret; + + TRACE( "(%s %p)\n", debugstr_us(name), ret_handle ); + + InitializeObjectAttributes( &attr, name, 0, 0, NULL ); + ret = NtCreateEvent( &handle, EVENT_ALL_ACCESS, &attr, NotificationEvent, TRUE ); + if (ret) return NULL; + + if (kernel_object_from_handle( handle, ExEventObjectType, (void**)&event )) + { + NtClose(handle); return NULL; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1016
Jinoh Kang (@iamahuman) commented about dlls/ntoskrnl.exe/sync.c:
KEVENT *event; NTSTATUS ret;
- TRACE( "(%p %p)\n", name, ret_handle ); + TRACE( "(%s %p)\n", debugstr_us(name), ret_handle );
You should put this change (along with the `NtClose` parameter spacing change) in a separate commit. It should help the diff algorithm as well. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1016#note_10122
Thanks for your hard work on helping Wine work with anti-cheat systems! There's a few things that could be improved, though; foremost, your patch subject should end with a trailing period ("."). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1016#note_10123
participants (3)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty) -
Jinoh Kang (@iamahuman)