https://git.reactos.org/?p=reactos.git;a=commitdiff;h=17a9041da14ca47494ff02d0fe49fe315a8e6a5d

commit 17a9041da14ca47494ff02d0fe49fe315a8e6a5d
Author:     Serge Gautherie <[email protected]>
AuthorDate: Wed Sep 9 03:46:56 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Feb 17 18:59:09 2021 +0100

    [NTOS:WMI] IoWMIWriteEvent(): Add WNODE_FLAG_TRACED_GUID case
    
    Addendum to d5f8964 (r23040).
    CORE-17384
---
 ntoskrnl/wmi/wmi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ntoskrnl/wmi/wmi.c b/ntoskrnl/wmi/wmi.c
index b27e134f811..7d6d2bb21a8 100644
--- a/ntoskrnl/wmi/wmi.c
+++ b/ntoskrnl/wmi/wmi.c
@@ -111,6 +111,15 @@ IoWMIWriteEvent(_Inout_ PVOID WnodeEventItem)
     DPRINT1("IoWMIWriteEvent() called for WnodeEventItem %p (Flags = 0x%08lx), 
returning success\n",
             WnodeEventItem, ((PWNODE_HEADER)WnodeEventItem)->Flags);
 
+    if (((PWNODE_HEADER)WnodeEventItem)->Flags & WNODE_FLAG_TRACED_GUID)
+    {
+        DPRINT("IoWMIWriteEvent(): Flags has WNODE_FLAG_TRACED_GUID\n");
+
+        // Never free WnodeEventItem in this case.
+
+        return STATUS_SUCCESS;
+    }
+
     /* Free the buffer if we are returning success */
     if (WnodeEventItem != NULL)
         ExFreePool(WnodeEventItem);

Reply via email to