@@ -562,6 +562,12 @@ VOID PhpRemoveProcessNode(
562
562
PhClearReference (& ProcessNode -> VirtualSizeText );
563
563
PhClearReference (& ProcessNode -> PeakVirtualSizeText );
564
564
PhClearReference (& ProcessNode -> PageFaultsText );
565
+ PhClearReference (& ProcessNode -> SessionIdText );
566
+ PhClearReference (& ProcessNode -> BasePriorityText );
567
+ PhClearReference (& ProcessNode -> ThreadsText );
568
+ PhClearReference (& ProcessNode -> HandlesText );
569
+ PhClearReference (& ProcessNode -> GdiHandlesText );
570
+ PhClearReference (& ProcessNode -> UserHandlesText );
565
571
PhClearReference (& ProcessNode -> IoRoRateText );
566
572
PhClearReference (& ProcessNode -> IoWRateText );
567
573
PhClearReference (& ProcessNode -> StartTimeText );
@@ -587,8 +593,12 @@ VOID PhpRemoveProcessNode(
587
593
PhClearReference (& ProcessNode -> FileModifiedTimeText );
588
594
PhClearReference (& ProcessNode -> FileSizeText );
589
595
PhClearReference (& ProcessNode -> SubprocessCountText );
596
+ PhClearReference (& ProcessNode -> JobObjectIdText );
590
597
PhClearReference (& ProcessNode -> ProtectionText );
591
598
PhClearReference (& ProcessNode -> DesktopInfoText );
599
+ PhClearReference (& ProcessNode -> PidHexText );
600
+ PhClearReference (& ProcessNode -> CpuCoreUsageText );
601
+ PhClearReference (& ProcessNode -> ImageCoherencyText );
592
602
PhClearReference (& ProcessNode -> ImageCoherencyStatusText );
593
603
PhClearReference (& ProcessNode -> CodePageText );
594
604
@@ -2517,27 +2527,36 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
2517
2527
}
2518
2528
break ;
2519
2529
case PHPRTLC_SESSIONID :
2520
- PhInitializeStringRefLongHint (& getCellText -> Text , processItem -> SessionIdString );
2530
+ {
2531
+ PhMoveReference (& node -> SessionIdText , PhFormatUInt64 (processItem -> SessionId , TRUE));
2532
+ getCellText -> Text = node -> SessionIdText -> sr ;
2533
+ }
2521
2534
break ;
2522
2535
case PHPRTLC_PRIORITYCLASS :
2523
2536
PhInitializeStringRefLongHint (& getCellText -> Text , PhGetProcessPriorityClassString (processItem -> PriorityClass ));
2524
2537
break ;
2525
2538
case PHPRTLC_BASEPRIORITY :
2526
- PhPrintInt32 (node -> BasePriorityText , processItem -> BasePriority );
2527
- PhInitializeStringRefLongHint (& getCellText -> Text , node -> BasePriorityText );
2539
+ {
2540
+ PhMoveReference (& node -> BasePriorityText , PhFormatUInt64 (processItem -> BasePriority , TRUE));
2541
+ getCellText -> Text = node -> BasePriorityText -> sr ;
2542
+ }
2528
2543
break ;
2529
2544
case PHPRTLC_THREADS :
2530
2545
{
2531
2546
ULONG value = 0 ;
2532
2547
PhpAggregateFieldIfNeeded (node , AggregateTypeInt32 , AggregateLocationProcessItem , FIELD_OFFSET (PH_PROCESS_ITEM , NumberOfThreads ), & value );
2533
- PhpFormatInt32GroupDigits (value , node -> ThreadsText , sizeof (node -> ThreadsText ), & getCellText -> Text );
2548
+ //PhpFormatInt32GroupDigits(value, node->ThreadsText, sizeof(node->ThreadsText), &getCellText->Text);
2549
+ PhMoveReference (& node -> ThreadsText , PhFormatUInt64 (value , TRUE));
2550
+ getCellText -> Text = node -> ThreadsText -> sr ;
2534
2551
}
2535
2552
break ;
2536
2553
case PHPRTLC_HANDLES :
2537
2554
{
2538
2555
ULONG value = 0 ;
2539
2556
PhpAggregateFieldIfNeeded (node , AggregateTypeInt32 , AggregateLocationProcessItem , FIELD_OFFSET (PH_PROCESS_ITEM , NumberOfHandles ), & value );
2540
- PhpFormatInt32GroupDigits (value , node -> HandlesText , sizeof (node -> HandlesText ), & getCellText -> Text );
2557
+ //PhpFormatInt32GroupDigits(value, node->HandlesText, sizeof(node->HandlesText), &getCellText->Text);
2558
+ PhMoveReference (& node -> HandlesText , PhFormatUInt64 (value , TRUE));
2559
+ getCellText -> Text = node -> HandlesText -> sr ;
2541
2560
}
2542
2561
break ;
2543
2562
case PHPRTLC_GDIHANDLES :
@@ -2546,7 +2565,9 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
2546
2565
2547
2566
ULONG value = 0 ;
2548
2567
PhpAggregateFieldIfNeeded (node , AggregateTypeInt32 , AggregateLocationProcessNode , FIELD_OFFSET (PH_PROCESS_NODE , GdiHandles ), & value );
2549
- PhpFormatInt32GroupDigits (value , node -> GdiHandlesText , sizeof (node -> GdiHandlesText ), & getCellText -> Text );
2568
+ //PhpFormatInt32GroupDigits(value, node->GdiHandlesText, sizeof(node->GdiHandlesText), &getCellText->Text);
2569
+ PhMoveReference (& node -> GdiHandlesText , PhFormatUInt64 (value , TRUE));
2570
+ getCellText -> Text = node -> GdiHandlesText -> sr ;
2550
2571
}
2551
2572
break ;
2552
2573
case PHPRTLC_USERHANDLES :
@@ -2555,7 +2576,9 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
2555
2576
2556
2577
ULONG value = 0 ;
2557
2578
PhpAggregateFieldIfNeeded (node , AggregateTypeInt32 , AggregateLocationProcessNode , FIELD_OFFSET (PH_PROCESS_NODE , UserHandles ), & value );
2558
- PhpFormatInt32GroupDigits (value , node -> UserHandlesText , sizeof (node -> UserHandlesText ), & getCellText -> Text );
2579
+ //PhpFormatInt32GroupDigits(value, node->UserHandlesText, sizeof(node->UserHandlesText), &getCellText->Text);
2580
+ PhMoveReference (& node -> UserHandlesText , PhFormatUInt64 (value , TRUE));
2581
+ getCellText -> Text = node -> UserHandlesText -> sr ;
2559
2582
}
2560
2583
break ;
2561
2584
case PHPRTLC_IORORATE :
@@ -3149,8 +3172,8 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
3149
3172
{
3150
3173
if (processItem -> JobObjectId != 0 )
3151
3174
{
3152
- PhPrintInt32 ( node -> JobObjectIdText , processItem -> JobObjectId );
3153
- PhInitializeStringRefLongHint ( & getCellText -> Text , node -> JobObjectIdText ) ;
3175
+ PhMoveReference ( & node -> JobObjectIdText , PhFormatUInt64 ( processItem -> JobObjectId , TRUE) );
3176
+ getCellText -> Text = node -> JobObjectIdText -> sr ;
3154
3177
}
3155
3178
}
3156
3179
break ;
@@ -3182,15 +3205,11 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
3182
3205
if (PH_IS_REAL_PROCESS_ID (processItem -> ProcessId ))
3183
3206
{
3184
3207
PH_FORMAT format ;
3185
- SIZE_T returnLength ;
3186
3208
3187
3209
PhInitFormatIX (& format , HandleToUlong (processItem -> ProcessId ));
3188
3210
3189
- if (PhFormatToBuffer (& format , 1 , node -> PidHexText , sizeof (node -> PidHexText ), & returnLength ))
3190
- {
3191
- getCellText -> Text .Buffer = node -> PidHexText ;
3192
- getCellText -> Text .Length = returnLength - sizeof (UNICODE_NULL );
3193
- }
3211
+ PhMoveReference (& node -> PidHexText , PhFormat (& format , 1 , 0 ));
3212
+ getCellText -> Text = node -> PidHexText -> sr ;
3194
3213
}
3195
3214
}
3196
3215
break ;
@@ -3206,29 +3225,21 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
3206
3225
if (cpuUsage >= 0.01 )
3207
3226
{
3208
3227
PH_FORMAT format ;
3209
- SIZE_T returnLength ;
3210
3228
3211
3229
PhInitFormatF (& format , cpuUsage , 2 );
3212
3230
3213
- if (PhFormatToBuffer (& format , 1 , node -> CpuCoreUsageText , sizeof (node -> CpuCoreUsageText ), & returnLength ))
3214
- {
3215
- getCellText -> Text .Buffer = node -> CpuCoreUsageText ;
3216
- getCellText -> Text .Length = returnLength - sizeof (UNICODE_NULL ); // minus null terminator
3217
- }
3231
+ PhMoveReference (& node -> CpuCoreUsageText , PhFormat (& format , 1 , 0 ));
3232
+ getCellText -> Text = node -> CpuCoreUsageText -> sr ;
3218
3233
}
3219
3234
else if (cpuUsage != 0 && PhCsShowCpuBelow001 )
3220
3235
{
3221
3236
PH_FORMAT format [2 ];
3222
- SIZE_T returnLength ;
3223
3237
3224
3238
PhInitFormatS (& format [0 ], L"< " );
3225
3239
PhInitFormatF (& format [1 ], 0.01 , 2 );
3226
3240
3227
- if (PhFormatToBuffer (format , 2 , node -> CpuCoreUsageText , sizeof (node -> CpuCoreUsageText ), & returnLength ))
3228
- {
3229
- getCellText -> Text .Buffer = node -> CpuCoreUsageText ;
3230
- getCellText -> Text .Length = returnLength - sizeof (UNICODE_NULL );
3231
- }
3241
+ PhMoveReference (& node -> CpuCoreUsageText , PhFormat (format , RTL_NUMBER_OF (format ), 0 ));
3242
+ getCellText -> Text = node -> CpuCoreUsageText -> sr ;
3232
3243
}
3233
3244
}
3234
3245
break ;
@@ -3239,7 +3250,6 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
3239
3250
case PHPRTLC_IMAGE_COHERENCY :
3240
3251
{
3241
3252
PH_FORMAT format [2 ];
3242
- SIZE_T returnLength ;
3243
3253
3244
3254
if (!PhEnableImageCoherencySupport )
3245
3255
break ;
@@ -3272,13 +3282,10 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
3272
3282
PhInitFormatF (& format [0 ], (DOUBLE )(processItem -> ImageCoherency * 100.f ), 2 );
3273
3283
PhInitFormatS (& format [1 ], L"%" );
3274
3284
3275
- if (PhFormatToBuffer (format , RTL_NUMBER_OF (format ), node -> ImageCoherencyText , sizeof (node -> ImageCoherencyText ), & returnLength ))
3276
- {
3277
- getCellText -> Text .Buffer = node -> ImageCoherencyText ;
3278
- getCellText -> Text .Length = returnLength - sizeof (UNICODE_NULL );
3279
- }
3280
- break ;
3285
+ PhMoveReference (& node -> ImageCoherencyText , PhFormat (format , RTL_NUMBER_OF (format ), 0 ));
3286
+ getCellText -> Text = node -> ImageCoherencyText -> sr ;
3281
3287
}
3288
+ break ;
3282
3289
case PHPRTLC_ERRORMODE :
3283
3290
{
3284
3291
PhpUpdateProcessNodeErrorMode (node );
0 commit comments