42 typedef struct _COLUMN_INFO
49 BOOLEAN SortDescending;
52 static ULONG ProcessTreeListSortColumn;
55 static GUID IID_INetFwMgr_I = { 0xf7898af5, 0xcac4, 0x4632, { 0xa2, 0xec, 0xda, 0x06, 0xe5, 0x11, 0x1a, 0xf2 } };
56 static GUID CLSID_NetFwMgr_I = { 0x304ce942, 0x6e39, 0x40d8, { 0x94, 0x3a, 0xb9, 0x13, 0xc4, 0x0c, 0x9c, 0xd4 } };
65 _In_ BOOLEAN SortDescending,
131 for (i = 0; i <
sizeof(columns) /
sizeof(
COLUMN_INFO); i++)
133 EtpAddTreeNewColumn(treeNewInfo, columns[i].SubId, columns[i].Text, columns[i].Width, columns[i].Alignment,
140 static FLOAT EtpCalculateInclusiveGpuUsage(
149 for (i = 0; i < ProcessNode->Children->Count; i++)
151 gpuUsage += EtpCalculateInclusiveGpuUsage(ProcessNode->Children->Items[i]);
184 switch (message->
SubId)
286 gpuUsage = EtpCalculateInclusiveGpuUsage(processNode) * 100;
289 if (gpuUsage >= 0.01)
334 getCellText->
Text = text->
sr;
503 for (i = 0; i <
sizeof(columns) /
sizeof(
COLUMN_INFO); i++)
505 EtpAddTreeNewColumn(treeNewInfo, columns[i].SubId, columns[i].Text, columns[i].Width, columns[i].Alignment,
514 if (!Block->FirewallStatusValid)
517 Block->FirewallStatusValid =
TRUE;
538 if (block->TextCacheValid[message->
SubId])
540 if (block->TextCache[message->
SubId])
541 getCellText->
Text = block->TextCache[message->
SubId]->sr;
547 switch (message->
SubId)
550 if (block->ReceiveCount != 0)
554 if (block->SendCount != 0)
558 if (block->ReceiveRaw != 0)
562 if (block->SendRaw != 0)
566 if (block->ReceiveRaw + block->SendRaw != 0)
567 text =
PhFormatSize(block->ReceiveRaw + block->SendRaw, -1);
570 if (block->ReceiveDelta.Delta != 0)
574 if (block->SendDelta.Delta != 0)
578 if (block->ReceiveRawDelta.Delta != 0)
582 if (block->SendRawDelta.Delta != 0)
586 if (block->ReceiveRawDelta.Delta + block->SendRawDelta.Delta != 0)
587 text =
PhFormatSize(block->ReceiveRawDelta.Delta + block->SendRawDelta.Delta, -1);
611 if (block->ReceiveRawDelta.Delta != 0)
612 EtFormatRate(block->ReceiveRawDelta.Delta, &text, NULL);
615 if (block->SendRawDelta.Delta != 0)
619 if (block->ReceiveRawDelta.Delta + block->SendRawDelta.Delta != 0)
620 EtFormatRate(block->ReceiveRawDelta.Delta + block->SendRawDelta.Delta, &text, NULL);
626 getCellText->
Text = text->sr;
630 block->TextCacheValid[message->
SubId] =
TRUE;
710 static INetFwMgr* manager = NULL;
713 BSTR imageFileNameBStr;
714 BSTR localAddressBStr;
720 if (!SUCCEEDED(CoCreateInstance(&CLSID_NetFwMgr_I, NULL, CLSCTX_INPROC_SERVER, &IID_INetFwMgr_I, &manager)))
742 localAddressBStr = NULL;
745 localAddressBStr = SysAllocString(NetworkItem->LocalAddressString);
747 if (SUCCEEDED(INetFwMgr_IsPortAllowed(
750 (NetworkItem->ProtocolType &
PH_IPV6_NETWORK_TYPE) ? NET_FW_IP_VERSION_V6 : NET_FW_IP_VERSION_V4,
751 NetworkItem->LocalEndpoint.Port,
753 (NetworkItem->ProtocolType &
PH_UDP_PROTOCOL_TYPE) ? NET_FW_IP_PROTOCOL_UDP : NET_FW_IP_PROTOCOL_TCP,
760 if (restricted.boolVal)
767 if (restricted.boolVal)
774 if (localAddressBStr)
775 SysFreeString(localAddressBStr);
777 SysFreeString(imageFileNameBStr);