5
5
*
6
6
* Authors:
7
7
*
8
- * dmex 2020-2022
8
+ * dmex 2020-2023
9
9
*
10
10
*/
11
11
@@ -65,7 +65,7 @@ VOID PvDestroyLayoutNode(
65
65
_In_ PPV_LAYOUT_NODE CertificateNode
66
66
);
67
67
BOOLEAN NTAPI PvLayoutTreeNewCallback (
68
- _In_ HWND hwnd ,
68
+ _In_ HWND WindowHandle ,
69
69
_In_ PH_TREENEW_MESSAGE Message ,
70
70
_In_opt_ PVOID Parameter1 ,
71
71
_In_opt_ PVOID Parameter2 ,
@@ -79,7 +79,7 @@ VOID PvInitializeLayoutTree(
79
79
PPH_STRING settings ;
80
80
81
81
Context -> NodeHashtable = PhCreateHashtable (
82
- sizeof (PV_LAYOUT_NODE ),
82
+ sizeof (PPV_LAYOUT_NODE ),
83
83
PvLayoutNodeHashtableEqualFunction ,
84
84
PvLayoutNodeHashtableHashFunction ,
85
85
100
@@ -281,14 +281,14 @@ BEGIN_SORT_FUNCTION(Index)
281
281
END_SORT_FUNCTION
282
282
283
283
BOOLEAN NTAPI PvLayoutTreeNewCallback (
284
- _In_ HWND hwnd ,
284
+ _In_ HWND WindowHandle ,
285
285
_In_ PH_TREENEW_MESSAGE Message ,
286
- _In_opt_ PVOID Parameter1 ,
287
- _In_opt_ PVOID Parameter2 ,
288
- _In_opt_ PVOID Context
286
+ _In_ PVOID Parameter1 ,
287
+ _In_ PVOID Parameter2 ,
288
+ _In_ PVOID Context
289
289
)
290
290
{
291
- PPV_PE_LAYOUT_CONTEXT context = Context ;
291
+ const PPV_PE_LAYOUT_CONTEXT context = Context ;
292
292
PPV_LAYOUT_NODE node ;
293
293
294
294
if (!context )
@@ -298,11 +298,7 @@ BOOLEAN NTAPI PvLayoutTreeNewCallback(
298
298
{
299
299
case TreeNewGetChildren :
300
300
{
301
- PPH_TREENEW_GET_CHILDREN getChildren = Parameter1 ;
302
-
303
- if (!getChildren )
304
- break ;
305
-
301
+ const PPH_TREENEW_GET_CHILDREN getChildren = Parameter1 ;
306
302
node = (PPV_LAYOUT_NODE )getChildren -> Node ;
307
303
308
304
if (!node )
@@ -319,11 +315,7 @@ BOOLEAN NTAPI PvLayoutTreeNewCallback(
319
315
return TRUE;
320
316
case TreeNewIsLeaf :
321
317
{
322
- PPH_TREENEW_IS_LEAF isLeaf = Parameter1 ;
323
-
324
- if (!isLeaf )
325
- break ;
326
-
318
+ const PPH_TREENEW_IS_LEAF isLeaf = Parameter1 ;
327
319
node = (PPV_LAYOUT_NODE )isLeaf -> Node ;
328
320
329
321
if (context -> TreeNewSortOrder == NoSortOrder )
@@ -334,11 +326,7 @@ BOOLEAN NTAPI PvLayoutTreeNewCallback(
334
326
return TRUE;
335
327
case TreeNewGetCellText :
336
328
{
337
- PPH_TREENEW_GET_CELL_TEXT getCellText = Parameter1 ;
338
-
339
- if (!getCellText )
340
- break ;
341
-
329
+ const PPH_TREENEW_GET_CELL_TEXT getCellText = Parameter1 ;
342
330
node = (PPV_LAYOUT_NODE )getCellText -> Node ;
343
331
344
332
switch (getCellText -> Id )
@@ -362,29 +350,22 @@ BOOLEAN NTAPI PvLayoutTreeNewCallback(
362
350
return TRUE;
363
351
case TreeNewGetNodeColor :
364
352
{
365
- PPH_TREENEW_GET_NODE_COLOR getNodeColor = Parameter1 ;
366
-
367
- if (!getNodeColor )
368
- break ;
369
-
353
+ const PPH_TREENEW_GET_NODE_COLOR getNodeColor = Parameter1 ;
370
354
node = (PPV_LAYOUT_NODE )getNodeColor -> Node ;
371
355
372
356
getNodeColor -> Flags = TN_AUTO_FORECOLOR | TN_CACHE ;
373
357
}
374
358
return TRUE;
375
359
case TreeNewSortChanged :
376
360
{
377
- TreeNew_GetSort (hwnd , & context -> TreeNewSortColumn , & context -> TreeNewSortOrder );
361
+ TreeNew_GetSort (WindowHandle , & context -> TreeNewSortColumn , & context -> TreeNewSortOrder );
378
362
// Force a rebuild to sort the items.
379
- TreeNew_NodesStructured (hwnd );
363
+ TreeNew_NodesStructured (WindowHandle );
380
364
}
381
365
return TRUE;
382
366
case TreeNewKeyDown :
383
367
{
384
- PPH_TREENEW_KEY_EVENT keyEvent = Parameter1 ;
385
-
386
- if (!keyEvent )
387
- break ;
368
+ const PPH_TREENEW_KEY_EVENT keyEvent = Parameter1 ;
388
369
389
370
switch (keyEvent -> VirtualKey )
390
371
{
@@ -402,7 +383,7 @@ BOOLEAN NTAPI PvLayoutTreeNewCallback(
402
383
return TRUE;
403
384
case TreeNewContextMenu :
404
385
{
405
- PPH_TREENEW_CONTEXT_MENU contextMenuEvent = Parameter1 ;
386
+ const PPH_TREENEW_CONTEXT_MENU contextMenuEvent = Parameter1 ;
406
387
407
388
SendMessage (context -> WindowHandle , WM_COMMAND , WM_PV_LAYOUT_CONTEXTMENU , (LPARAM )contextMenuEvent );
408
389
}
@@ -411,13 +392,13 @@ BOOLEAN NTAPI PvLayoutTreeNewCallback(
411
392
{
412
393
//PH_TN_COLUMN_MENU_DATA data;
413
394
414
- //data.TreeNewHandle = hwnd ;
395
+ //data.TreeNewHandle = WindowHandle ;
415
396
//data.MouseEvent = Parameter1;
416
397
//data.DefaultSortColumn = 0;
417
398
//data.DefaultSortOrder = AscendingSortOrder;
418
399
//PhInitializeTreeNewColumnMenuEx(&data, PH_TN_COLUMN_MENU_SHOW_RESET_SORT);
419
400
420
- //data.Selection = PhShowEMenu(data.Menu, hwnd , PH_EMENU_SHOW_LEFTRIGHT,
401
+ //data.Selection = PhShowEMenu(data.Menu, WindowHandle , PH_EMENU_SHOW_LEFTRIGHT,
421
402
// PH_ALIGN_LEFT | PH_ALIGN_TOP, data.MouseEvent->ScreenLocation.x, data.MouseEvent->ScreenLocation.y);
422
403
//PhHandleTreeNewColumnMenu(&data);
423
404
//PhDeleteTreeNewColumnMenu(&data);
@@ -446,7 +427,7 @@ PPV_LAYOUT_NODE PvGetSelectedLayoutNode(
446
427
{
447
428
for (ULONG i = 0 ; i < Context -> NodeList -> Count ; i ++ )
448
429
{
449
- PPV_LAYOUT_NODE layoutNode = Context -> NodeList -> Items [i ];
430
+ const PPV_LAYOUT_NODE layoutNode = Context -> NodeList -> Items [i ];
450
431
451
432
if (layoutNode -> Node .Selected )
452
433
return layoutNode ;
@@ -469,7 +450,7 @@ BOOLEAN PvGetSelectedLayoutNodes(
469
450
470
451
for (i = 0 ; i < Context -> NodeList -> Count ; i ++ )
471
452
{
472
- PPV_LAYOUT_NODE node = Context -> NodeList -> Items [i ];
453
+ const PPV_LAYOUT_NODE node = Context -> NodeList -> Items [i ];
473
454
474
455
if (node -> Node .Selected )
475
456
{
@@ -500,7 +481,7 @@ VOID PvExpandAllLayoutNodes(
500
481
501
482
for (i = 0 ; i < Context -> NodeList -> Count ; i ++ )
502
483
{
503
- PPV_LAYOUT_NODE node = Context -> NodeList -> Items [i ];
484
+ const PPV_LAYOUT_NODE node = Context -> NodeList -> Items [i ];
504
485
505
486
if (node -> Children -> Count != 0 && node -> Node .Expanded != Expand )
506
487
{
@@ -782,8 +763,8 @@ PPH_STRING PvLayoutFormatSize(
782
763
#define FILE_LAYOUT_ENTRY_VERSION 0x1
783
764
#define STREAM_LAYOUT_ENTRY_VERSION 0x1
784
765
#define PH_FIRST_LAYOUT_ENTRY (LayoutEntry ) \
785
- ((PFILE_LAYOUT_ENTRY)(PTR_ADD_OFFSET(LayoutEntry, \
786
- ((PQUERY_FILE_LAYOUT_OUTPUT)LayoutEntry)->FirstFileOffset)))
766
+ ((PFILE_LAYOUT_ENTRY)(PTR_ADD_OFFSET(( LayoutEntry) , \
767
+ ((PQUERY_FILE_LAYOUT_OUTPUT)( LayoutEntry) )->FirstFileOffset)))
787
768
#define PH_NEXT_LAYOUT_ENTRY (LayoutEntry ) ( \
788
769
((PFILE_LAYOUT_ENTRY)(LayoutEntry))->NextFileOffset ? \
789
770
(PFILE_LAYOUT_ENTRY)(PTR_ADD_OFFSET((LayoutEntry), \
@@ -1149,8 +1130,8 @@ NTSTATUS PvLayoutEnumerateFileLayouts(
1149
1130
PvAddChildLayoutNode (Context , NULL , L"File attributes" , PhFormatUInt64 (fileLayoutEntry -> FileAttributes , FALSE));
1150
1131
PvAddChildLayoutNode (Context , NULL , L"File entry flags" , PhFormatUInt64 (fileLayoutEntry -> Flags , FALSE));
1151
1132
PvAddChildLayoutNode (Context , NULL , L"Creation time" , PvLayoutGetRelativeTimeString (& fileLayoutInfoEntry -> BasicInformation .CreationTime ));
1152
- //PvAddChildLayoutNode(Context, NULL, L"Last access time", PvLayoutGetRelativeTimeString(&fileLayoutInfoEntry->BasicInformation.LastAccessTime));
1153
- PvAddChildLayoutNode (Context , NULL , L"Last write time" , PvLayoutGetRelativeTimeString (& fileLayoutInfoEntry -> BasicInformation .LastWriteTime ));
1133
+ //PvAddChildLayoutNode(Context, NULL, L"Access time", PvLayoutGetRelativeTimeString(&fileLayoutInfoEntry->BasicInformation.LastAccessTime));
1134
+ PvAddChildLayoutNode (Context , NULL , L"Write time" , PvLayoutGetRelativeTimeString (& fileLayoutInfoEntry -> BasicInformation .LastWriteTime ));
1154
1135
PvAddChildLayoutNode (Context , NULL , L"Change time" , PvLayoutGetRelativeTimeString (& fileLayoutInfoEntry -> BasicInformation .ChangeTime ));
1155
1136
PvAddChildLayoutNode (Context , NULL , L"LastUsn" , PhFormatUInt64 (fileLayoutInfoEntry -> Usn , FALSE));
1156
1137
PvAddChildLayoutNode (Context , NULL , L"OwnerId" , PhFormatUInt64 (fileLayoutInfoEntry -> OwnerId , FALSE));
0 commit comments