|
3 | 3 | * trigger editor
|
4 | 4 | *
|
5 | 5 | * Copyright (C) 2011-2015 wj32
|
| 6 | + * Copyright (C) 2020 dmex |
6 | 7 | *
|
7 | 8 | * This file is part of Process Hacker.
|
8 | 9 | *
|
|
21 | 22 | */
|
22 | 23 |
|
23 | 24 | #include "extsrv.h"
|
| 25 | +#include <hndlinfo.h> |
24 | 26 |
|
25 | 27 | typedef struct _ES_TRIGGER_DATA
|
26 | 28 | {
|
@@ -370,53 +372,6 @@ VOID EsDestroyServiceTriggerContext(
|
370 | 372 | PhFree(Context);
|
371 | 373 | }
|
372 | 374 |
|
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 |
| - |
420 | 375 | BOOLEAN EspEnumerateEtwPublishers(
|
421 | 376 | _Out_ PETW_PUBLISHER_ENTRY *Entries,
|
422 | 377 | _Out_ PULONG NumberOfEntries
|
@@ -625,8 +580,8 @@ VOID EspFormatTriggerInfo(
|
625 | 580 | {
|
626 | 581 | PPH_STRING publisherName;
|
627 | 582 |
|
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); |
630 | 585 | stringUsed = PhConcatStrings2(L"Custom: ", publisherName->Buffer);
|
631 | 586 | PhDereferenceObject(publisherName);
|
632 | 587 | triggerString = stringUsed->Buffer;
|
@@ -1335,8 +1290,8 @@ INT_PTR CALLBACK EspServiceTriggerDlgProc(
|
1335 | 1290 | {
|
1336 | 1291 | PPH_STRING publisherName;
|
1337 | 1292 |
|
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); |
1340 | 1295 | PhSelectComboBoxString(GetDlgItem(hwndDlg, IDC_SUBTYPE), publisherName->Buffer, FALSE);
|
1341 | 1296 | PhDereferenceObject(publisherName);
|
1342 | 1297 | }
|
|
0 commit comments