Skip to content

Commit a80b39c

Browse files
committed
peview: Use native timer queue
1 parent 6b14d39 commit a80b39c

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

tools/peview/include/peview.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ typedef struct _PDB_SYMBOL_CONTEXT
210210
HWND TreeNewHandle;
211211
HWND ParentWindowHandle;
212212
HANDLE SearchThreadHandle;
213-
HANDLE UpdateTimer;
213+
214+
HANDLE TimerQueueHandle;
215+
HANDLE UpdateTimerHandle;
214216

215217
ULONG64 BaseAddress;
216218
PPH_STRING FileName;

tools/peview/pdbprp.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ VOID CALLBACK PvSymbolTreeUpdateCallback(
908908
TreeNew_NodesStructured(Context->TreeNewHandle);
909909
TreeNew_SetRedraw(Context->TreeNewHandle, TRUE);
910910

911-
ChangeTimerQueueTimer(NULL, Context->UpdateTimer, 1000, INFINITE);
911+
RtlUpdateTimer(Context->TimerQueueHandle, Context->UpdateTimerHandle, 1000, INFINITE);
912912
}
913913

914914
INT_PTR CALLBACK PvpSymbolsDlgProc(
@@ -958,26 +958,29 @@ INT_PTR CALLBACK PvpSymbolsDlgProc(
958958

959959
context->SearchThreadHandle = PhCreateThread(0, PeDumpFileSymbols, context);
960960

961-
if (CreateTimerQueueTimer(
962-
&treeNewTimer,
963-
NULL,
964-
PvSymbolTreeUpdateCallback,
965-
context,
966-
1000,
967-
1000,
968-
0
969-
))
961+
if (NT_SUCCESS(RtlCreateTimerQueue(&context->TimerQueueHandle)))
970962
{
971-
context->UpdateTimer = treeNewTimer;
963+
RtlCreateTimer(
964+
context->TimerQueueHandle,
965+
&context->UpdateTimerHandle,
966+
PvSymbolTreeUpdateCallback,
967+
context,
968+
0,
969+
1000,
970+
0
971+
);
972972
}
973973

974974
EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
975975
}
976976
break;
977977
case WM_DESTROY:
978978
{
979-
if (context->UpdateTimer)
980-
DeleteTimerQueueTimer(NULL, context->UpdateTimer, NULL);
979+
if (context->UpdateTimerHandle)
980+
RtlDeleteTimer(context->TimerQueueHandle, context->UpdateTimerHandle, NULL);
981+
982+
if (context->TimerQueueHandle)
983+
RtlDeleteTimerQueue(context->TimerQueueHandle);
981984

982985
NtClose(context->SearchThreadHandle);
983986

0 commit comments

Comments
 (0)