Skip to content

Commit 5c9b9a2

Browse files
committed
ExtendedServices: Remove legacy ETW lookup
1 parent 87fe566 commit 5c9b9a2

File tree

1 file changed

+6
-51
lines changed

1 file changed

+6
-51
lines changed

plugins/ExtendedServices/trigger.c

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* trigger editor
44
*
55
* Copyright (C) 2011-2015 wj32
6+
* Copyright (C) 2020 dmex
67
*
78
* This file is part of Process Hacker.
89
*
@@ -21,6 +22,7 @@
2122
*/
2223

2324
#include "extsrv.h"
25+
#include <hndlinfo.h>
2426

2527
typedef struct _ES_TRIGGER_DATA
2628
{
@@ -370,53 +372,6 @@ VOID EsDestroyServiceTriggerContext(
370372
PhFree(Context);
371373
}
372374

373-
PPH_STRING EspLookupEtwPublisherName(
374-
_In_ PGUID Guid
375-
)
376-
{
377-
PPH_STRING guidString;
378-
PPH_STRING keyName;
379-
HANDLE keyHandle;
380-
PPH_STRING publisherName = NULL;
381-
382-
// Copied from ProcessHacker\hndlinfo.c.
383-
384-
guidString = PhFormatGuid(Guid);
385-
386-
keyName = PhConcatStringRef2(&PublishersKeyName, &guidString->sr);
387-
388-
if (NT_SUCCESS(PhOpenKey(
389-
&keyHandle,
390-
KEY_READ,
391-
PH_KEY_LOCAL_MACHINE,
392-
&keyName->sr,
393-
0
394-
)))
395-
{
396-
publisherName = PhQueryRegistryString(keyHandle, NULL);
397-
398-
if (publisherName && publisherName->Length == 0)
399-
{
400-
PhDereferenceObject(publisherName);
401-
publisherName = NULL;
402-
}
403-
404-
NtClose(keyHandle);
405-
}
406-
407-
PhDereferenceObject(keyName);
408-
409-
if (publisherName)
410-
{
411-
PhDereferenceObject(guidString);
412-
return publisherName;
413-
}
414-
else
415-
{
416-
return guidString;
417-
}
418-
}
419-
420375
BOOLEAN EspEnumerateEtwPublishers(
421376
_Out_ PETW_PUBLISHER_ENTRY *Entries,
422377
_Out_ PULONG NumberOfEntries
@@ -625,8 +580,8 @@ VOID EspFormatTriggerInfo(
625580
{
626581
PPH_STRING publisherName;
627582

628-
// Try to lookup the publisher name from the GUID.
629-
publisherName = EspLookupEtwPublisherName(Info->Subtype);
583+
// Try to lookup the publisher name from the GUID. (wj32)
584+
publisherName = PhGetEtwPublisherName(Info->Subtype);
630585
stringUsed = PhConcatStrings2(L"Custom: ", publisherName->Buffer);
631586
PhDereferenceObject(publisherName);
632587
triggerString = stringUsed->Buffer;
@@ -1335,8 +1290,8 @@ INT_PTR CALLBACK EspServiceTriggerDlgProc(
13351290
{
13361291
PPH_STRING publisherName;
13371292

1338-
// Try to select the publisher name in the subtype list.
1339-
publisherName = EspLookupEtwPublisherName(context->EditingInfo->Subtype);
1293+
// Try to select the publisher name in the subtype list. (wj32)
1294+
publisherName = PhGetEtwPublisherName(context->EditingInfo->Subtype);
13401295
PhSelectComboBoxString(GetDlgItem(hwndDlg, IDC_SUBTYPE), publisherName->Buffer, FALSE);
13411296
PhDereferenceObject(publisherName);
13421297
}

0 commit comments

Comments
 (0)