Update to the latest SDK
This commit is contained in:
@@ -5379,15 +5379,15 @@ BOOLEAN PhUiCloseConnections(
|
||||
for (i = 0; i < NumberOfConnections; i++)
|
||||
{
|
||||
if (
|
||||
Connections[i]->ProtocolType != PH_TCP4_NETWORK_PROTOCOL ||
|
||||
Connections[i]->ProtocolType != PH_NETWORK_PROTOCOL_TCP4 ||
|
||||
Connections[i]->State != MIB_TCP_STATE_ESTAB
|
||||
)
|
||||
continue;
|
||||
|
||||
tcpRow.dwState = MIB_TCP_STATE_DELETE_TCB;
|
||||
tcpRow.dwLocalAddr = Connections[i]->LocalEndpoint.Address.Ipv4;
|
||||
tcpRow.dwLocalAddr = Connections[i]->LocalEndpoint.Address.InAddr.s_addr;
|
||||
tcpRow.dwLocalPort = _byteswap_ushort((USHORT)Connections[i]->LocalEndpoint.Port);
|
||||
tcpRow.dwRemoteAddr = Connections[i]->RemoteEndpoint.Address.Ipv4;
|
||||
tcpRow.dwRemoteAddr = Connections[i]->RemoteEndpoint.Address.InAddr.s_addr;
|
||||
tcpRow.dwRemotePort = _byteswap_ushort((USHORT)Connections[i]->RemoteEndpoint.Port);
|
||||
|
||||
if ((result = SetTcpEntry_I(&tcpRow)) != NO_ERROR)
|
||||
|
||||
@@ -643,11 +643,17 @@ VOID PhMwpOnSettingChange(
|
||||
_In_opt_ PCWSTR Metric
|
||||
)
|
||||
{
|
||||
PhInitializeFont(WindowHandle, 0);
|
||||
{
|
||||
HFONT oldFont = PhApplicationFont;
|
||||
PhApplicationFont = PhInitializeFont(LayoutWindowDpi);
|
||||
if (oldFont) DeleteFont(oldFont);
|
||||
}
|
||||
|
||||
if (PhGetIntegerSetting(L"EnableMonospaceFont"))
|
||||
{
|
||||
PhInitializeMonospaceFont(WindowHandle, 0);
|
||||
HFONT oldFont = PhMonospaceFont;
|
||||
PhMonospaceFont = PhInitializeMonospaceFont(LayoutWindowDpi);
|
||||
if (oldFont) DeleteFont(oldFont);
|
||||
}
|
||||
|
||||
if (Action == 0 && Metric)
|
||||
@@ -4415,12 +4421,12 @@ VOID PhMwpInvokeUpdateWindowFontMonospace(
|
||||
}
|
||||
else
|
||||
{
|
||||
PhInitializeMonospaceFont(hwnd, LayoutWindowDpi);
|
||||
PhMonospaceFont = PhInitializeMonospaceFont(LayoutWindowDpi);
|
||||
if (oldFont) DeleteFont(oldFont);
|
||||
return;
|
||||
}
|
||||
|
||||
PhMonospaceFont = newFont;
|
||||
|
||||
if (oldFont) DeleteFont(oldFont);
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ VOID PhMwpInitializeNetworkMenu(
|
||||
for (i = 0; i < NumberOfNetworkItems; i++)
|
||||
{
|
||||
if (
|
||||
NetworkItems[i]->ProtocolType != PH_TCP4_NETWORK_PROTOCOL ||
|
||||
NetworkItems[i]->ProtocolType != PH_NETWORK_PROTOCOL_TCP4 ||
|
||||
NetworkItems[i]->State != MIB_TCP_STATE_ESTAB
|
||||
)
|
||||
{
|
||||
|
||||
+10
-10
@@ -430,27 +430,27 @@ BEGIN_SORT_FUNCTION(LocalAddress)
|
||||
memset(&localAddress1, 0, sizeof(SOCKADDR_IN6)); // memset for zero padding (dmex)
|
||||
memset(&localAddress2, 0, sizeof(SOCKADDR_IN6));
|
||||
|
||||
if (networkItem1->LocalEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (networkItem1->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
localAddress1.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&localAddress1.sin6_addr, &networkItem1->LocalEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&networkItem1->LocalEndpoint.Address.InAddr, &localAddress1.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&localAddress1, &networkItem1->LocalEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (networkItem1->LocalEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (networkItem1->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId1.Value = networkItem1->LocalScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&localAddress1, &networkItem1->LocalEndpoint.Address.In6Addr, scopeId1, 0);
|
||||
}
|
||||
|
||||
if (networkItem2->LocalEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (networkItem2->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
localAddress2.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&localAddress2.sin6_addr, &networkItem2->LocalEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&networkItem2->LocalEndpoint.Address.InAddr, &localAddress2.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&localAddress2, &networkItem2->LocalEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (networkItem2->LocalEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (networkItem2->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId2.Value = networkItem2->LocalScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&localAddress2, &networkItem2->LocalEndpoint.Address.In6Addr, scopeId2, 0);
|
||||
@@ -482,27 +482,27 @@ BEGIN_SORT_FUNCTION(RemoteAddress)
|
||||
memset(&remoteAddress1, 0, sizeof(SOCKADDR_IN6)); // memset for zero padding (dmex)
|
||||
memset(&remoteAddress2, 0, sizeof(SOCKADDR_IN6));
|
||||
|
||||
if (networkItem1->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (networkItem1->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
remoteAddress1.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&remoteAddress1.sin6_addr, &networkItem1->RemoteEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&networkItem1->RemoteEndpoint.Address.InAddr, &remoteAddress1.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&remoteAddress1, &networkItem1->RemoteEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (networkItem1->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (networkItem1->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId1.Value = networkItem1->RemoteScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&remoteAddress1, &networkItem1->RemoteEndpoint.Address.In6Addr, scopeId1, 0);
|
||||
}
|
||||
|
||||
if (networkItem2->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (networkItem2->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
remoteAddress2.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&remoteAddress2.sin6_addr, &networkItem2->RemoteEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&networkItem2->RemoteEndpoint.Address.InAddr, &remoteAddress2.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&remoteAddress2, &networkItem2->RemoteEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (networkItem2->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (networkItem2->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId2.Value = networkItem2->RemoteScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&remoteAddress2, &networkItem2->RemoteEndpoint.Address.In6Addr, scopeId2, 0);
|
||||
@@ -693,7 +693,7 @@ BOOLEAN NTAPI PhpNetworkTreeNewCallback(
|
||||
break;
|
||||
case PHNETLC_STATE:
|
||||
{
|
||||
if (FlagOn(networkItem->ProtocolType, PH_TCP_PROTOCOL_TYPE))
|
||||
if (FlagOn(networkItem->ProtocolType, PH_PROTOCOL_TYPE_TCP))
|
||||
{
|
||||
PCPH_STRINGREF stateName;
|
||||
|
||||
@@ -707,7 +707,7 @@ BOOLEAN NTAPI PhpNetworkTreeNewCallback(
|
||||
PhInitializeEmptyStringRef(&getCellText->Text);
|
||||
}
|
||||
}
|
||||
else if (networkItem->ProtocolType == PH_HV_NETWORK_PROTOCOL)
|
||||
else if (networkItem->ProtocolType == PH_NETWORK_PROTOCOL_HYPERV)
|
||||
{
|
||||
if (networkItem->State)
|
||||
{
|
||||
|
||||
+54
-50
@@ -402,7 +402,7 @@ PPHP_RESOLVE_CACHE_ITEM PhpLookupResolveCacheItem(
|
||||
// socklen_t length;
|
||||
// PPH_STRING hostName;
|
||||
//
|
||||
// if (Address->Type == PH_IPV4_NETWORK_TYPE)
|
||||
// if (Address->Type == PH_NETWORK_TYPE_IPV4)
|
||||
// {
|
||||
// ipv4Address.sin_family = AF_INET;
|
||||
// ipv4Address.sin_port = 0;
|
||||
@@ -410,7 +410,7 @@ PPHP_RESOLVE_CACHE_ITEM PhpLookupResolveCacheItem(
|
||||
// address = (PSOCKADDR)&ipv4Address;
|
||||
// length = sizeof(ipv4Address);
|
||||
// }
|
||||
// else if (Address->Type == PH_IPV6_NETWORK_TYPE)
|
||||
// else if (Address->Type == PH_NETWORK_TYPE_IPV6)
|
||||
// {
|
||||
// ipv6Address.sin6_family = AF_INET6;
|
||||
// ipv6Address.sin6_port = 0;
|
||||
@@ -471,7 +471,7 @@ PPH_STRING PhpGetDnsReverseNameFromAddress(
|
||||
|
||||
switch (Address->Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
static CONST PH_STRINGREF reverseLookupDomainNameSr = PH_STRINGREF_INIT(DNS_IP4_REVERSE_DOMAIN_STRING);
|
||||
PH_FORMAT format[9];
|
||||
@@ -509,7 +509,7 @@ PPH_STRING PhpGetDnsReverseNameFromAddress(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
static CONST PH_STRINGREF reverseLookupDomainNameSr = PH_STRINGREF_INIT(DNS_IP6_REVERSE_DOMAIN_STRING);
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
@@ -575,7 +575,7 @@ PPH_STRING PhGetHostNameFromAddressEx(
|
||||
|
||||
switch (Address->Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
if (IN4_IS_ADDR_UNSPECIFIED(&Address->InAddr))
|
||||
return NULL;
|
||||
@@ -590,10 +590,10 @@ PPH_STRING PhGetHostNameFromAddressEx(
|
||||
dnsLocalQuery = TRUE;
|
||||
}
|
||||
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_IPV4_NETWORK_TYPE, &Address->InAddr);
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_NETWORK_TYPE_IPV4, &Address->InAddr);
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&Address->In6Addr))
|
||||
return NULL;
|
||||
@@ -606,7 +606,7 @@ PPH_STRING PhGetHostNameFromAddressEx(
|
||||
dnsLocalQuery = TRUE;
|
||||
}
|
||||
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_IPV6_NETWORK_TYPE, &Address->In6Addr);
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_NETWORK_TYPE_IPV6, &Address->In6Addr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1025,7 +1025,7 @@ VOID PhNetworkProviderUpdate(
|
||||
|
||||
switch (networkItem->LocalEndpoint.Address.Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
WCHAR localAddressString[IP4_ADDRESS_STRING_LENGTH];
|
||||
ULONG localAddressStringLength = RTL_NUMBER_OF(localAddressString);
|
||||
@@ -1044,7 +1044,7 @@ VOID PhNetworkProviderUpdate(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
WCHAR localAddressString[IP6_ADDRESS_STRING_LENGTH];
|
||||
ULONG localAddressStringLength = RTL_NUMBER_OF(localAddressString);
|
||||
@@ -1064,7 +1064,7 @@ VOID PhNetworkProviderUpdate(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_HV_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_HYPERV:
|
||||
{
|
||||
networkItem->LocalAddressString = PhFormatGuid(
|
||||
&networkItem->LocalEndpoint.Address.HvAddr
|
||||
@@ -1075,7 +1075,7 @@ VOID PhNetworkProviderUpdate(
|
||||
|
||||
switch (networkItem->RemoteEndpoint.Address.Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
if (!PhIsNullIpAddress(&networkItem->RemoteEndpoint.Address))
|
||||
{
|
||||
@@ -1097,7 +1097,7 @@ VOID PhNetworkProviderUpdate(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
if (!PhIsNullIpAddress(&networkItem->RemoteEndpoint.Address))
|
||||
{
|
||||
@@ -1120,7 +1120,7 @@ VOID PhNetworkProviderUpdate(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_HV_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_HYPERV:
|
||||
{
|
||||
networkItem->RemoteAddressString = PhFormatGuid(
|
||||
&networkItem->RemoteEndpoint.Address.HvAddr
|
||||
@@ -1614,14 +1614,14 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < tcp4Table->dwNumEntries; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_TCP4_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_TCP4;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
connections[index].LocalEndpoint.Address.Ipv4 = tcp4Table->table[i].dwLocalAddr;
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv4, &tcp4Table->table[i].dwLocalAddr, sizeof(IN_ADDR));
|
||||
connections[index].LocalEndpoint.Port = _byteswap_ushort((USHORT)tcp4Table->table[i].dwLocalPort);
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
connections[index].RemoteEndpoint.Address.Ipv4 = tcp4Table->table[i].dwRemoteAddr;
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(connections[index].RemoteEndpoint.Address.Ipv4, &tcp4Table->table[i].dwRemoteAddr, sizeof(IN_ADDR));
|
||||
connections[index].RemoteEndpoint.Port = _byteswap_ushort((USHORT)tcp4Table->table[i].dwRemotePort);
|
||||
|
||||
connections[index].State = tcp4Table->table[i].dwState;
|
||||
@@ -1643,13 +1643,13 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < tcp6Table->dwNumEntries; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_TCP6_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_TCP6;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv6, tcp6Table->table[i].ucLocalAddr, 16);
|
||||
connections[index].LocalEndpoint.Port = _byteswap_ushort((USHORT)tcp6Table->table[i].dwLocalPort);
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(connections[index].RemoteEndpoint.Address.Ipv6, tcp6Table->table[i].ucRemoteAddr, 16);
|
||||
connections[index].RemoteEndpoint.Port = _byteswap_ushort((USHORT)tcp6Table->table[i].dwRemotePort);
|
||||
|
||||
@@ -1675,10 +1675,10 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < udp4Table->dwNumEntries; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_UDP4_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_UDP4;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
connections[index].LocalEndpoint.Address.Ipv4 = udp4Table->table[i].dwLocalAddr;
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv4, &udp4Table->table[i].dwLocalAddr, sizeof(IN_ADDR));
|
||||
connections[index].LocalEndpoint.Port = _byteswap_ushort((USHORT)udp4Table->table[i].dwLocalPort);
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = 0;
|
||||
@@ -1702,10 +1702,10 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < udp6Table->dwNumEntries; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_UDP6_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_UDP6;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv6, udp6Table->table[i].ucLocalAddr, 16);
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv6, udp6Table->table[i].ucLocalAddr, sizeof(IN6_ADDR));
|
||||
connections[index].LocalEndpoint.Port = _byteswap_ushort((USHORT)udp6Table->table[i].dwLocalPort);
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = 0;
|
||||
@@ -1734,14 +1734,14 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < boundTcpTable->dwNumEntries; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_TCP4_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_TCP4;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
connections[index].LocalEndpoint.Address.Ipv4 = boundTcpTable->table[i].dwLocalAddr;
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv4, &boundTcpTable->table[i].dwLocalAddr, sizeof(IN_ADDR));
|
||||
connections[index].LocalEndpoint.Port = _byteswap_ushort((USHORT)boundTcpTable->table[i].dwLocalPort);
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
connections[index].RemoteEndpoint.Address.Ipv4 = boundTcpTable->table[i].dwRemoteAddr;
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(connections[index].RemoteEndpoint.Address.Ipv4, &boundTcpTable->table[i].dwRemoteAddr, sizeof(IN_ADDR));
|
||||
connections[index].RemoteEndpoint.Port = _byteswap_ushort((USHORT)boundTcpTable->table[i].dwRemotePort);
|
||||
|
||||
connections[index].State = boundTcpTable->table[i].dwState;
|
||||
@@ -1757,14 +1757,14 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < boundTcp6Table->dwNumEntries; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_TCP6_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_TCP6;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv6, boundTcp6Table->table[i].LocalAddr.s6_addr, 16);
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(connections[index].LocalEndpoint.Address.Ipv6, boundTcp6Table->table[i].LocalAddr.s6_addr, sizeof(IN6_ADDR));
|
||||
connections[index].LocalEndpoint.Port = _byteswap_ushort((USHORT)boundTcp6Table->table[i].dwLocalPort);
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
memcpy(connections[index].RemoteEndpoint.Address.Ipv6, boundTcp6Table->table[i].RemoteAddr.s6_addr, 16);
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(connections[index].RemoteEndpoint.Address.Ipv6, boundTcp6Table->table[i].RemoteAddr.s6_addr, sizeof(IN6_ADDR));
|
||||
connections[index].RemoteEndpoint.Port = _byteswap_ushort((USHORT)boundTcp6Table->table[i].dwRemotePort);
|
||||
|
||||
connections[index].State = boundTcp6Table->table[i].State;
|
||||
@@ -1785,21 +1785,23 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < hvListeners->Count; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_HV_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_HYPERV;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_HV_NETWORK_TYPE;
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_HYPERV;
|
||||
connections[index].LocalEndpoint.Address.HvAddr = hvListeners->Listener[i].ServiceId;
|
||||
|
||||
if (hvListeners->Listener[i].Port <= 0x7FFFFFFF) // valid port range
|
||||
connections[index].LocalEndpoint.Port = hvListeners->Listener[i].Port;
|
||||
else
|
||||
connections[index].LocalEndpoint.Port = 0;
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_HV_NETWORK_TYPE;
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_HYPERV;
|
||||
connections[index].RemoteEndpoint.Address.HvAddr = hvListeners->Listener[i].VmId;
|
||||
|
||||
connections[index].ProcessId = UlongToHandle(hvListeners->Listener[i].ProcessId);
|
||||
connections[index].CreateTime = hvListeners->Listener[i].TimeStamp;
|
||||
|
||||
connections[index].State = 0; // HACK
|
||||
connections[index].State = MIB_TCP_STATE_LISTEN;
|
||||
|
||||
index++;
|
||||
}
|
||||
@@ -1811,15 +1813,17 @@ BOOLEAN PhGetNetworkConnections(
|
||||
{
|
||||
for (i = 0; i < hvConnections->Count; i++)
|
||||
{
|
||||
connections[index].ProtocolType = PH_HV_NETWORK_PROTOCOL;
|
||||
connections[index].ProtocolType = PH_NETWORK_PROTOCOL_HYPERV;
|
||||
|
||||
connections[index].LocalEndpoint.Address.Type = PH_HV_NETWORK_TYPE;
|
||||
connections[index].LocalEndpoint.Address.Type = PH_NETWORK_TYPE_HYPERV;
|
||||
connections[index].LocalEndpoint.Address.HvAddr = hvConnections->Connection[i].ServiceId;
|
||||
|
||||
if (hvConnections->Connection[i].Port <= 0x7FFFFFFF) // valid port range
|
||||
connections[index].LocalEndpoint.Port = hvConnections->Connection[i].Port;
|
||||
else
|
||||
connections[index].LocalEndpoint.Port = 0;
|
||||
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_HV_NETWORK_TYPE;
|
||||
connections[index].RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_HYPERV;
|
||||
connections[index].RemoteEndpoint.Address.HvAddr = hvConnections->Connection[i].VmId;
|
||||
|
||||
connections[index].ProcessId = UlongToHandle(hvConnections->Connection[i].ProcessId);
|
||||
@@ -1843,11 +1847,11 @@ BOOLEAN PhGetNetworkConnections(
|
||||
static CONST PH_KEY_VALUE_PAIR PhProtocolTypeStrings[] =
|
||||
{
|
||||
SIP(SREF(L"Unknown"), 0),
|
||||
SIP(SREF(L"TCP"), PH_TCP4_NETWORK_PROTOCOL),
|
||||
SIP(SREF(L"TCP6"), PH_TCP6_NETWORK_PROTOCOL),
|
||||
SIP(SREF(L"UDP"), PH_UDP4_NETWORK_PROTOCOL),
|
||||
SIP(SREF(L"UDP6"), PH_UDP6_NETWORK_PROTOCOL),
|
||||
SIP(SREF(L"HYPERV"), PH_HV_NETWORK_PROTOCOL),
|
||||
SIP(SREF(L"TCP"), PH_NETWORK_PROTOCOL_TCP4),
|
||||
SIP(SREF(L"TCP6"), PH_NETWORK_PROTOCOL_TCP6),
|
||||
SIP(SREF(L"UDP"), PH_NETWORK_PROTOCOL_UDP4),
|
||||
SIP(SREF(L"UDP6"), PH_NETWORK_PROTOCOL_UDP6),
|
||||
SIP(SREF(L"HYPERV"), PH_NETWORK_PROTOCOL_HYPERV),
|
||||
};
|
||||
|
||||
static CONST PH_KEY_VALUE_PAIR PhTcpStateStrings[] =
|
||||
|
||||
@@ -4025,9 +4025,12 @@ PPH_IMAGELIST_ITEM PhImageListExtractIcon(
|
||||
&FileName->sr,
|
||||
NativeFileName,
|
||||
0,
|
||||
PhGetSystemMetrics(SM_CXICON, SystemDpi),
|
||||
PhGetSystemMetrics(SM_CYICON, SystemDpi),
|
||||
PhGetSystemMetrics(SM_CXSMICON, SystemDpi),
|
||||
PhGetSystemMetrics(SM_CYSMICON, SystemDpi),
|
||||
&largeIcon,
|
||||
&smallIcon,
|
||||
SystemDpi
|
||||
&smallIcon
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4037,9 +4040,12 @@ PPH_IMAGELIST_ITEM PhImageListExtractIcon(
|
||||
&FileName->sr,
|
||||
NativeFileName,
|
||||
0,
|
||||
PhGetSystemMetrics(SM_CXICON, SystemDpi),
|
||||
PhGetSystemMetrics(SM_CYICON, SystemDpi),
|
||||
PhGetSystemMetrics(SM_CXSMICON, SystemDpi),
|
||||
PhGetSystemMetrics(SM_CYSMICON, SystemDpi),
|
||||
&largeIcon,
|
||||
&smallIcon,
|
||||
SystemDpi
|
||||
&smallIcon
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#ifndef _PH_PHDK_H
|
||||
#define _PH_PHDK_H
|
||||
|
||||
#define PHNT_VERSION PHNT_WIN11
|
||||
#define PHNT_VERSION PHNT_WINDOWS_NEW
|
||||
|
||||
#define PHAPPAPI __declspec(dllimport)
|
||||
|
||||
#include "ph.h"
|
||||
|
||||
+165
-118
@@ -21,6 +21,7 @@
|
||||
#include <commoncontrols.h>
|
||||
#include <shellscalingapi.h>
|
||||
#include <wincodec.h>
|
||||
#include <uxtheme.h>
|
||||
|
||||
BOOLEAN NTAPI PhpWindowContextHashtableEqualFunction(
|
||||
_In_ PVOID Entry1,
|
||||
@@ -60,26 +61,26 @@ static PH_QUEUED_LOCK WindowCallbackListLock = PH_QUEUED_LOCK_INIT;
|
||||
static PPH_HASHTABLE WindowContextHashTable = NULL;
|
||||
static PH_QUEUED_LOCK WindowContextListLock = PH_QUEUED_LOCK_INIT;
|
||||
|
||||
static _OpenThemeDataForDpi OpenThemeDataForDpi_I = NULL;
|
||||
static _OpenThemeData OpenThemeData_I = NULL;
|
||||
static _CloseThemeData CloseThemeData_I = NULL;
|
||||
static _SetWindowTheme SetWindowTheme_I = NULL;
|
||||
static _IsThemeActive IsThemeActive_I = NULL;
|
||||
static _IsThemePartDefined IsThemePartDefined_I = NULL;
|
||||
static __typeof__(&OpenThemeDataForDpi) OpenThemeDataForDpi_I = NULL;
|
||||
static __typeof__(&OpenThemeData) OpenThemeData_I = NULL;
|
||||
static __typeof__(&CloseThemeData) CloseThemeData_I = NULL;
|
||||
static __typeof__(&SetWindowTheme) SetWindowTheme_I = NULL;
|
||||
static __typeof__(&IsThemeActive) IsThemeActive_I = NULL;
|
||||
static __typeof__(&IsThemePartDefined) IsThemePartDefined_I = NULL;
|
||||
static _GetThemeClass GetThemeClass_I = NULL;
|
||||
static _GetThemeColor GetThemeColor_I = NULL;
|
||||
static _GetThemeInt GetThemeInt_I = NULL;
|
||||
static _GetThemePartSize GetThemePartSize_I = NULL;
|
||||
static _DrawThemeBackground DrawThemeBackground_I = NULL;
|
||||
static _DrawThemeTextEx DrawThemeTextEx_I = NULL;
|
||||
static __typeof__(&GetThemeColor) GetThemeColor_I = NULL;
|
||||
static __typeof__(&GetThemeInt) GetThemeInt_I = NULL;
|
||||
static __typeof__(&GetThemePartSize) GetThemePartSize_I = NULL;
|
||||
static __typeof__(&DrawThemeBackground) DrawThemeBackground_I = NULL;
|
||||
static __typeof__(&DrawThemeTextEx) DrawThemeTextEx_I = NULL;
|
||||
static _AllowDarkModeForWindow AllowDarkModeForWindow_I = NULL; // Win10-RS5 (uxtheme.dll ordinal 133)
|
||||
static _IsDarkModeAllowedForWindow IsDarkModeAllowedForWindow_I = NULL; // Win10-RS5 (uxtheme.dll ordinal 137)
|
||||
static _GetDpiForMonitor GetDpiForMonitor_I = NULL; // win81+
|
||||
static _GetDpiForWindow GetDpiForWindow_I = NULL; // win10rs1+
|
||||
static _GetDpiForSystem GetDpiForSystem_I = NULL; // win10rs1+
|
||||
static __typeof__(&GetDpiForMonitor) GetDpiForMonitor_I = NULL; // win81+
|
||||
static __typeof__(&GetDpiForWindow) GetDpiForWindow_I = NULL; // win10rs1+
|
||||
static __typeof__(&GetDpiForSystem) GetDpiForSystem_I = NULL; // win10rs1+
|
||||
//static _GetDpiForSession GetDpiForSession_I = NULL; // ordinal 2713
|
||||
static _GetSystemMetricsForDpi GetSystemMetricsForDpi_I = NULL;
|
||||
static _SystemParametersInfoForDpi SystemParametersInfoForDpi_I = NULL;
|
||||
static __typeof__(&GetSystemMetricsForDpi) GetSystemMetricsForDpi_I = NULL;
|
||||
static __typeof__(&SystemParametersInfoForDpi) SystemParametersInfoForDpi_I = NULL;
|
||||
static _CreateMRUList CreateMRUList_I = NULL;
|
||||
static _AddMRUString AddMRUString_I = NULL;
|
||||
static _EnumMRUList EnumMRUList_I = NULL;
|
||||
@@ -162,43 +163,56 @@ VOID PhGuiSupportUpdateSystemMetrics(
|
||||
PhLargeIconSize.Y = PhGetSystemMetrics(SM_CYICON, PhSystemDpi);
|
||||
}
|
||||
|
||||
VOID PhInitializeFont(
|
||||
_In_ HWND WindowHandle,
|
||||
HFONT PhInitializeFont(
|
||||
_In_ LONG WindowDpi
|
||||
)
|
||||
{
|
||||
LONG windowDpi = WindowDpi ? WindowDpi : PhGetWindowDpi(WindowHandle);
|
||||
HFONT oldFont = PhApplicationFont;
|
||||
HFONT fontHandle;
|
||||
|
||||
if (
|
||||
!(PhApplicationFont = PhCreateFont(L"Microsoft Sans Serif", 8, FW_NORMAL, DEFAULT_PITCH, windowDpi)) &&
|
||||
!(PhApplicationFont = PhCreateFont(L"Tahoma", 8, FW_NORMAL, DEFAULT_PITCH, windowDpi))
|
||||
)
|
||||
{
|
||||
PhApplicationFont = PhCreateMessageFont(windowDpi);
|
||||
}
|
||||
if (fontHandle = PhCreateFont(L"Microsoft Sans Serif", 8, FW_NORMAL, DEFAULT_PITCH, WindowDpi))
|
||||
return fontHandle;
|
||||
if (fontHandle = PhCreateFont(L"Tahoma", 8, FW_NORMAL, DEFAULT_PITCH, WindowDpi))
|
||||
return fontHandle;
|
||||
if (fontHandle = PhCreateMessageFont(WindowDpi))
|
||||
return fontHandle;
|
||||
|
||||
if (oldFont) DeleteFont(oldFont);
|
||||
return GetStockFont(DEFAULT_GUI_FONT);
|
||||
}
|
||||
|
||||
VOID PhInitializeMonospaceFont(
|
||||
_In_ HWND WindowHandle,
|
||||
HFONT PhInitializeMonospaceFont(
|
||||
_In_ LONG WindowDpi
|
||||
)
|
||||
{
|
||||
LONG windowDpi = WindowDpi ? WindowDpi : PhGetWindowDpi(WindowHandle);
|
||||
HFONT oldFont = PhMonospaceFont;
|
||||
HFONT fontHandle;
|
||||
|
||||
if (
|
||||
!(PhMonospaceFont = PhCreateFont(L"Lucida Console", 9, FW_DONTCARE, FF_MODERN, windowDpi)) &&
|
||||
!(PhMonospaceFont = PhCreateFont(L"Courier New", 9, FW_DONTCARE, FF_MODERN, windowDpi)) &&
|
||||
!(PhMonospaceFont = PhCreateFont(NULL, 9, FW_DONTCARE, FF_MODERN, windowDpi))
|
||||
)
|
||||
if (fontHandle = PhCreateFont(L"Lucida Console", 9, FW_DONTCARE, FF_MODERN, WindowDpi))
|
||||
return fontHandle;
|
||||
if (fontHandle = PhCreateFont(L"Courier New", 9, FW_DONTCARE, FF_MODERN, WindowDpi))
|
||||
return fontHandle;
|
||||
if (fontHandle = PhCreateFont(NULL, 9, FW_DONTCARE, FF_MODERN, WindowDpi))
|
||||
return fontHandle;
|
||||
|
||||
//{
|
||||
// NONCLIENTMETRICS metrics;
|
||||
//
|
||||
// memset(&metrics, 0, sizeof(NONCLIENTMETRICS));
|
||||
// metrics.cbSize = sizeof(NONCLIENTMETRICS);
|
||||
//
|
||||
// if (PhGetSystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &metrics, WindowDpi))
|
||||
// {
|
||||
// return CreateFontIndirect(&metrics.lfMessageFont);
|
||||
// }
|
||||
//}
|
||||
|
||||
LOGFONT logFont;
|
||||
|
||||
if (GetObject(GetStockFont(SYSTEM_FIXED_FONT), sizeof(LOGFONT), &logFont))
|
||||
{
|
||||
PhMonospaceFont = GetStockFont(SYSTEM_FIXED_FONT);
|
||||
logFont.lfWeight = -(LONG)PhMultiplyDivide(logFont.lfWeight, WindowDpi, 72);
|
||||
return CreateFontIndirect(&logFont);
|
||||
}
|
||||
|
||||
if (oldFont) DeleteFont(oldFont);
|
||||
return GetStockFont(SYSTEM_FIXED_FONT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -369,7 +383,7 @@ BOOLEAN PhGetThemePartSize(
|
||||
if (!GetThemePartSize_I)
|
||||
return FALSE;
|
||||
|
||||
return SUCCEEDED(GetThemePartSize_I(ThemeHandle, hdc, PartId, StateId, Rect, Flags, Size));
|
||||
return SUCCEEDED(GetThemePartSize_I(ThemeHandle, hdc, PartId, StateId, Rect, (enum THEMESIZE)Flags, Size));
|
||||
}
|
||||
|
||||
BOOLEAN PhDrawThemeBackground(
|
||||
@@ -1327,17 +1341,18 @@ VOID PhGetStockApplicationIcon(
|
||||
}
|
||||
else
|
||||
{
|
||||
PH_STRINGREF imageFileName;
|
||||
|
||||
PhInitializeStringRef(&imageFileName, L"\\SystemRoot\\System32\\imageres.dll");
|
||||
static PH_STRINGREF imageFileName = PH_STRINGREF_INIT(L"\\SystemRoot\\System32\\imageres.dll");
|
||||
|
||||
PhExtractIconEx(
|
||||
&imageFileName,
|
||||
TRUE,
|
||||
11,
|
||||
PhGetSystemMetrics(SM_CXICON, systemDpi),
|
||||
PhGetSystemMetrics(SM_CYICON, systemDpi),
|
||||
PhGetSystemMetrics(SM_CXSMICON, systemDpi),
|
||||
PhGetSystemMetrics(SM_CYSMICON, systemDpi),
|
||||
&largeIcon,
|
||||
&smallIcon,
|
||||
systemDpi
|
||||
&smallIcon
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2643,9 +2658,7 @@ BOOLEAN PhIsImmersiveProcess(
|
||||
)
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static BOOL (WINAPI* IsImmersiveProcess_I)(
|
||||
_In_ HANDLE ProcessHandle
|
||||
) = NULL;
|
||||
static __typeof__(&IsImmersiveProcess) IsImmersiveProcess_I = NULL;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
{
|
||||
@@ -2692,14 +2705,9 @@ BOOLEAN PhGetProcessDpiAwareness(
|
||||
)
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static DPI_AWARENESS_CONTEXT (WINAPI* GetDpiAwarenessContextForProcess_I)(
|
||||
_In_ HANDLE hprocess) = NULL;
|
||||
static BOOL (WINAPI* AreDpiAwarenessContextsEqual_I)(
|
||||
_In_ DPI_AWARENESS_CONTEXT dpiContextA,
|
||||
_In_ DPI_AWARENESS_CONTEXT dpiContextB) = NULL;
|
||||
static BOOL (WINAPI* GetProcessDpiAwarenessInternal_I)(
|
||||
_In_ HANDLE hprocess,
|
||||
_Out_ ULONG* value) = NULL;
|
||||
static __typeof__(&GetDpiAwarenessContextForProcess) GetDpiAwarenessContextForProcess_I = NULL;
|
||||
static __typeof__(&AreDpiAwarenessContextsEqual) AreDpiAwarenessContextsEqual_I = NULL;
|
||||
static BOOL (WINAPI* GetProcessDpiAwarenessInternal_I)(_In_ HANDLE hprocess, _Out_ PROCESS_DPI_AWARENESS* value) = NULL;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
{
|
||||
@@ -2759,7 +2767,7 @@ BOOLEAN PhGetProcessDpiAwareness(
|
||||
|
||||
if (GetProcessDpiAwarenessInternal_I)
|
||||
{
|
||||
ULONG dpiAwareness = 0;
|
||||
PROCESS_DPI_AWARENESS dpiAwareness = PROCESS_DPI_UNAWARE;
|
||||
|
||||
if (GetProcessDpiAwarenessInternal_I(ProcessHandle, &dpiAwareness))
|
||||
{
|
||||
@@ -2962,8 +2970,7 @@ BOOLEAN PhExtractIcon(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
_Success_(return)
|
||||
BOOLEAN PhLoadIconFromResourceDirectory(
|
||||
NTSTATUS PhLoadIconFromResourceDirectory(
|
||||
_In_ PPH_MAPPED_IMAGE MappedImage,
|
||||
_In_ PIMAGE_RESOURCE_DIRECTORY ResourceDirectory,
|
||||
_In_ LONG ResourceIndex,
|
||||
@@ -2995,9 +3002,9 @@ BOOLEAN PhLoadIconFromResourceDirectory(
|
||||
}
|
||||
|
||||
if (resourceIndex == resourceCount)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_TYPE_NOT_FOUND;
|
||||
if (!resourceType[resourceIndex].DataIsDirectory)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_TYPE_NOT_FOUND;
|
||||
|
||||
// Find the name
|
||||
nameDirectory = PTR_ADD_OFFSET(ResourceDirectory, resourceType[resourceIndex].OffsetToDirectory);
|
||||
@@ -3020,9 +3027,9 @@ BOOLEAN PhLoadIconFromResourceDirectory(
|
||||
}
|
||||
|
||||
if (resourceIndex >= resourceCount)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_NAME_NOT_FOUND;
|
||||
if (!resourceName[resourceIndex].DataIsDirectory)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_NAME_NOT_FOUND;
|
||||
|
||||
// Find the language
|
||||
languageDirectory = PTR_ADD_OFFSET(ResourceDirectory, resourceName[resourceIndex].OffsetToDirectory);
|
||||
@@ -3031,17 +3038,17 @@ BOOLEAN PhLoadIconFromResourceDirectory(
|
||||
resourceIndex = 0; // use the first entry
|
||||
|
||||
if (resourceLanguage[resourceIndex].DataIsDirectory)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_LANG_NOT_FOUND;
|
||||
|
||||
resourceData = PTR_ADD_OFFSET(ResourceDirectory, resourceLanguage[resourceIndex].OffsetToData);
|
||||
|
||||
if (!resourceData)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_DATA_NOT_FOUND;
|
||||
|
||||
resourceBuffer = PhMappedImageRvaToVa(MappedImage, resourceData->OffsetToData, NULL);
|
||||
|
||||
if (!resourceBuffer)
|
||||
return FALSE;
|
||||
return STATUS_RESOURCE_DATA_NOT_FOUND;
|
||||
|
||||
if (ResourceLength)
|
||||
*ResourceLength = resourceData->Size;
|
||||
@@ -3052,7 +3059,7 @@ BOOLEAN PhLoadIconFromResourceDirectory(
|
||||
// PhLoaderEntryImageRvaToVa(ImageBaseAddress, resourceData->OffsetToData, resourceBuffer);
|
||||
// PhLoadResource(ImageBaseAddress, MAKEINTRESOURCE(ResourceIndex), ResourceType, &resourceLength, &resourceBuffer);
|
||||
|
||||
return TRUE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
@@ -3070,15 +3077,18 @@ typedef struct _NEWHEADER
|
||||
USHORT ResourceCount;
|
||||
} NEWHEADER, *PNEWHEADER;
|
||||
|
||||
HICON PhCreateIconFromResourceDirectory(
|
||||
NTSTATUS PhCreateIconFromResourceDirectory(
|
||||
_In_ PPH_MAPPED_IMAGE MappedImage,
|
||||
_In_ PVOID ResourceDirectory,
|
||||
_In_ PVOID IconDirectory,
|
||||
_In_ LONG Width,
|
||||
_In_ LONG Height,
|
||||
_In_ ULONG Flags
|
||||
_In_ ULONG Flags,
|
||||
_Out_opt_ HICON* IconHandle
|
||||
)
|
||||
{
|
||||
NTSTATUS status;
|
||||
HICON iconHandle;
|
||||
LONG iconResourceId;
|
||||
ULONG iconResourceLength;
|
||||
PVOID iconResourceBuffer;
|
||||
@@ -3091,20 +3101,20 @@ HICON PhCreateIconFromResourceDirectory(
|
||||
Flags
|
||||
)))
|
||||
{
|
||||
return NULL;
|
||||
return PhGetLastWin32ErrorAsNtStatus();
|
||||
}
|
||||
|
||||
if (!PhLoadIconFromResourceDirectory(
|
||||
status = PhLoadIconFromResourceDirectory(
|
||||
MappedImage,
|
||||
ResourceDirectory,
|
||||
-iconResourceId,
|
||||
RT_ICON,
|
||||
&iconResourceLength,
|
||||
&iconResourceBuffer
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
return status;
|
||||
|
||||
if (
|
||||
((PBITMAPINFOHEADER)iconResourceBuffer)->biSize != sizeof(BITMAPINFOHEADER) &&
|
||||
@@ -3113,10 +3123,10 @@ HICON PhCreateIconFromResourceDirectory(
|
||||
((PBITMAPCOREHEADER)iconResourceBuffer)->bcSize != MAKEFOURCC('J', 'P', 'E', 'G')
|
||||
)
|
||||
{
|
||||
return NULL;
|
||||
return STATUS_RESOURCE_TYPE_NOT_FOUND;
|
||||
}
|
||||
|
||||
return CreateIconFromResourceEx(
|
||||
if (!(iconHandle = CreateIconFromResourceEx(
|
||||
iconResourceBuffer,
|
||||
iconResourceLength,
|
||||
TRUE,
|
||||
@@ -3124,7 +3134,13 @@ HICON PhCreateIconFromResourceDirectory(
|
||||
Width,
|
||||
Height,
|
||||
Flags
|
||||
);
|
||||
)))
|
||||
{
|
||||
return PhGetLastWin32ErrorAsNtStatus();
|
||||
}
|
||||
|
||||
*IconHandle = iconHandle;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// rev from LdrLoadAlternateResourceModuleEx and GetMunResourceModuleForEnumIfExist (dmex)
|
||||
@@ -3133,6 +3149,7 @@ HICON PhCreateIconFromResourceDirectory(
|
||||
*
|
||||
* \param FileName A string containing a file name.
|
||||
* \param NativeFileName The type of name format.
|
||||
* \param FilePathType
|
||||
* \param ResourceFileName A pointer to the MUN filename.
|
||||
*
|
||||
* \return Successful or errant status.
|
||||
@@ -3140,10 +3157,10 @@ HICON PhCreateIconFromResourceDirectory(
|
||||
* \remarks LdrLoadAlternateResourceModuleEx and GetMunResourceModuleForEnumIfExist always search the parent directory
|
||||
* and this function has the same logic and semantics. For example: C:\Windows\explorer.exe -> C:\SystemResources\explorer.exe.mun
|
||||
*/
|
||||
_Success_(return)
|
||||
BOOLEAN PhGetSystemResourcesFileName(
|
||||
NTSTATUS PhGetSystemResourcesFileName(
|
||||
_In_ PCPH_STRINGREF FileName,
|
||||
_In_ BOOLEAN NativeFileName,
|
||||
_In_ RTL_PATH_TYPE FilePathType,
|
||||
_Out_ PPH_STRING* ResourceFileName
|
||||
)
|
||||
{
|
||||
@@ -3155,16 +3172,16 @@ BOOLEAN PhGetSystemResourcesFileName(
|
||||
PH_STRINGREF baseNamePart;
|
||||
|
||||
if (WindowsVersion < WINDOWS_10_19H1)
|
||||
return FALSE;
|
||||
if (PhDetermineDosPathNameType(FileName) == RtlPathTypeUncAbsolute)
|
||||
return FALSE;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
if (FilePathType == RtlPathTypeUncAbsolute)
|
||||
return STATUS_OBJECT_PATH_SYNTAX_BAD;
|
||||
if (!PhGetBasePath(FileName, &directoryPart, &fileNamePart))
|
||||
return FALSE;
|
||||
return STATUS_OBJECT_PATH_INVALID;
|
||||
|
||||
if (directoryPart.Length && fileNamePart.Length)
|
||||
{
|
||||
if (!PhGetBasePath(&directoryPart, &baseNamePart, NULL))
|
||||
return FALSE;
|
||||
return STATUS_OBJECT_PATH_INVALID;
|
||||
|
||||
fileName = PhConcatStringRef4(
|
||||
&baseNamePart,
|
||||
@@ -3178,7 +3195,7 @@ BOOLEAN PhGetSystemResourcesFileName(
|
||||
if (PhDoesFileExist(&fileName->sr))
|
||||
{
|
||||
*ResourceFileName = fileName;
|
||||
return TRUE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3186,14 +3203,14 @@ BOOLEAN PhGetSystemResourcesFileName(
|
||||
if (PhDoesFileExistWin32(PhGetString(fileName)))
|
||||
{
|
||||
*ResourceFileName = fileName;
|
||||
return TRUE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
PhClearReference(&fileName);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3202,23 +3219,28 @@ BOOLEAN PhGetSystemResourcesFileName(
|
||||
* \param FileName A string containing a file name.
|
||||
* \param NativeFileName The type of name format.
|
||||
* \param IconIndex The zero-based index of the icon within the group or a negative number for a specific resource identifier.
|
||||
* \param IconLargeWidth
|
||||
* \param IconLargeHeight
|
||||
* \param IconSmallWidth
|
||||
* \param IconSmallHeight
|
||||
* \param IconLarge A handle to the large icon within the group or handle to the an icon from the resource identifier.
|
||||
* \param IconSmall A handle to the small icon within the group or handle to the an icon from the resource identifier.
|
||||
* \param WindowDpi The DPI to use for scaling the metric.
|
||||
*
|
||||
* \return Successful or errant status.
|
||||
*
|
||||
* \remarks Use this function instead of PrivateExtractIconExW() because images are mapped with SEC_COMMIT and READONLY
|
||||
* while PrivateExtractIconExW loads images with EXECUTE and SEC_IMAGE (section allocations and relocation processing).
|
||||
*/
|
||||
_Success_(return)
|
||||
BOOLEAN PhExtractIconEx(
|
||||
NTSTATUS PhExtractIconEx(
|
||||
_In_ PCPH_STRINGREF FileName,
|
||||
_In_ BOOLEAN NativeFileName,
|
||||
_In_ LONG IconIndex,
|
||||
_In_ LONG IconLargeWidth,
|
||||
_In_ LONG IconLargeHeight,
|
||||
_In_ LONG IconSmallWidth,
|
||||
_In_ LONG IconSmallHeight,
|
||||
_Out_opt_ HICON *IconLarge,
|
||||
_Out_opt_ HICON *IconSmall,
|
||||
_In_ LONG WindowDpi
|
||||
_Out_opt_ HICON *IconSmall
|
||||
)
|
||||
{
|
||||
NTSTATUS status;
|
||||
@@ -3236,9 +3258,16 @@ BOOLEAN PhExtractIconEx(
|
||||
fileNameType = PhDetermineDosPathNameType(FileName);
|
||||
|
||||
if (!(fileNameType == RtlPathTypeRooted || fileNameType == RtlPathTypeDriveAbsolute))
|
||||
return FALSE;
|
||||
return STATUS_OBJECT_PATH_SYNTAX_BAD;
|
||||
|
||||
if (PhGetSystemResourcesFileName(FileName, NativeFileName, &resourceFileName))
|
||||
status = PhGetSystemResourcesFileName(
|
||||
FileName,
|
||||
NativeFileName,
|
||||
fileNameType,
|
||||
&resourceFileName
|
||||
);
|
||||
|
||||
if (NT_SUCCESS(status))
|
||||
{
|
||||
fileName.Buffer = resourceFileName->Buffer;
|
||||
fileName.Length = resourceFileName->Length;
|
||||
@@ -3298,43 +3327,51 @@ BOOLEAN PhExtractIconEx(
|
||||
|
||||
__try
|
||||
{
|
||||
if (!PhLoadIconFromResourceDirectory(
|
||||
status = PhLoadIconFromResourceDirectory(
|
||||
&mappedImage,
|
||||
resourceDirectory,
|
||||
IconIndex,
|
||||
RT_GROUP_ICON,
|
||||
&iconDirectoryResourceLength,
|
||||
&iconDirectoryResource
|
||||
))
|
||||
{
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
goto CleanupExit;
|
||||
}
|
||||
|
||||
if (iconDirectoryResource->ResourceType != RES_ICON)
|
||||
goto CleanupExit;
|
||||
|
||||
if (IconLarge)
|
||||
{
|
||||
iconLarge = PhCreateIconFromResourceDirectory(
|
||||
status = PhCreateIconFromResourceDirectory(
|
||||
&mappedImage,
|
||||
resourceDirectory,
|
||||
iconDirectoryResource,
|
||||
PhGetSystemMetrics(SM_CXICON, WindowDpi),
|
||||
PhGetSystemMetrics(SM_CYICON, WindowDpi),
|
||||
LR_DEFAULTCOLOR
|
||||
IconLargeWidth,
|
||||
IconLargeHeight,
|
||||
LR_DEFAULTCOLOR,
|
||||
&iconLarge
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
goto CleanupExit;
|
||||
}
|
||||
|
||||
if (IconSmall)
|
||||
{
|
||||
iconSmall = PhCreateIconFromResourceDirectory(
|
||||
status = PhCreateIconFromResourceDirectory(
|
||||
&mappedImage,
|
||||
resourceDirectory,
|
||||
iconDirectoryResource,
|
||||
PhGetSystemMetrics(SM_CXSMICON, WindowDpi),
|
||||
PhGetSystemMetrics(SM_CYSMICON, WindowDpi),
|
||||
LR_DEFAULTCOLOR
|
||||
IconSmallWidth,
|
||||
IconSmallHeight,
|
||||
LR_DEFAULTCOLOR,
|
||||
&iconSmall
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
goto CleanupExit;
|
||||
}
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
@@ -3404,17 +3441,27 @@ HIMAGELIST PhImageListCreate(
|
||||
&imageList
|
||||
);
|
||||
|
||||
if (FAILED(status))
|
||||
return NULL;
|
||||
if (SUCCEEDED(status))
|
||||
{
|
||||
status = IImageList2_Initialize(
|
||||
imageList,
|
||||
Width,
|
||||
Height,
|
||||
Flags,
|
||||
InitialCount,
|
||||
GrowCount
|
||||
);
|
||||
}
|
||||
|
||||
status = IImageList2_Initialize(
|
||||
imageList,
|
||||
Width,
|
||||
Height,
|
||||
Flags,
|
||||
InitialCount,
|
||||
GrowCount
|
||||
);
|
||||
//if (FAILED(status))
|
||||
//{
|
||||
// status = ImageList_CoCreateInstance(
|
||||
// &CLSID_ImageList,
|
||||
// NULL,
|
||||
// &IID_IImageList,
|
||||
// &imageList
|
||||
// );
|
||||
//}
|
||||
|
||||
if (FAILED(status))
|
||||
return NULL;
|
||||
@@ -4024,7 +4071,7 @@ HBITMAP PhLoadImageFromAddress(
|
||||
BOOLEAN success = FALSE;
|
||||
HBITMAP bitmapHandle = NULL;
|
||||
PVOID bitmapBuffer = NULL;
|
||||
IWICImagingFactory* wicImagingFactory;
|
||||
IWICImagingFactory* wicImagingFactory = NULL;
|
||||
IWICStream* wicBitmapStream = NULL;
|
||||
IWICBitmapSource* wicBitmapSource = NULL;
|
||||
IWICBitmapDecoder* wicBitmapDecoder = NULL;
|
||||
|
||||
+2
-2
@@ -1616,7 +1616,7 @@ PPH_STRING PhDnsReverseLookupNameFromAddress(
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
static CONST PH_STRINGREF reverseLookupDomainName = PH_STRINGREF_INIT(DNS_IP4_REVERSE_DOMAIN_STRING);
|
||||
PIN_ADDR inAddrV4 = Address;
|
||||
@@ -1654,7 +1654,7 @@ PPH_STRING PhDnsReverseLookupNameFromAddress(
|
||||
return PhFormat(format, RTL_NUMBER_OF(format), IP4_REVERSE_DOMAIN_STRING_LENGTH);
|
||||
}
|
||||
}
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
static CONST PH_STRINGREF reverseLookupDomainName = PH_STRINGREF_INIT(DNS_IP6_REVERSE_DOMAIN_STRING);
|
||||
PIN6_ADDR inAddrV6 = Address;
|
||||
|
||||
@@ -885,393 +885,4 @@ static VOID (WINAPI* EdpFreeContext_I)(
|
||||
_In_ PEDP_CONTEXT EdpContext
|
||||
) = NULL;
|
||||
|
||||
// Properties
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_CONTEXT_REFERENCE
|
||||
{
|
||||
void * reserved;
|
||||
} * PACKAGE_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageProperty
|
||||
{
|
||||
PackageProperty_Name = 1, // q: WCHAR[]
|
||||
PackageProperty_Version = 2, // q: WCHAR[]
|
||||
PackageProperty_Architecture = 3, // q: ULONG (PROCESSOR_ARCHITECTURE_*)
|
||||
PackageProperty_ResourceId = 4, // q: WCHAR[]
|
||||
PackageProperty_Publisher = 5, // q: WCHAR[]
|
||||
PackageProperty_PublisherId = 6, // q: WCHAR[]
|
||||
PackageProperty_FamilyName = 7, // q: WCHAR[]
|
||||
PackageProperty_FullName = 8, // q: WCHAR[]
|
||||
PackageProperty_Flags = 9, // q: ULONG
|
||||
PackageProperty_InstalledLocation = 10, // q: WCHAR[]
|
||||
PackageProperty_DisplayName = 11, // q: WCHAR[]
|
||||
PackageProperty_PublisherDisplayName = 12, // q: WCHAR[]
|
||||
PackageProperty_Description = 13, // q: WCHAR[]
|
||||
PackageProperty_Logo = 14, // q: WCHAR[]
|
||||
PackageProperty_PackageOrigin = 15 // q: PackageOrigin
|
||||
} PackageProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_APPLICATION_CONTEXT_REFERENCE
|
||||
{
|
||||
void * reserved;
|
||||
} * PACKAGE_APPLICATION_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageApplicationProperty
|
||||
{
|
||||
PackageApplicationProperty_Aumid = 1, // q: WCHAR[]
|
||||
PackageApplicationProperty_Praid = 2, // q: WCHAR[]
|
||||
PackageApplicationProperty_DisplayName = 3, // q: WCHAR[]
|
||||
PackageApplicationProperty_Description = 4, // q: WCHAR[]
|
||||
PackageApplicationProperty_Logo = 5, // q: WCHAR[]
|
||||
PackageApplicationProperty_SmallLogo = 6, // q: WCHAR[]
|
||||
PackageApplicationProperty_ForegroundText = 7, // q: ULONG
|
||||
PackageApplicationProperty_ForegroundTextString = 8, // q: WCHAR[]
|
||||
PackageApplicationProperty_BackgroundColor = 9, // q: ULONG
|
||||
PackageApplicationProperty_StartPage = 10, // q: WCHAR[]
|
||||
PackageApplicationProperty_ContentURIRulesCount = 11, // q: ULONG
|
||||
PackageApplicationProperty_ContentURIRules = 12, // q: WCHAR[] (multi-sz)
|
||||
PackageApplicationProperty_StaticContentURIRulesCount = 13, // q: ULONG
|
||||
PackageApplicationProperty_StaticContentURIRules = 14, // q: WCHAR[] (multi-sz)
|
||||
PackageApplicationProperty_DynamicContentURIRulesCount = 15, // q: ULONG
|
||||
PackageApplicationProperty_DynamicContentURIRules = 16 // q: WCHAR[] (multi-sz)
|
||||
} PackageApplicationProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_RESOURCES_CONTEXT_REFERENCE
|
||||
{
|
||||
void * reserved;
|
||||
} * PACKAGE_RESOURCES_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageResourcesProperty
|
||||
{
|
||||
PackageResourcesProperty_DisplayName = 1,
|
||||
PackageResourcesProperty_PublisherDisplayName = 2,
|
||||
PackageResourcesProperty_Description = 3,
|
||||
PackageResourcesProperty_Logo = 4,
|
||||
PackageResourcesProperty_SmallLogo = 5,
|
||||
PackageResourcesProperty_StartPage = 6
|
||||
} PackageResourcesProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_SECURITY_CONTEXT_REFERENCE
|
||||
{
|
||||
void * reserved;
|
||||
} * PACKAGE_SECURITY_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageSecurityProperty
|
||||
{
|
||||
PackageSecurityProperty_SecurityFlags = 1, // q: ULONG
|
||||
PackageSecurityProperty_AppContainerSID = 2, // q: Sid
|
||||
PackageSecurityProperty_CapabilitiesCount = 3, // q: ULONG
|
||||
PackageSecurityProperty_Capabilities = 4 // q: Sid[]
|
||||
} PackageSecurityProperty;
|
||||
|
||||
// private
|
||||
typedef struct _TARGET_PLATFORM_CONTEXT_REFERENCE
|
||||
{
|
||||
void * reserved;
|
||||
} * TARGET_PLATFORM_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum TargetPlatformProperty
|
||||
{
|
||||
TargetPlatformProperty_Platform = 1, // q: ULONG
|
||||
TargetPlatformProperty_MinVersion = 2, // q: PACKAGE_VERSION
|
||||
TargetPlatformProperty_MaxVersion = 3 // q: PACKAGE_VERSION
|
||||
} TargetPlatformProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE
|
||||
{
|
||||
void * reserved;
|
||||
} * PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageGlobalizationProperty
|
||||
{
|
||||
PackageGlobalizationProperty_ForceUtf8 = 1, // q: ULONG
|
||||
PackageGlobalizationProperty_UseWindowsDisplayLanguage = 2 // q: ULONG
|
||||
} PackageGlobalizationProperty;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINBLUE)
|
||||
|
||||
// Package Properties
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_CONTEXT_REFERENCE *PackageContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_CONTEXT_REFERENCE *PackageContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageProperty(
|
||||
_In_ PACKAGE_CONTEXT_REFERENCE PackageContext,
|
||||
_In_ PackageProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackagePropertyString(
|
||||
_In_ PACKAGE_CONTEXT_REFERENCE PackageContext,
|
||||
_In_ PackageProperty PropertyId,
|
||||
_Inout_ PULONG BufferLength,
|
||||
_Out_writes_(BufferLength) PWSTR Buffer
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageOSMaxVersionTested(
|
||||
_In_ PACKAGE_CONTEXT_REFERENCE PackageContext,
|
||||
_Out_ ULONGLONG *OSMaxVersionTested // PACKAGE_VERSION
|
||||
);
|
||||
|
||||
// Package Application Properties
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageApplicationContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageApplicationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageApplicationContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageApplicationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageApplicationProperty(
|
||||
_In_ PACKAGE_APPLICATION_CONTEXT_REFERENCE PackageApplicationContext,
|
||||
_In_ PackageApplicationProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageApplicationPropertyString(
|
||||
_In_ PACKAGE_APPLICATION_CONTEXT_REFERENCE PackageApplicationContext,
|
||||
_In_ PackageApplicationProperty PropertyId,
|
||||
_Inout_ PULONG BufferLength,
|
||||
_Out_writes_(BufferLength) PWSTR Buffer
|
||||
);
|
||||
|
||||
// Package Resource Properties
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageResourcesContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_RESOURCES_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageResourcesContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_RESOURCES_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageApplicationResourcesContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageApplicationResourcesContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageResourcesProperty(
|
||||
_In_ PACKAGE_APPLICATION_CONTEXT_REFERENCE PackageResourcesContext,
|
||||
_In_ PackageResourcesProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
// Package Security Properties
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetCurrentPackageSecurityContext(
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_SECURITY_CONTEXT_REFERENCE *PackageSecurityContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageSecurityContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_SECURITY_CONTEXT_REFERENCE *PackageSecurityContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageSecurityProperty(
|
||||
_In_ PACKAGE_SECURITY_CONTEXT_REFERENCE PackageSecurityContext,
|
||||
_In_ PackageSecurityProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
#endif // PHNT_VERSION >= PHNT_WINBLUE
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
|
||||
// Target Platform Properties
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetCurrentTargetPlatformContext(
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ TARGET_PLATFORM_CONTEXT_REFERENCE *TargetPlatformContext
|
||||
);
|
||||
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetTargetPlatformContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ TARGET_PLATFORM_CONTEXT_REFERENCE *TargetPlatformContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageTargetPlatformProperty(
|
||||
_In_ TARGET_PLATFORM_CONTEXT_REFERENCE TargetPlatformContext,
|
||||
_In_ TargetPlatformProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
#endif // PHNT_VERSION >= PHNT_THRESHOLD
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_20H1)
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
HRESULT
|
||||
WINAPI
|
||||
GetCurrentPackageInfo3(
|
||||
_In_ ULONG flags,
|
||||
_In_ ULONG packagePathType, // PackagePathType
|
||||
_Inout_ PULONG bufferLength,
|
||||
_Out_writes_bytes_opt_(*bufferLength) PVOID buffer,
|
||||
_Out_opt_ PULONG count
|
||||
);
|
||||
|
||||
// Package Globalization Properties
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetCurrentPackageGlobalizationContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE *PackageGlobalizationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageGlobalizationContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE *PackageGlobalizationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageGlobalizationProperty(
|
||||
_In_ PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE PackageGlobalizationContext,
|
||||
_In_ PackageGlobalizationProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
#endif // PHNT_VERSION >= PHNT_20H1
|
||||
|
||||
#endif
|
||||
|
||||
+23
-13
@@ -73,18 +73,16 @@ PhGuiSupportUpdateSystemMetrics(
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
VOID
|
||||
HFONT
|
||||
NTAPI
|
||||
PhInitializeFont(
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ LONG WindowDpi
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
VOID
|
||||
HFONT
|
||||
NTAPI
|
||||
PhInitializeMonospaceFont(
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ LONG WindowDpi
|
||||
);
|
||||
|
||||
@@ -1887,17 +1885,19 @@ PhExtractIcon(
|
||||
_Out_opt_ HICON *IconSmall
|
||||
);
|
||||
|
||||
_Success_(return)
|
||||
PHLIBAPI
|
||||
BOOLEAN
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
PhExtractIconEx(
|
||||
_In_ PCPH_STRINGREF FileName,
|
||||
_In_ BOOLEAN NativeFileName,
|
||||
_In_ LONG IconIndex,
|
||||
_In_ LONG IconLargeWidth,
|
||||
_In_ LONG IconLargeHeight,
|
||||
_In_ LONG IconSmallWidth,
|
||||
_In_ LONG IconSmallHeight,
|
||||
_Out_opt_ HICON *IconLarge,
|
||||
_Out_opt_ HICON *IconSmall,
|
||||
_In_ LONG WindowDpi
|
||||
_Out_opt_ HICON *IconSmall
|
||||
);
|
||||
|
||||
// Imagelist support
|
||||
@@ -2113,6 +2113,16 @@ PhLoadImageFormatFromResource(
|
||||
_In_ LONG Height
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
HBITMAP
|
||||
NTAPI
|
||||
PhLoadImageFromAddress(
|
||||
_In_ PVOID Buffer,
|
||||
_In_ ULONG BufferLength,
|
||||
_In_ LONG Width,
|
||||
_In_ LONG Height
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
HBITMAP
|
||||
NTAPI
|
||||
@@ -2455,14 +2465,14 @@ HFONT
|
||||
NTAPI
|
||||
PhCreateFont(
|
||||
_In_opt_ PCWSTR Name,
|
||||
_In_ ULONG Size,
|
||||
_In_ ULONG Weight,
|
||||
_In_ ULONG PitchAndFamily,
|
||||
_In_ LONG dpiValue
|
||||
_In_ LONG Size,
|
||||
_In_ LONG Weight,
|
||||
_In_ LONG PitchAndFamily,
|
||||
_In_ LONG Dpi
|
||||
)
|
||||
{
|
||||
return CreateFont(
|
||||
-(LONG)PhMultiplyDivide(Size, dpiValue, 72),
|
||||
-(LONG)PhMultiplyDivide(Size, Dpi, 72),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -13,102 +13,12 @@
|
||||
#ifndef _PH_GUISUPP_H
|
||||
#define _PH_GUISUPP_H
|
||||
|
||||
typedef HTHEME (WINAPI* _OpenThemeDataForDpi)(
|
||||
_In_opt_ HWND WindowHandle,
|
||||
_In_ PCWSTR ClassList,
|
||||
_In_ UINT DpiValue
|
||||
);
|
||||
|
||||
typedef HTHEME (WINAPI* _OpenThemeData)(
|
||||
_In_opt_ HWND WindowHandle,
|
||||
_In_ PCWSTR ClassList
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI* _CloseThemeData)(
|
||||
_In_ HTHEME ThemeHandle
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI *_SetWindowTheme)(
|
||||
_In_ HWND WindowHandle,
|
||||
_In_opt_ PCWSTR SubAppName,
|
||||
_In_opt_ PCWSTR SubIdList
|
||||
);
|
||||
|
||||
typedef BOOL (WINAPI *_IsThemeActive)(
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef BOOL (WINAPI *_IsThemePartDefined)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI *_DrawThemeBackground)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_ HDC hdc,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId,
|
||||
_In_ const RECT *pRect,
|
||||
_In_opt_ const RECT *pClipRect
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI *_DrawThemeText)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_ HDC hdc,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId,
|
||||
_In_reads_(cchText) LPCWSTR pszText,
|
||||
_In_ LONG cchText,
|
||||
_In_ ULONG dwTextFlags,
|
||||
_Reserved_ ULONG dwTextFlags2,
|
||||
_In_ LPCRECT pRect
|
||||
);
|
||||
|
||||
typedef HRESULT(WINAPI* _DrawThemeTextEx)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_ HDC hdc,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId,
|
||||
_In_reads_(cchText) LPCWSTR pszText,
|
||||
_In_ LONG cchText,
|
||||
_In_ ULONG dwTextFlags,
|
||||
_Inout_ LPRECT pRect,
|
||||
_In_opt_ const PVOID pOptions // DTTOPTS*
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI* _GetThemeClass)(
|
||||
_In_ HTHEME ThemeHandle,
|
||||
_Out_writes_z_(BufferLength) PWSTR Buffer,
|
||||
_In_ ULONG BufferLength
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI* _GetThemeColor)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId,
|
||||
_In_ LONG iPropId,
|
||||
_Out_ COLORREF* pColor
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI *_GetThemeInt)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId,
|
||||
_In_ LONG iPropId,
|
||||
_Out_ LONG*piVal
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI* _GetThemePartSize)(
|
||||
_In_ HTHEME hTheme,
|
||||
_In_opt_ HDC hdc,
|
||||
_In_ LONG iPartId,
|
||||
_In_ LONG iStateId,
|
||||
_In_opt_ LPCRECT prc,
|
||||
_In_ enum THEMESIZE eSize,
|
||||
_Out_ SIZE* psz
|
||||
);
|
||||
|
||||
typedef BOOL(WINAPI* _AllowDarkModeForWindow)(
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ BOOL Enabled
|
||||
@@ -118,38 +28,10 @@ typedef BOOL(WINAPI* _IsDarkModeAllowedForWindow)(
|
||||
_In_ HWND WindowHandle
|
||||
);
|
||||
|
||||
typedef HRESULT (WINAPI* _GetDpiForMonitor)(
|
||||
_In_ HMONITOR hmonitor,
|
||||
_In_ enum MONITOR_DPI_TYPE dpiType,
|
||||
_Out_ PLONG dpiX,
|
||||
_Out_ PLONG dpiY
|
||||
);
|
||||
|
||||
typedef LONG (WINAPI* _GetDpiForWindow)(
|
||||
_In_ HWND hwnd
|
||||
);
|
||||
|
||||
typedef LONG (WINAPI* _GetDpiForSystem)(
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef LONG (WINAPI* _GetDpiForSession)(
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef LONG (WINAPI* _GetSystemMetricsForDpi)(
|
||||
_In_ LONG Index,
|
||||
_In_ LONG dpi
|
||||
);
|
||||
|
||||
typedef BOOL (WINAPI* _SystemParametersInfoForDpi)(
|
||||
_In_ ULONG uiAction,
|
||||
_In_ ULONG uiParam,
|
||||
_Pre_maybenull_ _Post_valid_ PVOID pvParam,
|
||||
_In_ ULONG fWinIni,
|
||||
_In_ ULONG dpi
|
||||
);
|
||||
|
||||
// Comctl32
|
||||
|
||||
typedef LONG (CALLBACK *MRUSTRINGCMPPROC)(PCWSTR String1, PCWSTR String2);
|
||||
|
||||
@@ -469,7 +469,9 @@ PhQueryDepthSList(
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Event
|
||||
//
|
||||
|
||||
#define PH_EVENT_SET 0x1
|
||||
#define PH_EVENT_SET_SHIFT 0
|
||||
@@ -502,8 +504,6 @@ typedef struct _PH_EVENT
|
||||
HANDLE EventHandle;
|
||||
} PH_EVENT, *PPH_EVENT;
|
||||
|
||||
static_assert(sizeof(PH_EVENT) == sizeof(ULONG_PTR) + sizeof(HANDLE));
|
||||
|
||||
#define PH_EVENT_INIT { { PH_EVENT_REFCOUNT_INC }, NULL }
|
||||
|
||||
PHLIBAPI
|
||||
@@ -748,7 +748,9 @@ PhWaitForRundownProtection(
|
||||
PhfWaitForRundownProtection(Protection);
|
||||
}
|
||||
|
||||
//
|
||||
// One-time initialization
|
||||
//
|
||||
|
||||
#define PH_INITONCE_SHIFT 31
|
||||
#define PH_INITONCE_INITIALIZING (0x1 << PH_INITONCE_SHIFT)
|
||||
@@ -2604,7 +2606,9 @@ PhConvertBytesToUtf16(
|
||||
return PhConvertUtf8ToUtf16Ex(String->Buffer, String->Length);
|
||||
}
|
||||
|
||||
//
|
||||
// String builder
|
||||
//
|
||||
|
||||
/**
|
||||
* A string builder structure.
|
||||
@@ -2780,7 +2784,9 @@ PhRemoveEndStringBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Byte string builder
|
||||
//
|
||||
|
||||
/**
|
||||
* A byte string builder structure.
|
||||
@@ -2876,7 +2882,9 @@ PhAppendFormatBytesBuilder(
|
||||
...
|
||||
);
|
||||
|
||||
//
|
||||
// Array
|
||||
//
|
||||
|
||||
/** An array structure. Storage is automatically allocated for new elements. */
|
||||
typedef struct _PH_ARRAY
|
||||
@@ -3204,7 +3212,9 @@ PhEnumPointerList(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Hash
|
||||
//
|
||||
|
||||
typedef struct _PH_HASH_ENTRY
|
||||
{
|
||||
@@ -3444,7 +3454,9 @@ PhResizeHashSet(
|
||||
*NumberOfBuckets = NewNumberOfBuckets;
|
||||
}
|
||||
|
||||
//
|
||||
// Hashtable
|
||||
//
|
||||
|
||||
extern PPH_OBJECT_TYPE PhHashtableType;
|
||||
|
||||
@@ -3714,7 +3726,9 @@ PhHashIntPtr(
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Simple hashtable
|
||||
//
|
||||
|
||||
#define SIP(String, Integer) { (String), (PVOID)(Integer) }
|
||||
#define SREF(String) ((PVOID)&(PH_STRINGREF)PH_STRINGREF_INIT((String)))
|
||||
@@ -3835,7 +3849,9 @@ PhFreeToFreeList(
|
||||
_In_ PVOID Memory
|
||||
);
|
||||
|
||||
//
|
||||
// Callback
|
||||
//
|
||||
|
||||
/**
|
||||
* A callback function.
|
||||
@@ -3843,10 +3859,12 @@ PhFreeToFreeList(
|
||||
* \param Parameter A value given to all callback functions being notified.
|
||||
* \param Context A user-defined value passed to PhRegisterCallback().
|
||||
*/
|
||||
typedef VOID (NTAPI *PPH_CALLBACK_FUNCTION)(
|
||||
typedef _Function_class_(PH_CALLBACK_FUNCTION)
|
||||
VOID NTAPI PH_CALLBACK_FUNCTION(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
);
|
||||
typedef PH_CALLBACK_FUNCTION *PPH_CALLBACK_FUNCTION;
|
||||
|
||||
/** A callback registration structure. */
|
||||
typedef struct _PH_CALLBACK_REGISTRATION
|
||||
@@ -4890,12 +4908,12 @@ typedef struct _PH_AVL_LINKS
|
||||
LONG Balance;
|
||||
} PH_AVL_LINKS, *PPH_AVL_LINKS;
|
||||
|
||||
struct _PH_AVL_TREE;
|
||||
|
||||
typedef LONG (NTAPI *PPH_AVL_TREE_COMPARE_FUNCTION)(
|
||||
typedef _Function_class_(PH_AVL_TREE_COMPARE_FUNCTION)
|
||||
LONG NTAPI PH_AVL_TREE_COMPARE_FUNCTION(
|
||||
_In_ PPH_AVL_LINKS Links1,
|
||||
_In_ PPH_AVL_LINKS Links2
|
||||
);
|
||||
typedef PH_AVL_TREE_COMPARE_FUNCTION* PPH_AVL_TREE_COMPARE_FUNCTION;
|
||||
|
||||
typedef struct _PH_AVL_TREE
|
||||
{
|
||||
@@ -5001,11 +5019,13 @@ PhPredecessorElementAvlTree(
|
||||
_In_ PPH_AVL_LINKS Element
|
||||
);
|
||||
|
||||
typedef BOOLEAN (NTAPI *PPH_ENUM_AVL_TREE_CALLBACK)(
|
||||
typedef _Function_class_(PH_ENUM_AVL_TREE_CALLBACK)
|
||||
BOOLEAN NTAPI PH_ENUM_AVL_TREE_CALLBACK(
|
||||
_In_ PPH_AVL_TREE Tree,
|
||||
_In_ PPH_AVL_LINKS Element,
|
||||
_In_opt_ PVOID Context
|
||||
);
|
||||
typedef PH_ENUM_AVL_TREE_CALLBACK *PPH_ENUM_AVL_TREE_CALLBACK;
|
||||
|
||||
PHLIBAPI
|
||||
VOID
|
||||
|
||||
+164
-89
@@ -47,28 +47,30 @@ EXTERN_C CONST DECLSPEC_SELECTANY IN_ADDR inaddr_any = { 0x00 };
|
||||
EXTERN_C CONST DECLSPEC_SELECTANY IN6_ADDR in6addr_any = { 0x00 };
|
||||
EXTERN_C CONST DECLSPEC_SELECTANY IN6_ADDR in6addr_v4mappedprefix = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
#define PH_IPV4_NETWORK_TYPE 0x1
|
||||
#define PH_IPV6_NETWORK_TYPE 0x2
|
||||
#define PH_HV_NETWORK_TYPE 0x4
|
||||
#define PH_NETWORK_TYPE_NONE 0x0
|
||||
#define PH_NETWORK_TYPE_IPV4 0x1
|
||||
#define PH_NETWORK_TYPE_IPV6 0x2
|
||||
#define PH_NETWORK_TYPE_HYPERV 0x4
|
||||
#define PH_NETWORK_TYPE_MASK 0x8
|
||||
|
||||
#define PH_TCP_PROTOCOL_TYPE 0x10
|
||||
#define PH_UDP_PROTOCOL_TYPE 0x20
|
||||
#define PH_PROTOCOL_TYPE_NONE 0x0
|
||||
#define PH_PROTOCOL_TYPE_TCP 0x10
|
||||
#define PH_PROTOCOL_TYPE_UDP 0x20
|
||||
#define PH_PROTOCOL_TYPE_MASK 0x30
|
||||
|
||||
#define PH_NO_NETWORK_PROTOCOL 0x0
|
||||
#define PH_TCP4_NETWORK_PROTOCOL (PH_IPV4_NETWORK_TYPE | PH_TCP_PROTOCOL_TYPE)
|
||||
#define PH_TCP6_NETWORK_PROTOCOL (PH_IPV6_NETWORK_TYPE | PH_TCP_PROTOCOL_TYPE)
|
||||
#define PH_UDP4_NETWORK_PROTOCOL (PH_IPV4_NETWORK_TYPE | PH_UDP_PROTOCOL_TYPE)
|
||||
#define PH_UDP6_NETWORK_PROTOCOL (PH_IPV6_NETWORK_TYPE | PH_UDP_PROTOCOL_TYPE)
|
||||
#define PH_HV_NETWORK_PROTOCOL (PH_HV_NETWORK_TYPE)
|
||||
#define PH_NETWORK_PROTOCOL_NONE 0x0
|
||||
#define PH_NETWORK_PROTOCOL_TCP4 (PH_NETWORK_TYPE_IPV4 | PH_PROTOCOL_TYPE_TCP)
|
||||
#define PH_NETWORK_PROTOCOL_TCP6 (PH_NETWORK_TYPE_IPV6 | PH_PROTOCOL_TYPE_TCP)
|
||||
#define PH_NETWORK_PROTOCOL_UDP4 (PH_NETWORK_TYPE_IPV4 | PH_PROTOCOL_TYPE_UDP)
|
||||
#define PH_NETWORK_PROTOCOL_UDP6 (PH_NETWORK_TYPE_IPV6 | PH_PROTOCOL_TYPE_UDP)
|
||||
#define PH_NETWORK_PROTOCOL_HYPERV (PH_NETWORK_TYPE_HYPERV)
|
||||
|
||||
typedef struct _PH_IP_ADDRESS
|
||||
{
|
||||
ULONG Type;
|
||||
union
|
||||
{
|
||||
ULONG Ipv4;
|
||||
UCHAR Ipv4[4];
|
||||
IN_ADDR InAddr;
|
||||
UCHAR Ipv6[16];
|
||||
IN6_ADDR In6Addr;
|
||||
@@ -76,7 +78,15 @@ typedef struct _PH_IP_ADDRESS
|
||||
};
|
||||
} PH_IP_ADDRESS, *PPH_IP_ADDRESS;
|
||||
|
||||
FORCEINLINE BOOLEAN PhEqualIpAddress(
|
||||
typedef struct _PH_IP_ENDPOINT
|
||||
{
|
||||
PH_IP_ADDRESS Address;
|
||||
ULONG Port;
|
||||
} PH_IP_ENDPOINT, *PPH_IP_ENDPOINT;
|
||||
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
PhEqualIpAddress(
|
||||
_In_ PPH_IP_ADDRESS Address1,
|
||||
_In_ PPH_IP_ADDRESS Address2
|
||||
)
|
||||
@@ -86,117 +96,144 @@ FORCEINLINE BOOLEAN PhEqualIpAddress(
|
||||
if (Address1->Type != Address2->Type)
|
||||
return FALSE;
|
||||
|
||||
if (Address1->Type == PH_IPV4_NETWORK_TYPE)
|
||||
switch (Address1->Type)
|
||||
{
|
||||
return IN4_ADDR_EQUAL(&Address1->InAddr, &Address2->InAddr);
|
||||
// return Address1->Ipv4 == Address2->Ipv4;
|
||||
}
|
||||
else if (Address1->Type == PH_IPV6_NETWORK_TYPE)
|
||||
{
|
||||
return IN6_ADDR_EQUAL(&Address1->In6Addr, &Address2->In6Addr);
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
return IN4_ADDR_EQUAL(&Address1->InAddr, &Address2->InAddr);
|
||||
}
|
||||
break;
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
return IN6_ADDR_EQUAL(&Address1->In6Addr, &Address2->In6Addr);
|
||||
//#ifdef _WIN64
|
||||
// return
|
||||
// *(PULONG64)(Address1->Ipv6) == *(PULONG64)(Address2->Ipv6) &&
|
||||
// *(PULONG64)(Address1->Ipv6 + 8) == *(PULONG64)(Address2->Ipv6 + 8);
|
||||
// return
|
||||
// *(PULONG64)(Address1->Ipv6) == *(PULONG64)(Address2->Ipv6) &&
|
||||
// *(PULONG64)(Address1->Ipv6 + 8) == *(PULONG64)(Address2->Ipv6 + 8);
|
||||
//#else
|
||||
// return
|
||||
// *(PULONG)(Address1->Ipv6) == *(PULONG)(Address2->Ipv6) &&
|
||||
// *(PULONG)(Address1->Ipv6 + 4) == *(PULONG)(Address2->Ipv6 + 4) &&
|
||||
// *(PULONG)(Address1->Ipv6 + 8) == *(PULONG)(Address2->Ipv6 + 8) &&
|
||||
// *(PULONG)(Address1->Ipv6 + 12) == *(PULONG)(Address2->Ipv6 + 12);
|
||||
// return
|
||||
// *(PULONG)(Address1->Ipv6) == *(PULONG)(Address2->Ipv6) &&
|
||||
// *(PULONG)(Address1->Ipv6 + 4) == *(PULONG)(Address2->Ipv6 + 4) &&
|
||||
// *(PULONG)(Address1->Ipv6 + 8) == *(PULONG)(Address2->Ipv6 + 8) &&
|
||||
// *(PULONG)(Address1->Ipv6 + 12) == *(PULONG)(Address2->Ipv6 + 12);
|
||||
//#endif
|
||||
}
|
||||
break;
|
||||
case PH_NETWORK_TYPE_HYPERV:
|
||||
{
|
||||
//return IsEqualGUID(&Address1->HvAddr, &Address2->HvAddr);
|
||||
return !memcmp(&Address1->HvAddr, &Address2->HvAddr, sizeof(GUID));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
//return IsEqualGUID(&Address1->HvAddr, &Address2->HvAddr);
|
||||
return !memcmp(&Address1->HvAddr, &Address2->HvAddr, sizeof(GUID));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
FORCEINLINE ULONG PhHashIpAddress(
|
||||
FORCEINLINE
|
||||
ULONG
|
||||
PhHashIpAddress(
|
||||
_In_ PPH_IP_ADDRESS Address
|
||||
)
|
||||
{
|
||||
ULONG hash = 0;
|
||||
|
||||
if (Address->Type == 0)
|
||||
if (Address->Type == PH_NETWORK_TYPE_NONE)
|
||||
return 0;
|
||||
|
||||
hash = Address->Type | (Address->Type << 16);
|
||||
switch (Address->Type)
|
||||
{
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
ULONG hash;
|
||||
|
||||
if (Address->Type == PH_IPV4_NETWORK_TYPE)
|
||||
{
|
||||
hash ^= Address->Ipv4;
|
||||
}
|
||||
else if (Address->Type == PH_IPV6_NETWORK_TYPE)
|
||||
{
|
||||
hash += *(PULONG)(Address->Ipv6);
|
||||
hash ^= *(PULONG)(Address->Ipv6 + 4);
|
||||
hash += *(PULONG)(Address->Ipv6 + 8);
|
||||
hash ^= *(PULONG)(Address->Ipv6 + 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
hash += Address->HvAddr.Data1;
|
||||
hash ^= *(PULONG)(&Address->HvAddr.Data2);
|
||||
hash ^= *(PULONG)(Address->HvAddr.Data4);
|
||||
hash ^= *(PULONG)(Address->HvAddr.Data4 + 4);
|
||||
hash = Address->Type | (Address->Type << 16);
|
||||
hash ^= *(PULONG)(Address->Ipv4);
|
||||
|
||||
return hash;
|
||||
}
|
||||
break;
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
ULONG hash;
|
||||
|
||||
hash = Address->Type | (Address->Type << 16);
|
||||
hash += *(PULONG)(Address->Ipv6);
|
||||
hash ^= *(PULONG)(Address->Ipv6 + 4);
|
||||
hash += *(PULONG)(Address->Ipv6 + 8);
|
||||
hash ^= *(PULONG)(Address->Ipv6 + 12);
|
||||
|
||||
return hash;
|
||||
}
|
||||
break;
|
||||
case PH_NETWORK_TYPE_HYPERV:
|
||||
{
|
||||
ULONG hash;
|
||||
|
||||
hash = Address->Type | (Address->Type << 16);
|
||||
hash += Address->HvAddr.Data1;
|
||||
hash ^= *(PULONG)(&Address->HvAddr.Data2);
|
||||
hash ^= *(PULONG)(Address->HvAddr.Data4);
|
||||
hash ^= *(PULONG)(Address->HvAddr.Data4 + 4);
|
||||
|
||||
return hash;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return hash;
|
||||
return 0;
|
||||
}
|
||||
|
||||
FORCEINLINE BOOLEAN PhIsNullIpAddress(
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
PhIsNullIpAddress(
|
||||
_In_ PPH_IP_ADDRESS Address
|
||||
)
|
||||
{
|
||||
if (Address->Type == 0)
|
||||
{
|
||||
if (Address->Type == PH_NETWORK_TYPE_NONE)
|
||||
return TRUE;
|
||||
}
|
||||
else if (Address->Type == PH_IPV4_NETWORK_TYPE)
|
||||
|
||||
switch (Address->Type)
|
||||
{
|
||||
return IN4_IS_ADDR_UNSPECIFIED(&Address->InAddr);
|
||||
//return Address->Ipv4 == 0;
|
||||
}
|
||||
else if (Address->Type == PH_IPV6_NETWORK_TYPE)
|
||||
{
|
||||
return IN6_IS_ADDR_UNSPECIFIED(&Address->In6Addr);
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
return IN4_IS_ADDR_UNSPECIFIED(&Address->InAddr);
|
||||
}
|
||||
break;
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
return IN6_IS_ADDR_UNSPECIFIED(&Address->In6Addr);
|
||||
//#ifdef _WIN64
|
||||
// return (*(PULONG64)(Address->Ipv6) | *(PULONG64)(Address->Ipv6 + 8)) == 0;
|
||||
// return (*(PULONG64)(Address->Ipv6) | *(PULONG64)(Address->Ipv6 + 8)) == 0;
|
||||
//#else
|
||||
// return (*(PULONG)(Address->Ipv6) | *(PULONG)(Address->Ipv6 + 4) |
|
||||
// *(PULONG)(Address->Ipv6 + 8) | *(PULONG)(Address->Ipv6 + 12)) == 0;
|
||||
// return (*(PULONG)(Address->Ipv6) | *(PULONG)(Address->Ipv6 + 4) |
|
||||
// *(PULONG)(Address->Ipv6 + 8) | *(PULONG)(Address->Ipv6 + 12)) == 0;
|
||||
//#endif
|
||||
}
|
||||
break;
|
||||
case PH_NETWORK_TYPE_HYPERV:
|
||||
{
|
||||
//return IsEqualGUID(&Address->HvAddr, &HV_GUID_ZERO);
|
||||
return !memcmp(&Address->HvAddr, &HV_GUID_ZERO, sizeof(GUID));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (Address->Type == PH_HV_NETWORK_TYPE)
|
||||
{
|
||||
//return IsEqualGUID(&Address->HvAddr, &HV_GUID_ZERO);
|
||||
return !memcmp(&Address->HvAddr, &HV_GUID_ZERO, sizeof(GUID));
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct _PH_IP_ENDPOINT
|
||||
{
|
||||
PH_IP_ADDRESS Address;
|
||||
ULONG Port;
|
||||
} PH_IP_ENDPOINT, *PPH_IP_ENDPOINT;
|
||||
|
||||
FORCEINLINE BOOLEAN PhEqualIpEndpoint(
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
PhEqualIpEndpoint(
|
||||
_In_ PPH_IP_ENDPOINT Endpoint1,
|
||||
_In_ PPH_IP_ENDPOINT Endpoint2
|
||||
)
|
||||
{
|
||||
return
|
||||
PhEqualIpAddress(&Endpoint1->Address, &Endpoint2->Address) &&
|
||||
return PhEqualIpAddress(&Endpoint1->Address, &Endpoint2->Address) &&
|
||||
Endpoint1->Port == Endpoint2->Port;
|
||||
}
|
||||
|
||||
FORCEINLINE ULONG PhHashIpEndpoint(
|
||||
FORCEINLINE
|
||||
ULONG
|
||||
PhHashIpEndpoint(
|
||||
_In_ PPH_IP_ENDPOINT Endpoint
|
||||
)
|
||||
{
|
||||
@@ -370,6 +407,44 @@ PhHttpQueryHeaderUlong64(
|
||||
_Out_ PULONG64 HeaderValue
|
||||
);
|
||||
|
||||
FORCEINLINE
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
PhHttpQueryResponseStatus(
|
||||
_In_ PPH_HTTP_CONTEXT HttpContext
|
||||
)
|
||||
{
|
||||
NTSTATUS status;
|
||||
ULONG httpStatus = PH_HTTP_STATUS_OK;
|
||||
|
||||
status = PhHttpQueryHeaderUlong(HttpContext, PH_HTTP_QUERY_STATUS_CODE, &httpStatus);
|
||||
|
||||
if (NT_SUCCESS(status))
|
||||
{
|
||||
switch (httpStatus)
|
||||
{
|
||||
case 301:
|
||||
case 308:
|
||||
//status = STATUS_MORE_ENTRIES;
|
||||
case PH_HTTP_STATUS_OK:
|
||||
status = STATUS_SUCCESS;
|
||||
break;
|
||||
case 401:
|
||||
case 403:
|
||||
status = STATUS_ACCESS_DENIED;
|
||||
break;
|
||||
case 404:
|
||||
status = STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
break;
|
||||
default:
|
||||
status = STATUS_UNEXPECTED_NETWORK_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
PHLIBAPI
|
||||
PPH_STRING
|
||||
NTAPI
|
||||
|
||||
@@ -62,7 +62,7 @@ typedef struct DECLSPEC_ALIGN(16) _PH_QUEUED_WAIT_BLOCK
|
||||
ULONG Flags;
|
||||
} PH_QUEUED_WAIT_BLOCK, *PPH_QUEUED_WAIT_BLOCK;
|
||||
|
||||
static_assert((sizeof(PH_QUEUED_WAIT_BLOCK) % MEMORY_ALLOCATION_ALIGNMENT) == 0);
|
||||
static_assert((sizeof(PH_QUEUED_WAIT_BLOCK) % MEMORY_ALLOCATION_ALIGNMENT) == 0, "PH_QUEUED_WAIT_BLOCK alignment invalid");
|
||||
|
||||
BOOLEAN PhQueuedLockInitialization(
|
||||
VOID
|
||||
|
||||
+3
-2
@@ -13,6 +13,7 @@
|
||||
#include <ph.h>
|
||||
|
||||
#include <commdlg.h>
|
||||
#include <d3dkmthk.h>
|
||||
#include <processsnapshot.h>
|
||||
#include <sddl.h>
|
||||
#include <shellapi.h>
|
||||
@@ -9379,7 +9380,7 @@ NTSTATUS PhRestoreFromDirectXRunningFullScreen(
|
||||
_In_ HANDLE ProcessHandle
|
||||
)
|
||||
{
|
||||
static NTSTATUS (WINAPI* D3DKMTReleaseProcessVidPnSourceOwners_I)(_In_ HANDLE ProcessHandle) = NULL;
|
||||
static __typeof__(&D3DKMTReleaseProcessVidPnSourceOwners) D3DKMTReleaseProcessVidPnSourceOwners_I = NULL;
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
@@ -9404,7 +9405,7 @@ NTSTATUS PhQueryDirectXExclusiveOwnership(
|
||||
_Inout_ PD3DKMT_QUERYVIDPNEXCLUSIVEOWNERSHIP QueryExclusiveOwnership
|
||||
)
|
||||
{
|
||||
static NTSTATUS (WINAPI* D3DKMTQueryVidPnExclusiveOwnership_I)(D3DKMT_QUERYVIDPNEXCLUSIVEOWNERSHIP*) = NULL; // same typedef as NtGdiDdDDIQueryVidPnExclusiveOwnership
|
||||
static __typeof__(&D3DKMTQueryVidPnExclusiveOwnership) D3DKMTQueryVidPnExclusiveOwnership_I = NULL; // same typedef as NtGdiDdDDIQueryVidPnExclusiveOwnership
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
|
||||
+8
-8
@@ -14,12 +14,12 @@ These header files are designed to be used by user-mode programs. Instead of `#i
|
||||
at the top of your program. The first line provides access to the Win32 API as well as the `NTSTATUS` values. The second line provides access to the entire Native API. By default, only definitions present in Windows XP are included into your program. To change this, use one of the following:
|
||||
|
||||
```
|
||||
#define PHNT_VERSION PHNT_WINXP // Windows XP
|
||||
#define PHNT_VERSION PHNT_WS03 // Windows Server 2003
|
||||
#define PHNT_VERSION PHNT_VISTA // Windows Vista
|
||||
#define PHNT_VERSION PHNT_WIN7 // Windows 7
|
||||
#define PHNT_VERSION PHNT_WIN8 // Windows 8
|
||||
#define PHNT_VERSION PHNT_WINBLUE // Windows 8.1
|
||||
#define PHNT_VERSION PHNT_THRESHOLD // Windows 10
|
||||
#define PHNT_VERSION PHNT_WIN11 // Windows 11
|
||||
#define PHNT_VERSION PHNT_WINDOWS_XP // Windows XP
|
||||
#define PHNT_VERSION PHNT_WINDOWS_SERVER_2003 // Windows Server 2003
|
||||
#define PHNT_VERSION PHNT_WINDOWS_VISTA // Windows Vista
|
||||
#define PHNT_VERSION PHNT_WINDOWS_7 // Windows 7
|
||||
#define PHNT_VERSION PHNT_WINDOWS_8 // Windows 8
|
||||
#define PHNT_VERSION PHNT_WINDOWS_8_1 // Windows 8.1
|
||||
#define PHNT_VERSION PHNT_WINDOWS_10 // Windows 10
|
||||
#define PHNT_VERSION PHNT_WINDOWS_11 // Windows 11
|
||||
```
|
||||
|
||||
@@ -231,7 +231,7 @@ BcdExportStore(
|
||||
_In_ PCUNICODE_STRING BcdFilePath
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION > PHNT_WIN11)
|
||||
#if (PHNT_VERSION > PHNT_WINDOWS_11)
|
||||
/**
|
||||
* Exports the BCD store to a file with additional flags.
|
||||
*
|
||||
|
||||
+91
-53
@@ -245,7 +245,7 @@ typedef struct _EFI_DRIVER_ENTRY_LIST
|
||||
EFI_DRIVER_ENTRY DriverEntry;
|
||||
} EFI_DRIVER_ENTRY_LIST, *PEFI_DRIVER_ENTRY_LIST;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINXP)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_XP)
|
||||
/**
|
||||
* The NtAddBootEntry routine adds a new boot entry to the system boot configuration.
|
||||
*
|
||||
@@ -380,9 +380,9 @@ NtTranslateFilePath(
|
||||
_Out_writes_bytes_opt_(*OutputFilePathLength) PFILE_PATH OutputFilePath,
|
||||
_Inout_opt_ PULONG OutputFilePathLength
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_XP)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WS03)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
/**
|
||||
* The NtAddDriverEntry routine adds a new driver entry to the system boot configuration.
|
||||
*
|
||||
@@ -468,7 +468,7 @@ NtSetDriverEntryOrder(
|
||||
_In_reads_(Count) PULONG Ids,
|
||||
_In_ ULONG Count
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
|
||||
typedef enum _FILTER_BOOT_OPTION_OPERATION
|
||||
{
|
||||
@@ -478,7 +478,7 @@ typedef enum _FILTER_BOOT_OPTION_OPERATION
|
||||
FilterBootOptionOperationMax
|
||||
} FILTER_BOOT_OPTION_OPERATION;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
/**
|
||||
* The NtFilterBootOption routine filters boot options based on the specified operation, object type, and element type.
|
||||
*
|
||||
@@ -499,7 +499,7 @@ NtFilterBootOption(
|
||||
_In_reads_bytes_opt_(DataSize) PVOID Data,
|
||||
_In_ ULONG DataSize
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
//
|
||||
// Event
|
||||
@@ -583,7 +583,7 @@ NtSetEvent(
|
||||
_Out_opt_ PLONG PreviousState
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
/**
|
||||
* The NtSetEventEx routine sets an event object to the signaled state and optionally acquires a lock.
|
||||
*
|
||||
@@ -598,7 +598,7 @@ NtSetEventEx(
|
||||
_In_ HANDLE ThreadId,
|
||||
_In_opt_ PRTL_SRWLOCK Lock
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
|
||||
/**
|
||||
* The NtSetEventBoostPriority routine sets an event object to the signaled state and boosts the priority of threads waiting on the event.
|
||||
@@ -1097,7 +1097,7 @@ NtSetTimer(
|
||||
_Out_opt_ PBOOLEAN PreviousState
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1107,7 +1107,7 @@ NtSetTimerEx(
|
||||
_Inout_updates_bytes_opt_(TimerSetInformationLength) PVOID TimerSetInformation,
|
||||
_In_ ULONG TimerSetInformationLength
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1128,7 +1128,7 @@ NtQueryTimer(
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1147,9 +1147,9 @@ NtSetIRTimer(
|
||||
_In_opt_ PLARGE_INTEGER DueTime
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1162,7 +1162,7 @@ NtCreateTimer2(
|
||||
_In_ ACCESS_MASK DesiredAccess
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
typedef struct _T2_SET_PARAMETERS_V0
|
||||
{
|
||||
@@ -1173,7 +1173,7 @@ typedef struct _T2_SET_PARAMETERS_V0
|
||||
|
||||
typedef PVOID PT2_CANCEL_PARAMETERS;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1193,9 +1193,11 @@ NtCancelTimer2(
|
||||
_In_ PT2_CANCEL_PARAMETERS Parameters
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
//
|
||||
// Profile
|
||||
//
|
||||
|
||||
#define PROFILE_CONTROL 0x0001
|
||||
#define PROFILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | PROFILE_CONTROL)
|
||||
@@ -1215,7 +1217,7 @@ NtCreateProfile(
|
||||
_In_ KAFFINITY Affinity
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1231,7 +1233,7 @@ NtCreateProfileEx(
|
||||
_In_ USHORT GroupCount,
|
||||
_In_reads_(GroupCount) PGROUP_AFFINITY GroupAffinity
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1309,18 +1311,22 @@ NtWaitForKeyedEvent(
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
);
|
||||
|
||||
//
|
||||
// UMS
|
||||
//
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtUmsThreadYield(
|
||||
_In_ PVOID SchedulerParam
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
|
||||
//
|
||||
// WNF
|
||||
//
|
||||
|
||||
// begin_private
|
||||
|
||||
@@ -1379,7 +1385,7 @@ typedef struct _WNF_DELIVERY_DESCRIPTOR
|
||||
|
||||
// end_private
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1462,9 +1468,9 @@ NtUnsubscribeWnfStateChange(
|
||||
_In_ PCWNF_STATE_NAME StateName
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1485,9 +1491,11 @@ NtSetWnfProcessNotificationEvent(
|
||||
_In_ HANDLE NotificationEvent
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
//
|
||||
// Worker factory
|
||||
//
|
||||
|
||||
// begin_rev
|
||||
|
||||
@@ -1563,7 +1571,7 @@ typedef struct _WORKER_FACTORY_BASIC_INFORMATION
|
||||
|
||||
// end_private
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1632,7 +1640,7 @@ typedef struct _WORKER_FACTORY_DEFERRED_WORK
|
||||
ULONG Flags;
|
||||
} WORKER_FACTORY_DEFERRED_WORK, *PWORKER_FACTORY_DEFERRED_WORK;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1655,9 +1663,9 @@ NtWaitForWorkViaWorkerFactory(
|
||||
_Out_ PFILE_IO_COMPLETION_INFORMATION MiniPacket
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
//
|
||||
// Time
|
||||
@@ -1729,7 +1737,7 @@ NtSetTimerResolution(
|
||||
);
|
||||
|
||||
//
|
||||
// Performance Counter
|
||||
// Performance Counters
|
||||
//
|
||||
|
||||
NTSYSCALLAPI
|
||||
@@ -1740,8 +1748,15 @@ NtQueryPerformanceCounter(
|
||||
_Out_opt_ PLARGE_INTEGER PerformanceFrequency
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE2)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS2)
|
||||
// rev
|
||||
/**
|
||||
* The NtQueryAuxiliaryCounterFrequency routine queries the auxiliary counter frequency. (The auxiliary counter is generally the HPET hardware timer).
|
||||
*
|
||||
* @param AuxiliaryCounterFrequency A pointer to an output buffer that contains the specified auxiliary counter frequency. If the auxiliary counter is not supported, the value in the output buffer will be undefined.
|
||||
* @return NTSTATUS Successful or errant status.
|
||||
* @see https://learn.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryauxiliarycounterfrequency
|
||||
*/
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1750,6 +1765,17 @@ NtQueryAuxiliaryCounterFrequency(
|
||||
);
|
||||
|
||||
// rev
|
||||
/**
|
||||
* The NtConvertBetweenAuxiliaryCounterAndPerformanceCounter routine converts the specified performance counter value to the corresponding auxiliary counter value;
|
||||
* optionally provides the estimated conversion error in nanoseconds due to latencies and maximum possible drift.
|
||||
*
|
||||
* @param ConvertAuxiliaryToPerformanceCounter If TRUE, the value will be converted from AUX to QPC. If FALSE, the value will be converted from QPC to AUX.
|
||||
* @param PerformanceOrAuxiliaryCounterValue The performance counter value to convert.
|
||||
* @param ConvertedValue On success, contains the converted auxiliary counter value. Will be undefined if the function fails.
|
||||
* @param ConversionError On success, contains the estimated conversion error, in nanoseconds. Will be undefined if the function fails.
|
||||
* @return NTSTATUS Successful or errant status.
|
||||
* @see https://learn.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-convertperformancecountertoauxiliarycounter
|
||||
*/
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1759,9 +1785,11 @@ NtConvertBetweenAuxiliaryCounterAndPerformanceCounter(
|
||||
_Out_ PULONG64 ConvertedValue,
|
||||
_Out_opt_ PULONG64 ConversionError
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_10_RS2)
|
||||
|
||||
//
|
||||
// LUIDs
|
||||
//
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1770,7 +1798,9 @@ NtAllocateLocallyUniqueId(
|
||||
_Out_ PLUID Luid
|
||||
);
|
||||
|
||||
//
|
||||
// UUIDs
|
||||
//
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1789,10 +1819,12 @@ NtAllocateUuids(
|
||||
_Out_ PCHAR Seed
|
||||
);
|
||||
|
||||
// System Information
|
||||
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
//
|
||||
// System Information
|
||||
//
|
||||
|
||||
// rev
|
||||
// private
|
||||
typedef enum _SYSTEM_INFORMATION_CLASS
|
||||
@@ -3083,7 +3115,7 @@ typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
|
||||
PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
|
||||
ULONG ImageLength;
|
||||
} SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
|
||||
#endif
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
// geoffchappell
|
||||
#ifdef _WIN64
|
||||
@@ -3278,7 +3310,7 @@ typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
|
||||
ULONG TableBufferLength;
|
||||
_Field_size_bytes_(TableBufferLength) UCHAR TableBuffer[1];
|
||||
} SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
|
||||
#endif
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
// private
|
||||
@@ -3294,7 +3326,7 @@ typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
|
||||
PFNFTH FirmwareTableHandler;
|
||||
PVOID DriverObject;
|
||||
} SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER;
|
||||
#endif
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
// private
|
||||
typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
|
||||
@@ -5022,7 +5054,7 @@ typedef struct _SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION
|
||||
ULONG WoW64Container : 1;
|
||||
ULONG ReservedZero0 : 11;
|
||||
} SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION, *PSYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION;
|
||||
#endif
|
||||
#endif // NTDDI_WIN10_FE
|
||||
|
||||
// private
|
||||
typedef struct _SYSTEM_MEMORY_USAGE_INFORMATION
|
||||
@@ -5607,7 +5639,7 @@ NtQuerySystemInformation(
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -5619,7 +5651,7 @@ NtQuerySystemInformationEx(
|
||||
_In_ ULONG SystemInformationLength,
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6722,7 +6754,9 @@ NtGetTickCount(
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Locale
|
||||
//
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6747,7 +6781,7 @@ NtQueryInstallUILanguage(
|
||||
_Out_ LANGID *InstallUILanguageId
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6756,7 +6790,7 @@ NtFlushInstallUILanguage(
|
||||
_In_ LANGID InstallUILanguage,
|
||||
_In_ ULONG SetComittedFlag
|
||||
);
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_VISTA
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6772,7 +6806,7 @@ NtSetDefaultUILanguage(
|
||||
_In_ LANGID DefaultUILanguageId
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6780,13 +6814,13 @@ NTAPI
|
||||
NtIsUILanguageComitted(
|
||||
VOID
|
||||
);
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_VISTA
|
||||
|
||||
// NLS
|
||||
|
||||
// begin_private
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6809,7 +6843,7 @@ NtGetNlsSectionPtr(
|
||||
_Out_ PULONG SectionSize
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION < PHNT_WIN7)
|
||||
#if (PHNT_VERSION < PHNT_WINDOWS_7)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6827,7 +6861,7 @@ NtReleaseCMFViewOwnership(
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // PHNT_VERSION < PHNT_WINDOWS_7
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6850,11 +6884,13 @@ NtGetMUIRegistryInfo(
|
||||
_Out_ PVOID Data
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_VISTA
|
||||
|
||||
// end_private
|
||||
|
||||
//
|
||||
// Global atoms
|
||||
//
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6865,7 +6901,7 @@ NtAddAtom(
|
||||
_Out_opt_ PRTL_ATOM Atom
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
#define ATOM_FLAG_GLOBAL 0x2
|
||||
|
||||
@@ -6880,7 +6916,7 @@ NtAddAtomEx(
|
||||
_In_ ULONG Flags
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_8
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -6929,7 +6965,9 @@ NtQueryInformationAtom(
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
|
||||
//
|
||||
// Global flags
|
||||
//
|
||||
|
||||
#define FLG_STOP_ON_EXCEPTION 0x00000001 // uk
|
||||
#define FLG_SHOW_LDR_SNAPS 0x00000002 // uk
|
||||
@@ -7010,7 +7048,7 @@ NtQueryInformationAtom(
|
||||
FLG_ENABLE_HANDLE_EXCEPTIONS)
|
||||
|
||||
// Licensing
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -7058,7 +7096,7 @@ NtDisplayString(
|
||||
|
||||
// Boot graphics
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -7195,7 +7233,7 @@ static_assert(sizeof(MANAGE_HOT_PATCH_CHECK_ENABLED) == 0x8, "Size of MANAGE_HOT
|
||||
static_assert(sizeof(MANAGE_HOT_PATCH_CREATE_PATCH_SECTION) == 0x28, "Size of MANAGE_HOT_PATCH_CREATE_PATCH_SECTION is incorrect");
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -7206,7 +7244,7 @@ NtManageHotPatch(
|
||||
_In_ ULONG HotPatchInformationLength,
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_11
|
||||
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
|
||||
+45
-74
@@ -462,7 +462,7 @@ typedef struct _FILE_END_OF_FILE_INFORMATION
|
||||
LARGE_INTEGER EndOfFile;
|
||||
} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
|
||||
|
||||
//#if (PHNT_VERSION >= PHNT_REDSTONE5)
|
||||
//#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS5)
|
||||
#define FLAGS_END_OF_FILE_INFO_EX_EXTEND_PAGING 0x00000001
|
||||
#define FLAGS_END_OF_FILE_INFO_EX_NO_EXTRA_PAGING_EXTEND 0x00000002
|
||||
#define FLAGS_END_OF_FILE_INFO_EX_TIME_CONSTRAINED 0x00000004
|
||||
@@ -842,7 +842,7 @@ typedef struct _FILE_VOLUME_NAME_INFORMATION
|
||||
|
||||
#ifndef FILE_INVALID_FILE_ID
|
||||
#define FILE_INVALID_FILE_ID ((LONGLONG)-1LL)
|
||||
#endif
|
||||
#endif // FILE_INVALID_FILE_ID
|
||||
|
||||
#define FILE_ID_IS_INVALID(FID) ((FID).QuadPart == FILE_INVALID_FILE_ID)
|
||||
|
||||
@@ -1104,7 +1104,7 @@ typedef struct _FILE_STAT_BASIC_INFORMATION
|
||||
LARGE_INTEGER VolumeSerialNumber;
|
||||
FILE_ID_128 FileId128;
|
||||
} FILE_STAT_BASIC_INFORMATION, *PFILE_STAT_BASIC_INFORMATION;
|
||||
#endif
|
||||
#endif // NTDDI_WIN11_GE
|
||||
|
||||
typedef struct _FILE_MEMORY_PARTITION_INFORMATION
|
||||
{
|
||||
@@ -1148,7 +1148,7 @@ typedef struct _FILE_STAT_LX_INFORMATION
|
||||
ULONG LxDeviceIdMajor;
|
||||
ULONG LxDeviceIdMinor;
|
||||
} FILE_STAT_LX_INFORMATION, *PFILE_STAT_LX_INFORMATION;
|
||||
#endif
|
||||
#endif // NTDDI_WIN11_GE
|
||||
|
||||
typedef struct _FILE_STORAGE_RESERVE_ID_INFORMATION
|
||||
{
|
||||
@@ -1162,7 +1162,7 @@ typedef struct _FILE_CASE_SENSITIVE_INFORMATION
|
||||
{
|
||||
ULONG Flags;
|
||||
} FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION;
|
||||
#endif
|
||||
#endif // NTDDI_WIN11_GE
|
||||
|
||||
typedef enum _FILE_KNOWN_FOLDER_TYPE
|
||||
{
|
||||
@@ -1736,7 +1736,7 @@ NtFlushBuffersFile(
|
||||
#define FLUSH_FLAGS_FLUSH_AND_PURGE 0x00000008 // 24H2
|
||||
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1760,7 +1760,7 @@ NtQueryInformationFile(
|
||||
_In_ FILE_INFORMATION_CLASS FileInformationClass
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE2)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS2)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1808,7 +1808,7 @@ NtQueryDirectoryFile(
|
||||
#define FILE_QUERY_RETURN_ON_DISK_ENTRIES_ONLY 0x00000008
|
||||
#define FILE_QUERY_NO_CURSOR_UPDATE 0x00000010 // RS5
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE3)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS3)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1906,7 +1906,7 @@ NtCancelIoFile(
|
||||
_Out_ PIO_STATUS_BLOCK IoStatusBlock
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1917,7 +1917,7 @@ NtCancelIoFileEx(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -2144,7 +2144,7 @@ typedef struct _FILE_NOTIFY_EXTENDED_INFORMATION
|
||||
ULONG FileNameLength;
|
||||
WCHAR FileName[1];
|
||||
} FILE_NOTIFY_EXTENDED_INFORMATION, *PFILE_NOTIFY_EXTENDED_INFORMATION;
|
||||
#endif
|
||||
#endif // NTDDI_WIN10_RS5
|
||||
|
||||
#define FILE_NAME_FLAG_HARDLINK 0 // not part of a name pair
|
||||
#define FILE_NAME_FLAG_NTFS 0x01 // NTFS name in a name pair
|
||||
@@ -2178,7 +2178,7 @@ typedef struct _FILE_NOTIFY_FULL_INFORMATION
|
||||
} FILE_NOTIFY_FULL_INFORMATION, *PFILE_NOTIFY_FULL_INFORMATION;
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE3)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS3)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -2296,7 +2296,7 @@ NtSetIoCompletion(
|
||||
_In_ ULONG_PTR IoStatusInformation
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -2321,7 +2321,7 @@ NtRemoveIoCompletion(
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
typedef struct _FILE_IO_COMPLETION_INFORMATION
|
||||
{
|
||||
@@ -2341,11 +2341,13 @@ NtRemoveIoCompletionEx(
|
||||
_In_opt_ PLARGE_INTEGER Timeout,
|
||||
_In_ BOOLEAN Alertable
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
//
|
||||
// Wait completion packet
|
||||
//
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -2378,71 +2380,31 @@ NtCancelWaitCompletionPacket(
|
||||
_In_ BOOLEAN RemoveSignaledPacket
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
// Sessions
|
||||
|
||||
typedef enum _IO_SESSION_EVENT
|
||||
{
|
||||
IoSessionEventIgnore,
|
||||
IoSessionEventCreated,
|
||||
IoSessionEventTerminated,
|
||||
IoSessionEventConnected,
|
||||
IoSessionEventDisconnected,
|
||||
IoSessionEventLogon,
|
||||
IoSessionEventLogoff,
|
||||
IoSessionEventMax
|
||||
} IO_SESSION_EVENT;
|
||||
|
||||
typedef enum _IO_SESSION_STATE
|
||||
{
|
||||
IoSessionStateCreated = 1,
|
||||
IoSessionStateInitialized = 2,
|
||||
IoSessionStateConnected = 3,
|
||||
IoSessionStateDisconnected = 4,
|
||||
IoSessionStateDisconnectedLoggedOn = 5,
|
||||
IoSessionStateLoggedOn = 6,
|
||||
IoSessionStateLoggedOff = 7,
|
||||
IoSessionStateTerminated = 8,
|
||||
IoSessionStateMax
|
||||
} IO_SESSION_STATE;
|
||||
|
||||
// Sessions
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtOpenSession(
|
||||
_Out_ PHANDLE SessionHandle,
|
||||
_In_ ACCESS_MASK DesiredAccess,
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
||||
NtCopyFileChunk(
|
||||
_In_ HANDLE SourceHandle,
|
||||
_In_ HANDLE DestinationHandle,
|
||||
_In_opt_ HANDLE EventHandle,
|
||||
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
|
||||
_In_ ULONG Length,
|
||||
_In_ PLARGE_INTEGER SourceOffset,
|
||||
_In_ PLARGE_INTEGER DestOffset,
|
||||
_In_opt_ PULONG SourceKey,
|
||||
_In_opt_ PULONG DestKey,
|
||||
_In_ ULONG Flags
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtNotifyChangeSession(
|
||||
_In_ HANDLE SessionHandle,
|
||||
_In_ ULONG ChangeSequenceNumber,
|
||||
_In_ PLARGE_INTEGER ChangeTimeStamp,
|
||||
_In_ IO_SESSION_EVENT Event,
|
||||
_In_ IO_SESSION_STATE NewState,
|
||||
_In_ IO_SESSION_STATE PreviousState,
|
||||
_In_reads_bytes_opt_(PayloadSize) PVOID Payload,
|
||||
_In_ ULONG PayloadSize
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
|
||||
//
|
||||
// I/O Ring
|
||||
//
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -2481,9 +2443,11 @@ NtSetInformationIoRing(
|
||||
_In_ ULONG IoRingInformationLength,
|
||||
_In_ PVOID IoRingInformation
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
|
||||
//
|
||||
// Other types
|
||||
//
|
||||
|
||||
typedef enum _INTERFACE_TYPE
|
||||
{
|
||||
@@ -2843,7 +2807,9 @@ typedef struct _FILE_MAILSLOT_PEEK_BUFFER
|
||||
ULONG MessageLength;
|
||||
} FILE_MAILSLOT_PEEK_BUFFER, *PFILE_MAILSLOT_PEEK_BUFFER;
|
||||
|
||||
//
|
||||
// Mount manager FS control definitions
|
||||
//
|
||||
|
||||
#define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager"
|
||||
#define MOUNTMGRCONTROLTYPE 0x0000006D // 'm'
|
||||
@@ -3050,7 +3016,12 @@ typedef struct _MOUNTMGR_VOLUME_PATHS
|
||||
(s)->Length == 98 && \
|
||||
(s)->Buffer[1] == '?')
|
||||
|
||||
//
|
||||
// Filter manager
|
||||
//
|
||||
|
||||
#define FLT_PORT_CONNECT 0x0001
|
||||
#define FLT_PORT_ALL_ACCESS (FLT_PORT_CONNECT | STANDARD_RIGHTS_ALL)
|
||||
|
||||
// rev
|
||||
#define FLT_SYMLINK_NAME L"\\Global??\\FltMgr"
|
||||
|
||||
@@ -139,7 +139,13 @@ NtCallbackReturn(
|
||||
_In_ NTSTATUS Status
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* The NtFlushProcessWriteBuffers routine flushes the write queue of each processor that is running a thread of the current process.
|
||||
*
|
||||
* @return NTSTATUS Successful or errant status.
|
||||
* @see https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-flushprocesswritebuffers
|
||||
*/
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
||||
+23
-23
@@ -262,7 +262,7 @@ LdrGetDllHandleEx(
|
||||
_Out_ PVOID *DllHandle
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -273,7 +273,7 @@ LdrGetDllHandleByMapping(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -285,7 +285,7 @@ LdrGetDllHandleByName(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -346,7 +346,7 @@ LdrGetProcedureAddress(
|
||||
// rev
|
||||
#define LDR_GET_PROCEDURE_ADDRESS_DONT_RECORD_FORWARDER 0x00000001
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -369,7 +369,7 @@ LdrGetKnownDllSectionHandle(
|
||||
_Out_ PHANDLE Section
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -443,7 +443,7 @@ LdrProcessRelocationBlock(
|
||||
_In_ LONG_PTR Diff
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSAPI
|
||||
PIMAGE_BASE_RELOCATION
|
||||
NTAPI
|
||||
@@ -509,7 +509,7 @@ typedef struct _LDR_VERIFY_IMAGE_INFO
|
||||
USHORT ImageCharacteristics;
|
||||
} LDR_VERIFY_IMAGE_INFO, *PLDR_VERIFY_IMAGE_INFO;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -520,7 +520,7 @@ LdrVerifyImageMatchesChecksumEx(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -569,7 +569,7 @@ VOID NTAPI LDR_DLL_NOTIFICATION_FUNCTION(
|
||||
);
|
||||
typedef LDR_DLL_NOTIFICATION_FUNCTION* PLDR_DLL_NOTIFICATION_FUNCTION;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* Registers for notification when a DLL is first loaded. This notification occurs before dynamic linking takes place.
|
||||
*
|
||||
@@ -622,7 +622,7 @@ typedef struct _LDR_FAILURE_DATA
|
||||
WCHAR AdditionalInfo[0x20];
|
||||
} LDR_FAILURE_DATA, *PLDR_FAILURE_DATA;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINBLUE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8_1)
|
||||
NTSYSAPI
|
||||
PLDR_FAILURE_DATA
|
||||
NTAPI
|
||||
@@ -676,7 +676,7 @@ typedef struct _PS_SYSTEM_DLL_INIT_BLOCK
|
||||
} PS_SYSTEM_DLL_INIT_BLOCK, *PPS_SYSTEM_DLL_INIT_BLOCK;
|
||||
|
||||
// rev
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSAPI PS_SYSTEM_DLL_INIT_BLOCK LdrSystemDllInitBlock;
|
||||
#endif
|
||||
|
||||
@@ -715,7 +715,7 @@ typedef struct _RTL_SCPCFG_NTDLL_EXPORTS
|
||||
} RTL_SCPCFG_NTDLL_EXPORTS, *PRTL_SCPCFG_NTDLL_EXPORTS;
|
||||
|
||||
// rev
|
||||
#if (PHNT_VERSION >= PHNT_WIN11_24H2)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11_24H2)
|
||||
NTSYSAPI RTL_SCPCFG_NTDLL_EXPORTS RtlpScpCfgNtdllExports;
|
||||
#endif
|
||||
|
||||
@@ -723,7 +723,7 @@ NTSYSAPI RTL_SCPCFG_NTDLL_EXPORTS RtlpScpCfgNtdllExports;
|
||||
// Load as data table
|
||||
//
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
// private
|
||||
NTSYSAPI
|
||||
@@ -823,7 +823,7 @@ LdrFindResourceDirectory_U(
|
||||
_Out_ PIMAGE_RESOURCE_DIRECTORY *ResourceDirectory
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
/**
|
||||
* The LdrResFindResource function finds a resource in a DLL.
|
||||
*
|
||||
@@ -1201,7 +1201,7 @@ PVOID NTAPI DELAYLOAD_FAILURE_SYSTEM_ROUTINE(
|
||||
);
|
||||
typedef DELAYLOAD_FAILURE_SYSTEM_ROUTINE* PDELAYLOAD_FAILURE_SYSTEM_ROUTINE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
// rev from QueryOptionalDelayLoadedAPI
|
||||
/**
|
||||
* Determines whether the specified function in a delay-loaded DLL is available on the system.
|
||||
@@ -1224,7 +1224,7 @@ LdrQueryOptionalDelayLoadedAPI(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
// rev from ResolveDelayLoadedAPI
|
||||
/**
|
||||
* Locates the target function of the specified import and replaces the function pointer in the import thunk with the target of the function implementation.
|
||||
@@ -1337,7 +1337,7 @@ LdrShutdownThread(
|
||||
VOID
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINBLUE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8_1)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -1347,7 +1347,7 @@ LdrSetImplicitPathOptions(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
#ifdef PHNT_INLINE_TYPEDEFS
|
||||
/**
|
||||
* The LdrControlFlowGuardEnforced function checks if Control Flow Guard is enforced.
|
||||
@@ -1379,7 +1379,7 @@ LdrControlFlowGuardEnforced(
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
/**
|
||||
* The LdrControlFlowGuardEnforcedWithExportSuppression function checks if Control Flow Guard is
|
||||
* enforced with export suppression.
|
||||
@@ -1399,7 +1399,7 @@ LdrControlFlowGuardEnforcedWithExportSuppression(
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_19H1)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_19H1)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
BOOLEAN
|
||||
@@ -1409,7 +1409,7 @@ LdrIsModuleSxsRedirected(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -1441,7 +1441,7 @@ typedef struct _LDR_SOFTWARE_ENCLAVE
|
||||
PLDR_DATA_TABLE_ENTRY BCryptPrimitivesModule;
|
||||
} LDR_SOFTWARE_ENCLAVE, *PLDR_SOFTWARE_ENCLAVE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
// rev from CreateEnclave
|
||||
/**
|
||||
@@ -1597,7 +1597,7 @@ LdrSetDllManifestProber(
|
||||
_In_ PVOID Routine
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSAPI BOOLEAN LdrpChildNtdll; // DATA export
|
||||
#endif
|
||||
|
||||
|
||||
@@ -654,7 +654,7 @@ typedef struct _ALPC_MESSAGE_HANDLE_INFORMATION
|
||||
|
||||
// begin_private
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
//
|
||||
// System calls
|
||||
@@ -823,7 +823,7 @@ NtAlpcConnectPort(
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -897,7 +897,7 @@ NtAlpcImpersonateClientOfPort(
|
||||
_In_ PVOID Flags
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -990,7 +990,7 @@ AlpcUnregisterCompletionList(
|
||||
_In_ HANDLE PortHandle
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
|
||||
+471
-12
@@ -7,12 +7,9 @@
|
||||
#ifndef _NTMISC_H
|
||||
#define _NTMISC_H
|
||||
|
||||
// Filter manager
|
||||
|
||||
#define FLT_PORT_CONNECT 0x0001
|
||||
#define FLT_PORT_ALL_ACCESS (FLT_PORT_CONNECT | STANDARD_RIGHTS_ALL)
|
||||
|
||||
//
|
||||
// VDM
|
||||
//
|
||||
|
||||
typedef enum _VDMSERVICECLASS
|
||||
{
|
||||
@@ -42,7 +39,69 @@ NtVdmControl(
|
||||
_Inout_ PVOID ServiceData
|
||||
);
|
||||
|
||||
//
|
||||
// Sessions
|
||||
//
|
||||
|
||||
typedef enum _IO_SESSION_EVENT
|
||||
{
|
||||
IoSessionEventIgnore,
|
||||
IoSessionEventCreated,
|
||||
IoSessionEventTerminated,
|
||||
IoSessionEventConnected,
|
||||
IoSessionEventDisconnected,
|
||||
IoSessionEventLogon,
|
||||
IoSessionEventLogoff,
|
||||
IoSessionEventMax
|
||||
} IO_SESSION_EVENT;
|
||||
|
||||
typedef enum _IO_SESSION_STATE
|
||||
{
|
||||
IoSessionStateCreated = 1,
|
||||
IoSessionStateInitialized = 2,
|
||||
IoSessionStateConnected = 3,
|
||||
IoSessionStateDisconnected = 4,
|
||||
IoSessionStateDisconnectedLoggedOn = 5,
|
||||
IoSessionStateLoggedOn = 6,
|
||||
IoSessionStateLoggedOff = 7,
|
||||
IoSessionStateTerminated = 8,
|
||||
IoSessionStateMax
|
||||
} IO_SESSION_STATE;
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtOpenSession(
|
||||
_Out_ PHANDLE SessionHandle,
|
||||
_In_ ACCESS_MASK DesiredAccess,
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
||||
);
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtNotifyChangeSession(
|
||||
_In_ HANDLE SessionHandle,
|
||||
_In_ ULONG ChangeSequenceNumber,
|
||||
_In_ PLARGE_INTEGER ChangeTimeStamp,
|
||||
_In_ IO_SESSION_EVENT Event,
|
||||
_In_ IO_SESSION_STATE NewState,
|
||||
_In_ IO_SESSION_STATE PreviousState,
|
||||
_In_reads_bytes_opt_(PayloadSize) PVOID Payload,
|
||||
_In_ ULONG PayloadSize
|
||||
);
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
|
||||
//
|
||||
// ApiSet
|
||||
//
|
||||
|
||||
NTSYSAPI
|
||||
BOOL
|
||||
@@ -70,7 +129,7 @@ typedef enum _SECURE_SETTING_VALUE_TYPE
|
||||
SecureSettingValueTypeUnknown = 4
|
||||
} SECURE_SETTING_VALUE_TYPE, *PSECURE_SETTING_VALUE_TYPE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -85,7 +144,7 @@ NtQuerySecurityPolicy(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_20H1)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_20H1)
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -132,9 +191,9 @@ NtDirectGraphicsCall(
|
||||
_Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
|
||||
_Out_ PULONG ReturnLength
|
||||
);
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_10_20H1)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11_22H2)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11_22H2)
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -170,9 +229,10 @@ NtSetInformationCpuPartition(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE2)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS2)
|
||||
//
|
||||
// Process KeepAlive (also WakeCounter)
|
||||
//
|
||||
|
||||
typedef enum _PROCESS_ACTIVITY_TYPE
|
||||
{
|
||||
@@ -190,6 +250,405 @@ NtAcquireProcessActivityReference(
|
||||
_Reserved_ PROCESS_ACTIVITY_TYPE Reserved
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // (PHNT_VERSION >= PHNT_WINDOWS_10_RS2)
|
||||
|
||||
//
|
||||
// Appx/Msix Packages
|
||||
//
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_CONTEXT_REFERENCE
|
||||
{
|
||||
PVOID reserved;
|
||||
} *PACKAGE_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageProperty
|
||||
{
|
||||
PackageProperty_Name = 1, // q: WCHAR[]
|
||||
PackageProperty_Version = 2, // q: WCHAR[]
|
||||
PackageProperty_Architecture = 3, // q: ULONG (PROCESSOR_ARCHITECTURE_*)
|
||||
PackageProperty_ResourceId = 4, // q: WCHAR[]
|
||||
PackageProperty_Publisher = 5, // q: WCHAR[]
|
||||
PackageProperty_PublisherId = 6, // q: WCHAR[]
|
||||
PackageProperty_FamilyName = 7, // q: WCHAR[]
|
||||
PackageProperty_FullName = 8, // q: WCHAR[]
|
||||
PackageProperty_Flags = 9, // q: ULONG
|
||||
PackageProperty_InstalledLocation = 10, // q: WCHAR[]
|
||||
PackageProperty_DisplayName = 11, // q: WCHAR[]
|
||||
PackageProperty_PublisherDisplayName = 12, // q: WCHAR[]
|
||||
PackageProperty_Description = 13, // q: WCHAR[]
|
||||
PackageProperty_Logo = 14, // q: WCHAR[]
|
||||
PackageProperty_PackageOrigin = 15 // q: PackageOrigin
|
||||
} PackageProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_APPLICATION_CONTEXT_REFERENCE
|
||||
{
|
||||
PVOID reserved;
|
||||
} *PACKAGE_APPLICATION_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageApplicationProperty
|
||||
{
|
||||
PackageApplicationProperty_Aumid = 1, // q: WCHAR[]
|
||||
PackageApplicationProperty_Praid = 2, // q: WCHAR[]
|
||||
PackageApplicationProperty_DisplayName = 3, // q: WCHAR[]
|
||||
PackageApplicationProperty_Description = 4, // q: WCHAR[]
|
||||
PackageApplicationProperty_Logo = 5, // q: WCHAR[]
|
||||
PackageApplicationProperty_SmallLogo = 6, // q: WCHAR[]
|
||||
PackageApplicationProperty_ForegroundText = 7, // q: ULONG
|
||||
PackageApplicationProperty_ForegroundTextString = 8, // q: WCHAR[]
|
||||
PackageApplicationProperty_BackgroundColor = 9, // q: ULONG
|
||||
PackageApplicationProperty_StartPage = 10, // q: WCHAR[]
|
||||
PackageApplicationProperty_ContentURIRulesCount = 11, // q: ULONG
|
||||
PackageApplicationProperty_ContentURIRules = 12, // q: WCHAR[] (multi-sz)
|
||||
PackageApplicationProperty_StaticContentURIRulesCount = 13, // q: ULONG
|
||||
PackageApplicationProperty_StaticContentURIRules = 14, // q: WCHAR[] (multi-sz)
|
||||
PackageApplicationProperty_DynamicContentURIRulesCount = 15, // q: ULONG
|
||||
PackageApplicationProperty_DynamicContentURIRules = 16 // q: WCHAR[] (multi-sz)
|
||||
} PackageApplicationProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_RESOURCES_CONTEXT_REFERENCE
|
||||
{
|
||||
PVOID reserved;
|
||||
} *PACKAGE_RESOURCES_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageResourcesProperty
|
||||
{
|
||||
PackageResourcesProperty_DisplayName = 1,
|
||||
PackageResourcesProperty_PublisherDisplayName = 2,
|
||||
PackageResourcesProperty_Description = 3,
|
||||
PackageResourcesProperty_Logo = 4,
|
||||
PackageResourcesProperty_SmallLogo = 5,
|
||||
PackageResourcesProperty_StartPage = 6
|
||||
} PackageResourcesProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_SECURITY_CONTEXT_REFERENCE
|
||||
{
|
||||
PVOID reserved;
|
||||
} *PACKAGE_SECURITY_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageSecurityProperty
|
||||
{
|
||||
PackageSecurityProperty_SecurityFlags = 1, // q: ULONG
|
||||
PackageSecurityProperty_AppContainerSID = 2, // q: Sid
|
||||
PackageSecurityProperty_CapabilitiesCount = 3, // q: ULONG
|
||||
PackageSecurityProperty_Capabilities = 4 // q: Sid[]
|
||||
} PackageSecurityProperty;
|
||||
|
||||
// private
|
||||
typedef struct _TARGET_PLATFORM_CONTEXT_REFERENCE
|
||||
{
|
||||
PVOID reserved;
|
||||
} *TARGET_PLATFORM_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum TargetPlatformProperty
|
||||
{
|
||||
TargetPlatformProperty_Platform = 1, // q: ULONG
|
||||
TargetPlatformProperty_MinVersion = 2, // q: PACKAGE_VERSION
|
||||
TargetPlatformProperty_MaxVersion = 3 // q: PACKAGE_VERSION
|
||||
} TargetPlatformProperty;
|
||||
|
||||
// private
|
||||
typedef struct _PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE
|
||||
{
|
||||
PVOID reserved;
|
||||
} *PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE;
|
||||
|
||||
// private
|
||||
typedef enum PackageGlobalizationProperty
|
||||
{
|
||||
PackageGlobalizationProperty_ForceUtf8 = 1, // q: ULONG
|
||||
PackageGlobalizationProperty_UseWindowsDisplayLanguage = 2 // q: ULONG
|
||||
} PackageGlobalizationProperty;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8_1)
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_CONTEXT_REFERENCE *PackageContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_CONTEXT_REFERENCE *PackageContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageProperty(
|
||||
_In_ PACKAGE_CONTEXT_REFERENCE PackageContext,
|
||||
_In_ PackageProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackagePropertyString(
|
||||
_In_ PACKAGE_CONTEXT_REFERENCE PackageContext,
|
||||
_In_ PackageProperty PropertyId,
|
||||
_Inout_ PULONG BufferLength,
|
||||
_Out_writes_(BufferLength) PWSTR Buffer
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageOSMaxVersionTested(
|
||||
_In_ PACKAGE_CONTEXT_REFERENCE PackageContext,
|
||||
_Out_ ULONGLONG *OSMaxVersionTested // PACKAGE_VERSION
|
||||
);
|
||||
|
||||
//
|
||||
// Package Application Properties
|
||||
//
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageApplicationContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageApplicationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageApplicationContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageApplicationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageApplicationProperty(
|
||||
_In_ PACKAGE_APPLICATION_CONTEXT_REFERENCE PackageApplicationContext,
|
||||
_In_ PackageApplicationProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageApplicationPropertyString(
|
||||
_In_ PACKAGE_APPLICATION_CONTEXT_REFERENCE PackageApplicationContext,
|
||||
_In_ PackageApplicationProperty PropertyId,
|
||||
_Inout_ PULONG BufferLength,
|
||||
_Out_writes_(BufferLength) PWSTR Buffer
|
||||
);
|
||||
|
||||
//
|
||||
// Package Resource Properties
|
||||
//
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageResourcesContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_RESOURCES_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetPackageResourcesContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_RESOURCES_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
GetCurrentPackageApplicationResourcesContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageApplicationResourcesContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_APPLICATION_CONTEXT_REFERENCE *PackageResourcesContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageResourcesProperty(
|
||||
_In_ PACKAGE_APPLICATION_CONTEXT_REFERENCE PackageResourcesContext,
|
||||
_In_ PackageResourcesProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
//
|
||||
// Package Security Properties
|
||||
//
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetCurrentPackageSecurityContext(
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_SECURITY_CONTEXT_REFERENCE *PackageSecurityContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageSecurityContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_SECURITY_CONTEXT_REFERENCE *PackageSecurityContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageSecurityProperty(
|
||||
_In_ PACKAGE_SECURITY_CONTEXT_REFERENCE PackageSecurityContext,
|
||||
_In_ PackageSecurityProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_8_1
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
//
|
||||
// Target Platform Properties
|
||||
//
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetCurrentTargetPlatformContext(
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ TARGET_PLATFORM_CONTEXT_REFERENCE *TargetPlatformContext
|
||||
);
|
||||
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetTargetPlatformContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ TARGET_PLATFORM_CONTEXT_REFERENCE *TargetPlatformContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageTargetPlatformProperty(
|
||||
_In_ TARGET_PLATFORM_CONTEXT_REFERENCE TargetPlatformContext,
|
||||
_In_ TargetPlatformProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_10
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_20H1)
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
HRESULT
|
||||
WINAPI
|
||||
GetCurrentPackageInfo3(
|
||||
_In_ ULONG flags,
|
||||
_In_ ULONG packagePathType, // PackagePathType
|
||||
_Inout_ PULONG bufferLength,
|
||||
_Out_writes_bytes_opt_(*bufferLength) PVOID buffer,
|
||||
_Out_opt_ PULONG count
|
||||
);
|
||||
|
||||
//
|
||||
// Package Globalization Properties
|
||||
//
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetCurrentPackageGlobalizationContext(
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE *PackageGlobalizationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageGlobalizationContext(
|
||||
_In_ PVOID PackageInfoReference, // PACKAGE_INFO_REFERENCE
|
||||
_In_ ULONG Index,
|
||||
_Reserved_ ULONG_PTR Unused,
|
||||
_Out_ PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE *PackageGlobalizationContext
|
||||
);
|
||||
|
||||
// rev
|
||||
WINBASEAPI
|
||||
LONG
|
||||
WINAPI
|
||||
GetPackageGlobalizationProperty(
|
||||
_In_ PACKAGE_GLOBALIZATION_CONTEXT_REFERENCE PackageGlobalizationContext,
|
||||
_In_ PackageGlobalizationProperty PropertyId,
|
||||
_Inout_ PULONG BufferSize,
|
||||
_Out_writes_bytes_(BufferSize) PVOID Buffer
|
||||
);
|
||||
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_10_20H1
|
||||
|
||||
#endif
|
||||
|
||||
@@ -716,7 +716,7 @@ NtAllocateVirtualMemory(
|
||||
_In_ ULONG PageProtection
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE5)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS5)
|
||||
_Must_inspect_result_
|
||||
_When_(return == 0, __drv_allocatesMem(mem))
|
||||
NTSYSCALLAPI
|
||||
@@ -785,7 +785,7 @@ NtWow64ReadVirtualMemory64(
|
||||
_Out_opt_ PULONGLONG NumberOfBytesRead
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
/**
|
||||
* Reads virtual memory from a process with extended options.
|
||||
*
|
||||
@@ -1018,7 +1018,7 @@ typedef struct _CFG_CALL_TARGET_LIST_INFORMATION
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1076,7 +1076,7 @@ NtCreateSection(
|
||||
_In_opt_ HANDLE FileHandle
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE5)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS5)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1118,7 +1118,7 @@ NtMapViewOfSection(
|
||||
_In_ ULONG PageProtection
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE5)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS5)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1143,7 +1143,7 @@ NtUnmapViewOfSection(
|
||||
_In_opt_ PVOID BaseAddress
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1332,7 +1332,7 @@ typedef struct _MEMORY_PARTITION_MEMORY_EVENTS_INFORMATION
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -1400,7 +1400,7 @@ NtAllocateUserPhysicalPages(
|
||||
_Out_writes_(*NumberOfPages) PULONG_PTR UserPfnArray
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -1506,7 +1506,7 @@ NtFlushWriteBuffer(
|
||||
// Enclave support
|
||||
//
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
|
||||
@@ -214,7 +214,7 @@ NtWaitForMultipleObjects(
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WS03)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -254,7 +254,7 @@ NtClose(
|
||||
_In_ _Post_ptr_invalid_ HANDLE Handle
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -279,7 +279,7 @@ NtCreateDirectoryObject(
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -369,7 +369,7 @@ typedef struct _OBJECT_BOUNDARY_DESCRIPTOR
|
||||
//OBJECT_BOUNDARY_ENTRY Entries[1];
|
||||
} OBJECT_BOUNDARY_DESCRIPTOR, *POBJECT_BOUNDARY_DESCRIPTOR;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -441,7 +441,7 @@ typedef enum _SYMBOLIC_LINK_INFO_CLASS
|
||||
MaxnSymbolicLinkInfoClass
|
||||
} SYMBOLIC_LINK_INFO_CLASS;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
||||
+12
-12
@@ -792,17 +792,17 @@ typedef struct _PEB
|
||||
} PEB, * PPEB;
|
||||
|
||||
#ifdef _WIN64
|
||||
static_assert(FIELD_OFFSET(PEB, SessionId) == 0x2C0);
|
||||
//static_assert(sizeof(PEB) == 0x7B0); // REDSTONE3
|
||||
//static_assert(sizeof(PEB) == 0x7B8); // REDSTONE4
|
||||
//static_assert(sizeof(PEB) == 0x7C8); // REDSTONE5 // 19H1
|
||||
static_assert(sizeof(PEB) == 0x7d0); // WIN11
|
||||
static_assert(FIELD_OFFSET(PEB, SessionId) == 0x2C0, "FIELD_OFFSET(PEB, SessionId) is incorrect");
|
||||
//static_assert(sizeof(PEB) == 0x7B0, "Size of PEB is incorrect"); // REDSTONE3
|
||||
//static_assert(sizeof(PEB) == 0x7B8, "Size of PEB is incorrect"); // REDSTONE4
|
||||
//static_assert(sizeof(PEB) == 0x7C8, "Size of PEB is incorrect"); // REDSTONE5 // 19H1
|
||||
static_assert(sizeof(PEB) == 0x7d0, "Size of PEB is incorrect"); // WIN11
|
||||
#else
|
||||
static_assert(FIELD_OFFSET(PEB, SessionId) == 0x1D4);
|
||||
//static_assert(sizeof(PEB) == 0x468); // REDSTONE3
|
||||
//static_assert(sizeof(PEB) == 0x470); // REDSTONE4
|
||||
//static_assert(sizeof(PEB) == 0x480); // REDSTONE5 // 19H1
|
||||
static_assert(sizeof(PEB) == 0x488); // WIN11
|
||||
static_assert(FIELD_OFFSET(PEB, SessionId) == 0x1D4, "FIELD_OFFSET(PEB, SessionId) is incorrect");
|
||||
//static_assert(sizeof(PEB) == 0x468, "Size of PEB is incorrect"); // REDSTONE3
|
||||
//static_assert(sizeof(PEB) == 0x470, "Size of PEB is incorrect"); // REDSTONE4
|
||||
//static_assert(sizeof(PEB) == 0x480, "Size of PEB is incorrect"); // REDSTONE5 // 19H1
|
||||
static_assert(sizeof(PEB) == 0x488, "Size of PEB is incorrect"); // WIN11
|
||||
#endif
|
||||
|
||||
#define GDI_BATCH_BUFFER_SIZE 310
|
||||
@@ -1278,10 +1278,10 @@ typedef struct _TEB
|
||||
} TEB, *PTEB;
|
||||
|
||||
#ifdef _WIN64
|
||||
//static_assert(sizeof(TEB) == 0x1850); // WIN11
|
||||
//static_assert(sizeof(TEB) == 0x1850, "Size of TEB is incorrect"); // WIN11
|
||||
static_assert(sizeof(TEB) == 0x1878, "Size of TEB is incorrect"); // 24H2
|
||||
#else
|
||||
//static_assert(sizeof(TEB) == 0x1018); // WIN11
|
||||
//static_assert(sizeof(TEB) == 0x1018, "Size of TEB is incorrect"); // WIN11
|
||||
static_assert(sizeof(TEB) == 0x1038, "Size of TEB is incorrect"); // 24H2
|
||||
#endif
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE
|
||||
DeviceUsageTypeGuestAssigned
|
||||
} DEVICE_USAGE_NOTIFICATION_TYPE, *PDEVICE_USAGE_NOTIFICATION_TYPE;
|
||||
|
||||
#if (PHNT_VERSION < PHNT_WIN8)
|
||||
#if (PHNT_VERSION < PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -170,7 +170,7 @@ NtPlugPlayControl(
|
||||
_In_ ULONG PnPControlDataLength
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -195,7 +195,7 @@ NtDisableLastKnownGood(
|
||||
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
||||
@@ -545,7 +545,7 @@ typedef struct _POWER_REQUEST
|
||||
ULONG PowerRequestCount[POWER_REQUEST_SUPPORTED_TYPES_V1];
|
||||
DIAGNOSTIC_BUFFER DiagnosticBuffer;
|
||||
} V1;
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
struct
|
||||
{
|
||||
ULONG SupportedRequestMask;
|
||||
@@ -553,7 +553,7 @@ typedef struct _POWER_REQUEST
|
||||
DIAGNOSTIC_BUFFER DiagnosticBuffer;
|
||||
} V2;
|
||||
#endif
|
||||
#if (PHNT_VERSION >= PHNT_WINBLUE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8_1)
|
||||
struct
|
||||
{
|
||||
ULONG SupportedRequestMask;
|
||||
@@ -561,7 +561,7 @@ typedef struct _POWER_REQUEST
|
||||
DIAGNOSTIC_BUFFER DiagnosticBuffer;
|
||||
} V3;
|
||||
#endif
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
struct
|
||||
{
|
||||
ULONG SupportedRequestMask;
|
||||
@@ -917,7 +917,7 @@ NtSetThreadExecutionState(
|
||||
_Out_ EXECUTION_STATE *PreviousFlags
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION < PHNT_WIN7)
|
||||
#if (PHNT_VERSION < PHNT_WINDOWS_7)
|
||||
/**
|
||||
* Requests the system resume latency.
|
||||
*
|
||||
|
||||
+20
-18
@@ -59,7 +59,7 @@
|
||||
#define PROCESS_SET_LIMITED_INFORMATION 0x2000
|
||||
#endif
|
||||
#ifndef PROCESS_ALL_ACCESS
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | SPECIFIC_RIGHTS_ALL)
|
||||
#else
|
||||
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF)
|
||||
@@ -110,7 +110,7 @@
|
||||
#define THREAD_RESUME 0x1000
|
||||
#endif
|
||||
#ifndef THREAD_ALL_ACCESS
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | SPECIFIC_RIGHTS_ALL)
|
||||
#else
|
||||
#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF)
|
||||
@@ -137,7 +137,7 @@
|
||||
#define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 0x0010
|
||||
#endif
|
||||
#ifndef JOB_OBJECT_ALL_ACCESS
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3F)
|
||||
#else
|
||||
#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1f) // pre-Vista full access
|
||||
@@ -1256,9 +1256,11 @@ typedef struct _PROCESS_CHILD_PROCESS_INFORMATION
|
||||
} PROCESS_CHILD_PROCESS_INFORMATION, *PPROCESS_CHILD_PROCESS_INFORMATION;
|
||||
|
||||
#define POWER_THROTTLING_PROCESS_CURRENT_VERSION 1
|
||||
|
||||
#define POWER_THROTTLING_PROCESS_EXECUTION_SPEED 0x1
|
||||
#define POWER_THROTTLING_PROCESS_DELAYTIMERS 0x2
|
||||
#define POWER_THROTTLING_PROCESS_IGNORE_TIMER_RESOLUTION 0x4 // since WIN11
|
||||
|
||||
#define POWER_THROTTLING_PROCESS_VALID_FLAGS \
|
||||
((POWER_THROTTLING_PROCESS_EXECUTION_SPEED | POWER_THROTTLING_PROCESS_DELAYTIMERS | POWER_THROTTLING_PROCESS_IGNORE_TIMER_RESOLUTION))
|
||||
|
||||
@@ -2013,7 +2015,7 @@ NtSetInformationProcess(
|
||||
|
||||
#define PROCESS_GET_NEXT_FLAGS_PREVIOUS_PROCESS 0x00000001
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WS03)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
/**
|
||||
* Retrieves a handle to the next process in the system.
|
||||
*
|
||||
@@ -2072,7 +2074,7 @@ typedef enum _PROCESS_STATE_CHANGE_TYPE
|
||||
ProcessStateChangeMax,
|
||||
} PROCESS_STATE_CHANGE_TYPE, *PPROCESS_STATE_CHANGE_TYPE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
/**
|
||||
* Creates a state change handle for changing the suspension state of a process.
|
||||
*
|
||||
@@ -2125,7 +2127,7 @@ typedef enum _THREAD_STATE_CHANGE_TYPE
|
||||
ThreadStateChangeMax,
|
||||
} THREAD_STATE_CHANGE_TYPE, *PTHREAD_STATE_CHANGE_TYPE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
/**
|
||||
* Creates a state change handle for changing the suspension state of a thread.
|
||||
*
|
||||
@@ -2267,7 +2269,7 @@ NtResumeThread(
|
||||
_Out_opt_ PULONG PreviousSuspendCount
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WS03)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
/**
|
||||
* Retrieves the number of the current processor.
|
||||
*
|
||||
@@ -2281,7 +2283,7 @@ NtGetCurrentProcessorNumber(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
/**
|
||||
* Retrieves the number of the current processor.
|
||||
*
|
||||
@@ -2405,7 +2407,7 @@ NtTestAlert(
|
||||
VOID
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
// rev
|
||||
/**
|
||||
* Sends an alert to the specified thread.
|
||||
@@ -2421,7 +2423,7 @@ NtAlertThreadByThreadId(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
/**
|
||||
* Sends an alert to the specified thread by its thread ID, with an optional lock.
|
||||
*
|
||||
@@ -2457,7 +2459,7 @@ NtAlertMultipleThreadByThreadId(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
// rev
|
||||
/**
|
||||
* Waits for an alert to be delivered to the specified thread.
|
||||
@@ -2603,7 +2605,7 @@ NtQueueApcThread(
|
||||
*/
|
||||
#define QUEUE_USER_APC_SPECIAL_USER_APC ((HANDLE)0x1)
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
/**
|
||||
* Queues an APC (Asynchronous Procedure Call) to a thread.
|
||||
*
|
||||
@@ -2645,7 +2647,7 @@ typedef struct _APC_CALLBACK_DATA_CONTEXT
|
||||
#define QUEUE_USER_APC_FLAGS_SPECIAL_USER_APC 0x00000001
|
||||
#define QUEUE_USER_APC_FLAGS_CALLBACK_DATA_CONTEXT 0x00010000 // APC_CALLBACK_DATA_CONTEXT
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN11)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
|
||||
/**
|
||||
* Queues an Asynchronous Procedure Call (APC) to a specified thread.
|
||||
*
|
||||
@@ -3197,7 +3199,7 @@ typedef struct _PS_CREATE_INFO
|
||||
|
||||
// end_private
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* Creates a new process and primary thread.
|
||||
*
|
||||
@@ -3679,7 +3681,7 @@ NtCreateJobSet(
|
||||
_In_ ULONG Flags
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -3704,7 +3706,7 @@ typedef enum _MEMORY_RESERVE_TYPE
|
||||
MemoryReserveTypeMax
|
||||
} MEMORY_RESERVE_TYPE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
/**
|
||||
* Allocates a memory reserve object.
|
||||
*
|
||||
@@ -3777,7 +3779,7 @@ typedef enum _PSSNT_QUERY_INFORMATION_CLASS
|
||||
|
||||
#define PSSNT_SIGNATURE_PSSD 'PSSD' // 0x50535344
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINBLUE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8_1)
|
||||
// rev
|
||||
/**
|
||||
* Captures a snapshot of the specified process.
|
||||
@@ -3888,7 +3890,7 @@ typedef struct _NTPSS_MEMORY_BULK_INFORMATION
|
||||
PVOID NextValidAddress;
|
||||
} NTPSS_MEMORY_BULK_INFORMATION, *PNTPSS_MEMORY_BULK_INFORMATION;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_20H1)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_20H1)
|
||||
// rev
|
||||
/**
|
||||
* Captures virtual address space bulk information for a process.
|
||||
|
||||
+13
-13
@@ -609,7 +609,7 @@ NtCreateKey(
|
||||
_Out_opt_ PULONG Disposition
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* Creates a new registry key or opens an existing one, and it associates the key with a transaction.
|
||||
*
|
||||
@@ -656,7 +656,7 @@ NtOpenKey(
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* Opens an existing registry key and associates the key with a transaction.
|
||||
*
|
||||
@@ -677,7 +677,7 @@ NtOpenKeyTransacted(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
/**
|
||||
* Opens an existing registry key with extended options.
|
||||
*
|
||||
@@ -990,7 +990,7 @@ NtLoadKey2(
|
||||
_In_ ULONG Flags
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WS03)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
/**
|
||||
* Loads a registry key from a file with extended options.
|
||||
*
|
||||
@@ -1019,7 +1019,7 @@ NtLoadKeyEx(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_20H1)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_20H1)
|
||||
// rev by tyranid
|
||||
/**
|
||||
* Loads a registry key from a file with extended parameters.
|
||||
@@ -1145,7 +1145,7 @@ NtUnloadKey(
|
||||
_In_ POBJECT_ATTRIBUTES TargetKey
|
||||
);
|
||||
|
||||
#if PHNT_VERSION >= PHNT_WS03
|
||||
#if PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003
|
||||
/**
|
||||
* Unloads a registry key with additional flags.
|
||||
*
|
||||
@@ -1259,7 +1259,7 @@ NtQueryOpenSubKeys(
|
||||
_Out_ PULONG HandleCount
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WS03)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_SERVER_2003)
|
||||
/**
|
||||
* Queries the open subkeys of a registry key with additional information.
|
||||
*
|
||||
@@ -1322,7 +1322,7 @@ NtLockProductActivationKeys(
|
||||
_Out_opt_ ULONG *pSafeMode
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* Freezes the registry and prevents changes from being flushed to disk.
|
||||
*
|
||||
@@ -1337,7 +1337,7 @@ NtFreezeRegistry(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
/**
|
||||
* Thaws the registry and enables flushing changes to disk.
|
||||
*
|
||||
@@ -1351,7 +1351,7 @@ NtThawRegistry(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
/**
|
||||
* Creates a registry transaction.
|
||||
*
|
||||
@@ -1369,7 +1369,7 @@ NTSTATUS NtCreateRegistryTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
/**
|
||||
* Opens a registry transaction.
|
||||
*
|
||||
@@ -1385,7 +1385,7 @@ NTSTATUS NtOpenRegistryTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
/**
|
||||
* Commits a registry transaction.
|
||||
*
|
||||
@@ -1399,7 +1399,7 @@ NTSTATUS NtCommitRegistryTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
/**
|
||||
* Rolls back a registry transaction.
|
||||
*
|
||||
|
||||
+387
-329
File diff suppressed because it is too large
Load Diff
@@ -339,7 +339,7 @@ NtCreateToken(
|
||||
_In_ PTOKEN_SOURCE Source
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -356,7 +356,7 @@ NtCreateLowBoxToken(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -565,7 +565,7 @@ NtAdjustGroupsToken(
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -601,7 +601,7 @@ NtFilterToken(
|
||||
_Out_ PHANDLE NewTokenHandle
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -648,7 +648,7 @@ NtImpersonateAnonymousToken(
|
||||
_In_ HANDLE ThreadHandle
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -715,7 +715,7 @@ NtAccessCheckByTypeResultList(
|
||||
|
||||
// Signing
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -757,7 +757,7 @@ typedef struct _SE_SET_FILE_CACHE_INFORMATION
|
||||
SE_FILE_CACHE_CLAIM_INFORMATION OriginClaimInfo;
|
||||
} SE_SET_FILE_CACHE_INFORMATION, *PSE_SET_FILE_CACHE_INFORMATION;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
@@ -774,7 +774,7 @@ NtSetCachedSigningLevel2(
|
||||
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE2)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS2)
|
||||
|
||||
// rev
|
||||
NTSYSCALLAPI
|
||||
|
||||
+40
-40
@@ -7,7 +7,7 @@
|
||||
#ifndef _NTTMAPI_H
|
||||
#define _NTTMAPI_H
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -21,7 +21,7 @@ NtCreateTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -35,7 +35,7 @@ NtOpenTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -45,7 +45,7 @@ NtRenameTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -55,7 +55,7 @@ NtRollforwardTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -64,7 +64,7 @@ NtRecoverTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -77,7 +77,7 @@ NtQueryInformationTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -89,7 +89,7 @@ NtSetInformationTransactionManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -102,7 +102,7 @@ NtEnumerateTransactionObject(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -120,7 +120,7 @@ NtCreateTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -133,7 +133,7 @@ NtOpenTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -146,7 +146,7 @@ NtQueryInformationTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -158,7 +158,7 @@ NtSetInformationTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -168,7 +168,7 @@ NtCommitTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -178,7 +178,7 @@ NtRollbackTransaction(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -194,7 +194,7 @@ NtCreateEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -207,7 +207,7 @@ NtOpenEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -220,7 +220,7 @@ NtQueryInformationEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -232,7 +232,7 @@ NtSetInformationEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -242,7 +242,7 @@ NtRecoverEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -252,7 +252,7 @@ NtPrePrepareEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -262,7 +262,7 @@ NtPrepareEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -272,7 +272,7 @@ NtCommitEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -282,7 +282,7 @@ NtRollbackEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -292,7 +292,7 @@ NtPrePrepareComplete(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -302,7 +302,7 @@ NtPrepareComplete(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -312,7 +312,7 @@ NtCommitComplete(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -322,7 +322,7 @@ NtReadOnlyEnlistment(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -332,7 +332,7 @@ NtRollbackComplete(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -342,7 +342,7 @@ NtSinglePhaseReject(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -357,7 +357,7 @@ NtCreateResourceManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -370,7 +370,7 @@ NtOpenResourceManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -379,7 +379,7 @@ NtRecoverResourceManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -394,7 +394,7 @@ NtGetNotificationResourceManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -407,7 +407,7 @@ NtQueryInformationResourceManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -419,7 +419,7 @@ NtSetInformationResourceManager(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -432,7 +432,7 @@ NtRegisterProtocolAddressInformation(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -444,7 +444,7 @@ NtPropagationComplete(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -455,7 +455,7 @@ NtPropagationFailed(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -466,7 +466,7 @@ NtFreezeTransactions(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
// private
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
|
||||
+5
-5
@@ -26,7 +26,7 @@ typedef VOID (NTAPI *PTP_ALPC_CALLBACK_EX)(
|
||||
_In_ PVOID ApcContext
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
// winbase:CreateThreadpool
|
||||
NTSYSAPI
|
||||
@@ -63,7 +63,7 @@ TpSetPoolMinThreads(
|
||||
_In_ ULONG MinThreads
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// winbase:QueryThreadpoolStackInformation
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -256,7 +256,7 @@ TpSetTimer(
|
||||
_In_opt_ ULONG WindowLength
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
// winbase:SetThreadpoolTimerEx
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -315,7 +315,7 @@ TpSetWait(
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN8)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
|
||||
// winbase:SetThreadpoolWaitEx
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
@@ -403,7 +403,7 @@ TpAllocAlpcCompletion(
|
||||
_In_opt_ PTP_CALLBACK_ENVIRON CallbackEnviron
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WIN7)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_7)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
|
||||
@@ -5968,7 +5968,7 @@ typedef enum _ETWTRACECONTROLCODE
|
||||
EtwGetPmcSessions = 46,
|
||||
} ETWTRACECONTROLCODE;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -5982,7 +5982,7 @@ NtTraceControl(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_WINXP)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_XP)
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
@@ -6003,7 +6003,7 @@ typedef struct _TELEMETRY_COVERAGE_POINT
|
||||
ULONG Flags;
|
||||
} TELEMETRY_COVERAGE_POINT, *PTELEMETRY_COVERAGE_POINT;
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE3)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS3)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
BOOLEAN
|
||||
|
||||
+28
-23
@@ -7,6 +7,8 @@
|
||||
#ifndef _NTWOW64_H
|
||||
#define _NTWOW64_H
|
||||
|
||||
#include <ntxcapi.h>
|
||||
|
||||
#define WOW64_SYSTEM_DIRECTORY "SysWOW64"
|
||||
#define WOW64_SYSTEM_DIRECTORY_U L"SysWOW64"
|
||||
#define WOW64_X86_TAG " (x86)"
|
||||
@@ -415,12 +417,13 @@ typedef struct _PEB32
|
||||
ULONGLONG ExtendedFeatureDisableMask; // since WIN11
|
||||
} PEB32, *PPEB32;
|
||||
|
||||
//C_ASSERT(sizeof(PEB32) == 0x460); // REDSTONE3
|
||||
//C_ASSERT(sizeof(PEB32) == 0x470); // REDSTONE5
|
||||
C_ASSERT(sizeof(PEB32) == 0x488); // WIN11
|
||||
//static_assert(sizeof(PEB32) == 0x460, "sizeof(PEB32) is incorrect"); // REDSTONE3
|
||||
//static_assert(sizeof(PEB32) == 0x470, "sizeof(PEB32) is incorrect"); // REDSTONE5
|
||||
static_assert(sizeof(PEB32) == 0x488, "sizeof(PEB32) is incorrect"); // WIN11
|
||||
|
||||
// Note: Use PhGetProcessPeb32 instead. (dmex)
|
||||
//#define WOW64_GET_PEB32(peb64) ((PPEB32)PTR_ADD_OFFSET((peb64), ALIGN_UP_BY(sizeof(PEB), PAGE_SIZE)))
|
||||
//#define WOW64_GET_PEB32(peb64) \
|
||||
// ((PPEB32)RtlOffsetToPointer((peb64), ALIGN_UP_BY(sizeof(PEB), PAGE_SIZE)))
|
||||
|
||||
#define GDI_BATCH_BUFFER_SIZE 310
|
||||
|
||||
@@ -577,21 +580,15 @@ typedef struct _TEB32
|
||||
GUID EffectiveContainerId;
|
||||
} TEB32, *PTEB32;
|
||||
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, ProcessEnvironmentBlock) == 0x030);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, ExceptionCode) == 0x1a4);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, TxFsContext) == 0x1d0);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, glContext) == 0xbf0);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, StaticUnicodeBuffer) == 0xc00);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, TlsLinks) == 0xf10);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, DbgSsReserved) == 0xf20);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, ActivityId) == 0xf50);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, GdiBatchCount) == 0xf70);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, TlsExpansionSlots) == 0xf94);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, FlsData) == 0xfb4);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, MuiImpersonation) == 0xfc4);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, ReservedForCrt) == 0xfe8);
|
||||
C_ASSERT(FIELD_OFFSET(TEB32, EffectiveContainerId) == 0xff0);
|
||||
C_ASSERT(sizeof(TEB32) == 0x1000);
|
||||
static_assert(FIELD_OFFSET(TEB32, ProcessEnvironmentBlock) == 0x030, "FIELD_OFFSET(TEB32, ProcessEnvironmentBlock) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, ExceptionCode) == 0x1a4, "FIELD_OFFSET(TEB32, ExceptionCode) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, StaticUnicodeBuffer) == 0xc00, "FIELD_OFFSET(TEB32, StaticUnicodeBuffer) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, TlsLinks) == 0xf10, "FIELD_OFFSET(TEB32, TlsLinks) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, TlsExpansionSlots) == 0xf94, "FIELD_OFFSET(TEB32, TlsExpansionSlots) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, FlsData) == 0xfb4, "FIELD_OFFSET(TEB32, FlsData) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, MuiImpersonation) == 0xfc4, "FIELD_OFFSET(TEB32, MuiImpersonation) is incorrect");
|
||||
static_assert(FIELD_OFFSET(TEB32, EffectiveContainerId) == 0xff0, "FIELD_OFFSET(TEB32, EffectiveContainerId) is incorrect");
|
||||
static_assert(sizeof(TEB32) == 0x1000, "sizeof(TEB32) is incorrect");
|
||||
|
||||
// Conversion
|
||||
|
||||
@@ -648,6 +645,9 @@ FORCEINLINE VOID UStrToUStr32(
|
||||
#define WOW64_GET_TEB32(teb64) ((PTEB32)(((ULONG_PTR)(teb64)) + ((ULONG_PTR)WOW64_ROUND_TO_PAGES(sizeof(TEB)))))
|
||||
#define WOW64_TEB32_POINTER_ADDRESS(teb64) ((PVOID)&(((PTEB)(teb64))->NtTib.ExceptionList))
|
||||
|
||||
//
|
||||
// Get the 32-bit execute options.
|
||||
//
|
||||
typedef union _WOW64_EXECUTE_OPTIONS
|
||||
{
|
||||
ULONG Flags;
|
||||
@@ -711,13 +711,14 @@ Wow64CurrentGuestTeb(
|
||||
if (Teb->WowTebOffset < 0)
|
||||
{
|
||||
//
|
||||
// Was called while running under WoW. The current teb is the guest
|
||||
// teb.
|
||||
// Was called while running under WoW. The current teb is the guest teb.
|
||||
//
|
||||
|
||||
Teb32 = (PTEB32)Teb;
|
||||
|
||||
#if defined(RTL_ASSERT)
|
||||
RTL_ASSERT(&Teb32->WowTebOffset == &Teb->WowTebOffset);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -729,7 +730,9 @@ Wow64CurrentGuestTeb(
|
||||
Teb32 = (PTEB32)RtlOffsetToPointer(Teb, Teb->WowTebOffset);
|
||||
}
|
||||
|
||||
#if defined(RTL_ASSERT)
|
||||
RTL_ASSERT(Teb32->NtTib.Self == PtrToUlong(Teb32));
|
||||
#endif
|
||||
|
||||
return Teb32;
|
||||
}
|
||||
@@ -765,7 +768,9 @@ Wow64CurrentNativeTeb(
|
||||
HostTeb = (PVOID)RtlOffsetToPointer(Teb, Teb->WowTebOffset);
|
||||
}
|
||||
|
||||
#if defined(RTL_ASSERT)
|
||||
RTL_ASSERT((((PTEB32)HostTeb)->NtTib.Self == PtrToUlong(HostTeb)) || ((ULONG_PTR)((PTEB)HostTeb)->NtTib.Self == (ULONG_PTR)HostTeb));
|
||||
#endif
|
||||
|
||||
return HostTeb;
|
||||
}
|
||||
@@ -776,7 +781,7 @@ Wow64CurrentNativeTeb(
|
||||
#define Wow64GetNativeTebField(teb, field) (((ULONG)(teb) == ((PTEB32)(teb))->NtTib.Self) ? (((PTEB32)(teb))->##field) : (((PTEB)(teb))->##field) )
|
||||
#define Wow64SetNativeTebField(teb, field, value) { if ((ULONG)(teb) == ((PTEB32)(teb))->NtTib.Self) {(((PTEB32)(teb))->##field) = (value);} else {(((PTEB)(teb))->##field) = (value);} }
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // _M_X64
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,7 @@ RtlRaiseException(
|
||||
_In_ PEXCEPTION_RECORD ExceptionRecord
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_20H1)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_20H1)
|
||||
// rev
|
||||
NTSYSAPI
|
||||
VOID
|
||||
@@ -50,7 +50,7 @@ RtlRaiseNoncontinuableException(
|
||||
_In_ PEXCEPTION_RECORD ExceptionRecord,
|
||||
_In_ PCONTEXT ContextRecord
|
||||
);
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_10_20H1
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -60,7 +60,7 @@ NtContinue(
|
||||
_In_ BOOLEAN TestAlert
|
||||
);
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
typedef enum _KCONTINUE_TYPE
|
||||
{
|
||||
KCONTINUE_UNWIND,
|
||||
@@ -97,7 +97,7 @@ NtContinueEx(
|
||||
//{
|
||||
// return NtContinueEx(ContextRecord, (PCONTINUE_ARGUMENT)TestAlert);
|
||||
//}
|
||||
#endif
|
||||
#endif // PHNT_VERSION >= PHNT_WINDOWS_10
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
@@ -109,7 +109,7 @@ NtRaiseException(
|
||||
);
|
||||
|
||||
_Analysis_noreturn_
|
||||
NTSYSCALLAPI
|
||||
NTSYSAPI
|
||||
DECLSPEC_NORETURN
|
||||
VOID
|
||||
NTAPI
|
||||
|
||||
+44
-42
@@ -30,57 +30,60 @@
|
||||
#define PHNT_MODE_USER 1
|
||||
|
||||
// Version
|
||||
#define PHNT_WIN2K 50
|
||||
#define PHNT_WINXP 51
|
||||
#define PHNT_WS03 52
|
||||
#define PHNT_VISTA 60
|
||||
#define PHNT_WIN7 61
|
||||
#define PHNT_WIN8 62
|
||||
#define PHNT_WINBLUE 63
|
||||
#define PHNT_THRESHOLD 100
|
||||
#define PHNT_THRESHOLD2 101
|
||||
#define PHNT_REDSTONE 102
|
||||
#define PHNT_REDSTONE2 103
|
||||
#define PHNT_REDSTONE3 104
|
||||
#define PHNT_REDSTONE4 105
|
||||
#define PHNT_REDSTONE5 106
|
||||
#define PHNT_19H1 107
|
||||
#define PHNT_19H2 108
|
||||
#define PHNT_20H1 109
|
||||
#define PHNT_20H2 110
|
||||
#define PHNT_21H1 111
|
||||
#define PHNT_WIN10_21H2 112
|
||||
#define PHNT_WIN10_22H2 113
|
||||
#define PHNT_WIN11 114
|
||||
#define PHNT_WIN11_22H2 115
|
||||
#define PHNT_WIN11_23H2 116
|
||||
#define PHNT_WIN11_24H2 117
|
||||
#define PHNT_WINDOWS_ANCIENT 0
|
||||
#define PHNT_WINDOWS_XP 51 // August, 2001
|
||||
#define PHNT_WINDOWS_SERVER_2003 52 // April, 2003
|
||||
#define PHNT_WINDOWS_VISTA 60 // November, 2006
|
||||
#define PHNT_WINDOWS_7 61 // July, 2009
|
||||
#define PHNT_WINDOWS_8 62 // August, 2012
|
||||
#define PHNT_WINDOWS_8_1 63 // August, 2013
|
||||
#define PHNT_WINDOWS_10 100 // July, 2015 // Version 1507, Build 10240
|
||||
#define PHNT_WINDOWS_10_TH2 101 // November, 2015 // Version 1511, Build 10586
|
||||
#define PHNT_WINDOWS_10_RS1 102 // August, 2016 // Version 1607, Build 14393
|
||||
#define PHNT_WINDOWS_10_RS2 103 // April, 2017 // Version 1703, Build 15063
|
||||
#define PHNT_WINDOWS_10_RS3 104 // October, 2017 // Version 1709, Build 16299
|
||||
#define PHNT_WINDOWS_10_RS4 105 // April, 2018 // Version 1803, Build 17134
|
||||
#define PHNT_WINDOWS_10_RS5 106 // November, 2018 // Version 1809, Build 17763
|
||||
#define PHNT_WINDOWS_10_19H1 107 // May, 2019 // Version 1903, Build 18362
|
||||
#define PHNT_WINDOWS_10_19H2 108 // November, 2019 // Version 1909, Build 18363
|
||||
#define PHNT_WINDOWS_10_20H1 109 // May, 2020 // Version 2004, Build 19041
|
||||
#define PHNT_WINDOWS_10_20H2 110 // October, 2020 // Build 19042
|
||||
#define PHNT_WINDOWS_10_21H1 111 // May, 2021 // Build 19043
|
||||
#define PHNT_WINDOWS_10_21H2 112 // November, 2021 // Build 19044
|
||||
#define PHNT_WINDOWS_10_22H2 113 // October, 2022 // Build 19045
|
||||
#define PHNT_WINDOWS_11 114 // October, 2021 // Build 22000
|
||||
#define PHNT_WINDOWS_11_22H2 115 // September, 2022 // Build 22621
|
||||
#define PHNT_WINDOWS_11_23H2 116 // October, 2023 // Build 22631
|
||||
#define PHNT_WINDOWS_11_24H2 117 // October, 2024 // Build 26100
|
||||
#define PHNT_WINDOWS_NEW ULONG_MAX
|
||||
|
||||
#ifndef PHNT_MODE
|
||||
#define PHNT_MODE PHNT_MODE_USER
|
||||
#endif
|
||||
|
||||
#ifndef PHNT_VERSION
|
||||
#define PHNT_VERSION PHNT_WIN11_24H2
|
||||
#define PHNT_VERSION PHNT_WINDOWS_NEW
|
||||
#endif
|
||||
|
||||
//
|
||||
// Options
|
||||
//
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
//#ifndef PHNT_NO_INLINE_INIT_STRING
|
||||
//#define PHNT_NO_INLINE_INIT_STRING
|
||||
//#endif // !PHNT_NO_INLINE_INIT_STRING
|
||||
#ifndef PHNT_INLINE_TYPEDEFS
|
||||
#define PHNT_INLINE_TYPEDEFS
|
||||
#endif
|
||||
#endif
|
||||
#endif // !PHNT_INLINE_TYPEDEFS
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
EXTERN_C_START
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
#include <phnt_ntdef.h>
|
||||
#include <ntnls.h>
|
||||
#endif
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#include <ntkeapi.h>
|
||||
#include <ntldr.h>
|
||||
@@ -93,29 +96,28 @@ extern "C" {
|
||||
|
||||
#if (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
#include <ntdbg.h>
|
||||
#include <ntimage.h>
|
||||
#include <ntioapi.h>
|
||||
#include <ntlsa.h>
|
||||
#include <ntlpcapi.h>
|
||||
#include <ntmisc.h>
|
||||
#include <ntpfapi.h>
|
||||
#include <ntpnpapi.h>
|
||||
#include <ntpoapi.h>
|
||||
#include <ntregapi.h>
|
||||
#include <ntrtl.h>
|
||||
#include <ntimage.h>
|
||||
#include <ntsam.h>
|
||||
#include <ntseapi.h>
|
||||
#include <nttmapi.h>
|
||||
#include <nttp.h>
|
||||
#include <ntxcapi.h>
|
||||
#include <ntwow64.h>
|
||||
#include <ntlsa.h>
|
||||
#include <ntsam.h>
|
||||
#include <ntmisc.h>
|
||||
#include <ntuser.h>
|
||||
#include <ntwmi.h>
|
||||
#include <ntwow64.h>
|
||||
#include <ntxcapi.h>
|
||||
#include <ntzwapi.h>
|
||||
#endif
|
||||
#endif // (PHNT_MODE != PHNT_MODE_KERNEL)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EXTERN_C_END
|
||||
|
||||
static_assert(__alignof(LARGE_INTEGER) == 8, "Windows headers require the default packing option. Changing the packing can lead to memory corruption.");
|
||||
static_assert(__alignof(PROCESS_CYCLE_TIME_INFORMATION) == 8, "PHNT headers require the default packing option. Changing the packing can lead to memory corruption.");
|
||||
|
||||
@@ -23,14 +23,14 @@ typedef enum _TAG_TYPE
|
||||
|
||||
typedef struct _TAG_INFO_NAME_FROM_TAG_IN_PARAMS
|
||||
{
|
||||
ULONG dwPid;
|
||||
ULONG dwTag;
|
||||
ULONG ProcessId;
|
||||
ULONG ServiceTag;
|
||||
} TAG_INFO_NAME_FROM_TAG_IN_PARAMS, *PTAG_INFO_NAME_FROM_TAG_IN_PARAMS;
|
||||
|
||||
typedef struct _TAG_INFO_NAME_FROM_TAG_OUT_PARAMS
|
||||
{
|
||||
ULONG eTagType;
|
||||
PWSTR pszName;
|
||||
ULONG TagType;
|
||||
PCWSTR Name;
|
||||
} TAG_INFO_NAME_FROM_TAG_OUT_PARAMS, *PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS;
|
||||
|
||||
typedef struct _TAG_INFO_NAME_FROM_TAG
|
||||
@@ -41,14 +41,14 @@ typedef struct _TAG_INFO_NAME_FROM_TAG
|
||||
|
||||
typedef struct _TAG_INFO_NAMES_REFERENCING_MODULE_IN_PARAMS
|
||||
{
|
||||
ULONG dwPid;
|
||||
PCWSTR pszModule;
|
||||
ULONG ProcessId;
|
||||
PCWSTR ModuleName;
|
||||
} TAG_INFO_NAMES_REFERENCING_MODULE_IN_PARAMS, *PTAG_INFO_NAMES_REFERENCING_MODULE_IN_PARAMS;
|
||||
|
||||
typedef struct _TAG_INFO_NAMES_REFERENCING_MODULE_OUT_PARAMS
|
||||
{
|
||||
ULONG eTagType;
|
||||
PCWSTR pmszNames;
|
||||
ULONG TagType;
|
||||
PCWSTR Names;
|
||||
} TAG_INFO_NAMES_REFERENCING_MODULE_OUT_PARAMS, *PTAG_INFO_NAMES_REFERENCING_MODULE_OUT_PARAMS;
|
||||
|
||||
typedef struct _TAG_INFO_NAMES_REFERENCING_MODULE
|
||||
@@ -59,21 +59,21 @@ typedef struct _TAG_INFO_NAMES_REFERENCING_MODULE
|
||||
|
||||
typedef struct _TAG_INFO_NAME_TAG_MAPPING_IN_PARAMS
|
||||
{
|
||||
ULONG dwPid;
|
||||
ULONG ProcessId;
|
||||
} TAG_INFO_NAME_TAG_MAPPING_IN_PARAMS, *PTAG_INFO_NAME_TAG_MAPPING_IN_PARAMS;
|
||||
|
||||
typedef struct _TAG_INFO_NAME_TAG_MAPPING_ELEMENT
|
||||
{
|
||||
ULONG eTagType;
|
||||
ULONG dwTag;
|
||||
PWSTR pszName;
|
||||
PWSTR pszGroupName;
|
||||
ULONG TagType;
|
||||
ULONG Tag;
|
||||
PCWSTR Name;
|
||||
PCWSTR GroupName;
|
||||
} TAG_INFO_NAME_TAG_MAPPING_ELEMENT, *PTAG_INFO_NAME_TAG_MAPPING_ELEMENT;
|
||||
|
||||
typedef struct _TAG_INFO_NAME_TAG_MAPPING_OUT_PARAMS
|
||||
{
|
||||
ULONG cElements;
|
||||
PTAG_INFO_NAME_TAG_MAPPING_ELEMENT pNameTagMappingElements;
|
||||
ULONG Count;
|
||||
PTAG_INFO_NAME_TAG_MAPPING_ELEMENT NameTagMappingElements;
|
||||
} TAG_INFO_NAME_TAG_MAPPING_OUT_PARAMS, *PTAG_INFO_NAME_TAG_MAPPING_OUT_PARAMS;
|
||||
|
||||
typedef struct _TAG_INFO_NAME_TAG_MAPPING
|
||||
@@ -83,18 +83,21 @@ typedef struct _TAG_INFO_NAME_TAG_MAPPING
|
||||
} TAG_INFO_NAME_TAG_MAPPING, *PTAG_INFO_NAME_TAG_MAPPING;
|
||||
|
||||
_Must_inspect_result_
|
||||
NTSYSAPI
|
||||
ULONG
|
||||
WINAPI
|
||||
NTAPI
|
||||
I_QueryTagInformation(
|
||||
_In_opt_ PCWSTR MachineName,
|
||||
_In_ TAG_INFO_LEVEL InfoLevel,
|
||||
_Inout_ PVOID TagInfo
|
||||
);
|
||||
|
||||
typedef ULONG (WINAPI *PQUERY_TAG_INFORMATION)(
|
||||
typedef _Function_class_(QUERY_TAG_INFORMATION)
|
||||
ULONG NTAPI QUERY_TAG_INFORMATION(
|
||||
_In_opt_ PCWSTR MachineName,
|
||||
_In_ TAG_INFO_LEVEL InfoLevel,
|
||||
_Inout_ PVOID TagInfo
|
||||
);
|
||||
typedef QUERY_TAG_INFORMATION *PQUERY_TAG_INFORMATION;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct _CRED_PROV_CREDENTIAL
|
||||
|
||||
// Contexts
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
// rev
|
||||
USERMGRAPI
|
||||
@@ -78,7 +78,7 @@ UMgrQueryUserContextFromName(
|
||||
|
||||
// Tokens
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
// rev
|
||||
USERMGRAPI
|
||||
@@ -137,7 +137,7 @@ UMgrGetConstrainedUserToken(
|
||||
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD2)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_TH2)
|
||||
|
||||
// rev
|
||||
USERMGRAPI
|
||||
@@ -159,7 +159,7 @@ UMgrGetImpersonationTokenForContext(
|
||||
|
||||
#endif
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_REDSTONE)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10_RS1)
|
||||
|
||||
// rev
|
||||
USERMGRAPI
|
||||
@@ -174,7 +174,7 @@ UMgrGetSessionActiveShellUserToken(
|
||||
|
||||
// Single-session SKU
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
// rev
|
||||
USERMGRAPI
|
||||
@@ -199,7 +199,7 @@ UMgrOpenProcessHandleForAccess(
|
||||
|
||||
// Credentials
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_THRESHOLD)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_10)
|
||||
|
||||
// rev
|
||||
USERMGRAPI
|
||||
|
||||
@@ -1097,7 +1097,7 @@ WinStationGetProcessSid(
|
||||
|
||||
// Services isolation
|
||||
|
||||
#if (PHNT_VERSION >= PHNT_VISTA)
|
||||
#if (PHNT_VERSION >= PHNT_WINDOWS_VISTA)
|
||||
|
||||
// rev
|
||||
NTSYSAPI
|
||||
|
||||
@@ -278,7 +278,7 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
|
||||
if (diskEvent.Type != ULONG_MAX)
|
||||
{
|
||||
DiskIo_TypeGroup1* data = EventRecord->UserData;
|
||||
PETW_DISKIO_READWRITE_V3 data = EventRecord->UserData;
|
||||
|
||||
if (EtWindowsVersion >= WINDOWS_8)
|
||||
{
|
||||
@@ -308,8 +308,8 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
}
|
||||
|
||||
diskEvent.IrpFlags = data->IrpFlags;
|
||||
diskEvent.TransferSize = data->TransferSize;
|
||||
diskEvent.FileObject = (PVOID)data->FileObject;
|
||||
diskEvent.TransferSize = data->Size;
|
||||
diskEvent.FileObject = data->FileObject;
|
||||
diskEvent.HighResResponseTime = data->HighResResponseTime;
|
||||
|
||||
EtProcessDiskEvent(&diskEvent);
|
||||
@@ -345,16 +345,15 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
{
|
||||
if (EventRecord->EventHeader.EventDescriptor.Version == 2)
|
||||
{
|
||||
ULONG fileNameLength = (EventRecord->UserDataLength - UFIELD_OFFSET(FileIo_Name_Wow64, FileName)) - sizeof(UNICODE_NULL);
|
||||
FileIo_Name_Wow64* dataWow64 = EventRecord->UserData;
|
||||
PWMI_FILE_IO_WOW64 dataWow64 = EventRecord->UserData;
|
||||
|
||||
fileEvent.FileObject = (PVOID)dataWow64->FileObject;
|
||||
fileEvent.FileName.Length = fileNameLength;
|
||||
fileEvent.FileName.Length = (EventRecord->UserDataLength - UFIELD_OFFSET(WMI_FILE_IO_WOW64, FileName)) - sizeof(UNICODE_NULL);
|
||||
fileEvent.FileName.Buffer = dataWow64->FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
FileIo_Name_Wow64* dataWow64 = EventRecord->UserData;
|
||||
PWMI_FILE_IO_WOW64 dataWow64 = EventRecord->UserData;
|
||||
|
||||
fileEvent.FileObject = (PVOID)dataWow64->FileObject;
|
||||
PhInitializeStringRefLongHint(&fileEvent.FileName, dataWow64->FileName);
|
||||
@@ -364,18 +363,17 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
{
|
||||
if (EventRecord->EventHeader.EventDescriptor.Version == 2)
|
||||
{
|
||||
ULONG fileNameLength = (EventRecord->UserDataLength - UFIELD_OFFSET(FileIo_Name, FileName)) - sizeof(UNICODE_NULL);
|
||||
FileIo_Name* data = EventRecord->UserData;
|
||||
PWMI_FILE_IO data = EventRecord->UserData;
|
||||
|
||||
fileEvent.FileObject = (PVOID)data->FileObject;
|
||||
fileEvent.FileName.Length = fileNameLength;
|
||||
fileEvent.FileObject = data->FileObject;
|
||||
fileEvent.FileName.Length = (EventRecord->UserDataLength - UFIELD_OFFSET(WMI_FILE_IO, FileName)) - sizeof(UNICODE_NULL);
|
||||
fileEvent.FileName.Buffer = data->FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
FileIo_Name* data = EventRecord->UserData;
|
||||
PWMI_FILE_IO data = EventRecord->UserData;
|
||||
|
||||
fileEvent.FileObject = (PVOID)data->FileObject;
|
||||
fileEvent.FileObject = data->FileObject;
|
||||
PhInitializeStringRefLongHint(&fileEvent.FileName, data->FileName);
|
||||
}
|
||||
}
|
||||
@@ -389,23 +387,23 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
{
|
||||
case EVENT_TRACE_TYPE_SEND:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV4_Header* data = EventRecord->UserData;
|
||||
PWMI_TCPIP_V4 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
PH_IP_ENDPOINT destination;
|
||||
|
||||
source.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
source.Address.Ipv4 = data->saddr.s_addr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
destination.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
destination.Address.Ipv4 = data->daddr.s_addr;
|
||||
destination.Port = _byteswap_ushort(data->dport);
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
memcpy(&source.Address.InAddr, data->SourceAddress, sizeof(IN_ADDR));
|
||||
destination.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
destination.Port = _byteswap_ushort(data->DestinationPort);
|
||||
memcpy(&destination.Address.InAddr, data->DestinationAddress, sizeof(IN_ADDR));
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkSendType;
|
||||
networkEvent.ProtocolType = PH_TCP_PROTOCOL_TYPE | PH_IPV4_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_TCP | PH_NETWORK_TYPE_IPV4;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -414,23 +412,23 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
break;
|
||||
case EVENT_TRACE_TYPE_RECEIVE:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV4_Header* data = EventRecord->UserData;
|
||||
PWMI_TCPIP_V4 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
PH_IP_ENDPOINT destination;
|
||||
|
||||
source.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
source.Address.Ipv4 = data->saddr.s_addr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
destination.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
destination.Address.Ipv4 = data->daddr.s_addr;
|
||||
destination.Port = _byteswap_ushort(data->dport);
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
memcpy(source.Address.Ipv4, data->SourceAddress, sizeof(IN_ADDR));
|
||||
destination.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
destination.Port = _byteswap_ushort(data->DestinationPort);
|
||||
memcpy(destination.Address.Ipv4, data->DestinationAddress, sizeof(IN_ADDR));
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkReceiveType;
|
||||
networkEvent.ProtocolType = PH_TCP_PROTOCOL_TYPE | PH_IPV4_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_TCP | PH_NETWORK_TYPE_IPV4;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -439,23 +437,23 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
break;
|
||||
case EVENT_TRACE_TYPE_TCPIP_SEND_IPV6:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV6_Header* data = EventRecord->UserData;
|
||||
PWMI_TCPIP_V6 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
PH_IP_ENDPOINT destination;
|
||||
|
||||
source.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
source.Address.In6Addr = data->saddr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
destination.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
destination.Address.In6Addr = data->daddr;
|
||||
destination.Port = _byteswap_ushort(data->dport);
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
memcpy(source.Address.Ipv6, data->SourceAddress, sizeof(IN6_ADDR));
|
||||
destination.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
destination.Port = _byteswap_ushort(data->DestinationPort);
|
||||
memcpy(destination.Address.Ipv6, data->DestinationAddress, sizeof(IN6_ADDR));
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkSendType;
|
||||
networkEvent.ProtocolType = PH_TCP_PROTOCOL_TYPE | PH_IPV6_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_TCP | PH_NETWORK_TYPE_IPV6;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -464,23 +462,23 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
break;
|
||||
case EVENT_TRACE_TYPE_TCPIP_RECEIVE_IPV6:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV6_Header* data = EventRecord->UserData;
|
||||
PWMI_TCPIP_V6 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
PH_IP_ENDPOINT destination;
|
||||
|
||||
source.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
source.Address.In6Addr = data->saddr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
destination.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
destination.Address.In6Addr = data->daddr;
|
||||
destination.Port = _byteswap_ushort(data->dport);
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
memcpy(source.Address.Ipv6, data->SourceAddress, sizeof(IN6_ADDR));
|
||||
destination.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
destination.Port = _byteswap_ushort(data->DestinationPort);
|
||||
memcpy(destination.Address.Ipv6, data->DestinationAddress, sizeof(IN6_ADDR));
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkReceiveType;
|
||||
networkEvent.ProtocolType = PH_TCP_PROTOCOL_TYPE | PH_IPV6_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_TCP | PH_NETWORK_TYPE_IPV6;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -495,23 +493,23 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
{
|
||||
case EVENT_TRACE_TYPE_SEND:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV4_Header* data = EventRecord->UserData;
|
||||
PWMI_UDP_V4 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
//PH_IP_ENDPOINT destination;
|
||||
|
||||
source.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
source.Address.Ipv4 = data->saddr.s_addr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
//destination.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(source.Address.Ipv4, data->SourceAddress, sizeof(IN_ADDR));
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
//destination.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
//destination.Address.Ipv4 = data->daddr.s_addr;
|
||||
//destination.Port = _byteswap_ushort(data->dport);
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkSendType;
|
||||
networkEvent.ProtocolType = PH_UDP_PROTOCOL_TYPE | PH_IPV4_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_UDP | PH_NETWORK_TYPE_IPV4;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
//networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -520,25 +518,25 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
break;
|
||||
case EVENT_TRACE_TYPE_RECEIVE:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV4_Header* data = EventRecord->UserData;
|
||||
PWMI_UDP_V4 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
//PH_IP_ENDPOINT destination;
|
||||
|
||||
// Note: The endpoints are swapped for incoming UDP packets. The destination endpoint
|
||||
// corresponds to the local socket not the source endpoint. (DavidXanatos)
|
||||
source.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
source.Address.Ipv4 = data->daddr.s_addr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
//destination.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
memcpy(source.Address.Ipv4, data->DestinationAddress, sizeof(IN_ADDR));
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
//destination.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
//destination.Address.Ipv4 = data->saddr.s_addr;
|
||||
//destination.Port = _byteswap_ushort(data->dport);
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkReceiveType;
|
||||
networkEvent.ProtocolType = PH_UDP_PROTOCOL_TYPE | PH_IPV4_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_UDP | PH_NETWORK_TYPE_IPV4;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
//networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -547,23 +545,23 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
break;
|
||||
case EVENT_TRACE_TYPE_TCPIP_SEND_IPV6:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV6_Header* data = EventRecord->UserData;
|
||||
PWMI_UDP_V6 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
//PH_IP_ENDPOINT destination;
|
||||
|
||||
source.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
source.Address.In6Addr = data->saddr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
//destination.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(source.Address.Ipv6, data->SourceAddress, sizeof(IN6_ADDR));
|
||||
source.Port = _byteswap_ushort(data->SourcePort);
|
||||
//destination.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
//destination.Address.In6Addr = data->daddr;
|
||||
//destination.Port = _byteswap_ushort(data->dport);
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkSendType;
|
||||
networkEvent.ProtocolType = PH_UDP_PROTOCOL_TYPE | PH_IPV6_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_UDP | PH_NETWORK_TYPE_IPV6;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
//networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -572,25 +570,25 @@ VOID NTAPI EtpEtwEventCallback(
|
||||
break;
|
||||
case EVENT_TRACE_TYPE_TCPIP_RECEIVE_IPV6:
|
||||
{
|
||||
TcpIpOrUdpIp_IPV6_Header* data = EventRecord->UserData;
|
||||
PWMI_UDP_V6 data = EventRecord->UserData;
|
||||
ET_ETW_NETWORK_EVENT networkEvent;
|
||||
PH_IP_ENDPOINT source;
|
||||
//PH_IP_ENDPOINT destination;
|
||||
|
||||
// Note: The endpoints are swapped for incoming UDP packets. The destination endpoint
|
||||
// corresponds to the local socket not the source endpoint. (DavidXanatos)
|
||||
source.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
source.Address.In6Addr = data->daddr;
|
||||
source.Port = _byteswap_ushort(data->sport);
|
||||
//destination.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
source.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(source.Address.Ipv6, data->DestinationAddress, sizeof(IN6_ADDR));
|
||||
source.Port = _byteswap_ushort(data->DestinationPort);
|
||||
//destination.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
//destination.Address.In6Addr = data->saddr;
|
||||
//destination.Port = _byteswap_ushort(data->dport);
|
||||
|
||||
memset(&networkEvent, 0, sizeof(ET_ETW_NETWORK_EVENT));
|
||||
networkEvent.Type = EtEtwNetworkReceiveType;
|
||||
networkEvent.ProtocolType = PH_UDP_PROTOCOL_TYPE | PH_IPV6_NETWORK_TYPE;
|
||||
networkEvent.TransferSize = data->size;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->PID);
|
||||
networkEvent.ProtocolType = PH_PROTOCOL_TYPE_UDP | PH_NETWORK_TYPE_IPV6;
|
||||
networkEvent.TransferSize = data->TransferSize;
|
||||
networkEvent.ClientId.UniqueProcess = UlongToHandle(data->ProcessId);
|
||||
networkEvent.LocalEndpoint = source;
|
||||
//networkEvent.RemoteEndpoint = destination;
|
||||
|
||||
@@ -734,9 +732,8 @@ ULONG EtpStartRundownSession(
|
||||
|
||||
memset(EtpRundownTraceProperties, 0, sizeof(EtpRundownTracePropertiesBuffer));
|
||||
EtpRundownTraceProperties->Wnode.BufferSize = bufferSize;
|
||||
EtpRundownTraceProperties->Wnode.ClientContext = 1;
|
||||
EtpRundownTraceProperties->Wnode.ClientContext = EVENT_TRACE_CLOCK_RAW;
|
||||
EtpRundownTraceProperties->Wnode.Flags = WNODE_FLAG_TRACED_GUID;
|
||||
EtpRundownTraceProperties->MinimumBuffers = 1;
|
||||
EtpRundownTraceProperties->LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
|
||||
EtpRundownTraceProperties->FlushTimer = 1;
|
||||
EtpRundownTraceProperties->EnableFlags = EVENT_TRACE_FLAG_NO_SYSCONFIG;
|
||||
@@ -810,16 +807,16 @@ VOID NTAPI EtpRundownEtwEventCallback(
|
||||
{
|
||||
if (EtIsExecutingInWow64)
|
||||
{
|
||||
FileIo_Name_Wow64* dataWow64 = EventRecord->UserData;
|
||||
PWMI_FILE_IO_WOW64 dataWow64 = EventRecord->UserData;
|
||||
|
||||
fileEvent.FileObject = (PVOID)dataWow64->FileObject;
|
||||
PhInitializeStringRefLongHint(&fileEvent.FileName, dataWow64->FileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
FileIo_Name* data = EventRecord->UserData;
|
||||
PWMI_FILE_IO data = EventRecord->UserData;
|
||||
|
||||
fileEvent.FileObject = (PVOID)data->FileObject;
|
||||
fileEvent.FileObject = data->FileObject;
|
||||
PhInitializeStringRefLongHint(&fileEvent.FileName, data->FileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,51 +15,6 @@
|
||||
|
||||
#include <evntcons.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ULONG DiskNumber;
|
||||
ULONG IrpFlags;
|
||||
ULONG TransferSize;
|
||||
ULONG ResponseTime;
|
||||
ULONGLONG ByteOffset;
|
||||
ULONG_PTR FileObject;
|
||||
ULONG_PTR Irp;
|
||||
ULONGLONG HighResResponseTime;
|
||||
ULONG IssuingThreadId; // since WIN8 (ETW_DISKIO_READWRITE_V3)
|
||||
} DiskIo_TypeGroup1;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ULONG_PTR FileObject;
|
||||
WCHAR FileName[1];
|
||||
} FileIo_Name;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ULONGLONG FileObject;
|
||||
WCHAR FileName[1];
|
||||
} FileIo_Name_Wow64;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ULONG PID;
|
||||
ULONG size;
|
||||
IN_ADDR daddr;
|
||||
IN_ADDR saddr;
|
||||
USHORT dport;
|
||||
USHORT sport;
|
||||
} TcpIpOrUdpIp_IPV4_Header;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ULONG PID;
|
||||
ULONG size;
|
||||
IN6_ADDR daddr;
|
||||
IN6_ADDR saddr;
|
||||
USHORT dport;
|
||||
USHORT sport;
|
||||
} TcpIpOrUdpIp_IPV6_Header;
|
||||
|
||||
#define KERNEL_FILE_KEYWORD_FILENAME 0x10
|
||||
#define KERNEL_FILE_KEYWORD_FILEIO 0x20
|
||||
#define KERNEL_FILE_KEYWORD_OP_END 0x40
|
||||
|
||||
@@ -200,7 +200,7 @@ VOID EtProcessNetworkEvent(
|
||||
Event->ClientId.UniqueProcess
|
||||
);
|
||||
|
||||
if (!networkItem && FlagOn(Event->ProtocolType, PH_UDP_PROTOCOL_TYPE))
|
||||
if (!networkItem && FlagOn(Event->ProtocolType, PH_PROTOCOL_TYPE_UDP))
|
||||
{
|
||||
PH_IP_ENDPOINT networkEndpoint;
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ PPH_STRING EtFwGetNameFromAddress(
|
||||
|
||||
switch (Address->Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
if (IN4_IS_ADDR_UNSPECIFIED(&Address->InAddr))
|
||||
return NULL;
|
||||
@@ -593,10 +593,10 @@ PPH_STRING EtFwGetNameFromAddress(
|
||||
dnsLocalQuery = TRUE;
|
||||
}
|
||||
|
||||
addressReverseString = PhDnsReverseLookupNameFromAddress(PH_IPV4_NETWORK_TYPE, &Address->InAddr);
|
||||
addressReverseString = PhDnsReverseLookupNameFromAddress(PH_NETWORK_TYPE_IPV4, &Address->InAddr);
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&Address->In6Addr))
|
||||
return NULL;
|
||||
@@ -609,7 +609,7 @@ PPH_STRING EtFwGetNameFromAddress(
|
||||
dnsLocalQuery = TRUE;
|
||||
}
|
||||
|
||||
addressReverseString = PhDnsReverseLookupNameFromAddress(PH_IPV6_NETWORK_TYPE, &Address->In6Addr);
|
||||
addressReverseString = PhDnsReverseLookupNameFromAddress(PH_NETWORK_TYPE_IPV6, &Address->In6Addr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1157,7 +1157,7 @@ BOOLEAN EtFwLookupAddressClass(
|
||||
{
|
||||
switch (Address->Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
PIN_ADDR inAddr = (PIN_ADDR)&Address->Ipv4;
|
||||
|
||||
@@ -1211,7 +1211,7 @@ BOOLEAN EtFwLookupAddressClass(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
PIN6_ADDR inAddr6 = (PIN6_ADDR)&Address->Ipv6;
|
||||
|
||||
@@ -1266,7 +1266,7 @@ BOOLEAN EtFwLookupAddressScope(
|
||||
{
|
||||
switch (Address->Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
switch (Ipv4AddressScope((PUCHAR)&Address->Ipv4))
|
||||
{
|
||||
@@ -1315,7 +1315,7 @@ BOOLEAN EtFwLookupAddressScope(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
switch (Ipv6AddressScope((PUCHAR)&Address->Ipv6))
|
||||
{
|
||||
@@ -1777,8 +1777,8 @@ VOID CALLBACK EtFwEventCallback(
|
||||
{
|
||||
if (FlagOn(FwEvent->header.flags, FWPM_NET_EVENT_FLAG_LOCAL_ADDR_SET))
|
||||
{
|
||||
entry.LocalEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
entry.LocalEndpoint.Address.Ipv4 = _byteswap_ulong(FwEvent->header.localAddrV4);
|
||||
entry.LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
entry.LocalEndpoint.Address.InAddr.s_addr = _byteswap_ulong(FwEvent->header.localAddrV4);
|
||||
}
|
||||
|
||||
if (FlagOn(FwEvent->header.flags, FWPM_NET_EVENT_FLAG_LOCAL_PORT_SET))
|
||||
@@ -1788,8 +1788,8 @@ VOID CALLBACK EtFwEventCallback(
|
||||
|
||||
if (FlagOn(FwEvent->header.flags, FWPM_NET_EVENT_FLAG_REMOTE_ADDR_SET))
|
||||
{
|
||||
entry.RemoteEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
entry.RemoteEndpoint.Address.Ipv4 = _byteswap_ulong(FwEvent->header.remoteAddrV4);
|
||||
entry.RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
entry.RemoteEndpoint.Address.InAddr.s_addr = _byteswap_ulong(FwEvent->header.remoteAddrV4);
|
||||
}
|
||||
|
||||
if (FlagOn(FwEvent->header.flags, FWPM_NET_EVENT_FLAG_REMOTE_PORT_SET))
|
||||
@@ -1801,7 +1801,7 @@ VOID CALLBACK EtFwEventCallback(
|
||||
{
|
||||
if (FlagOn(FwEvent->header.flags, FWPM_NET_EVENT_FLAG_LOCAL_ADDR_SET))
|
||||
{
|
||||
entry.LocalEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
entry.LocalEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(entry.LocalEndpoint.Address.Ipv6, FwEvent->header.localAddrV6.byteArray16, 16);
|
||||
}
|
||||
|
||||
@@ -1812,7 +1812,7 @@ VOID CALLBACK EtFwEventCallback(
|
||||
|
||||
if (FlagOn(FwEvent->header.flags, FWPM_NET_EVENT_FLAG_REMOTE_ADDR_SET))
|
||||
{
|
||||
entry.RemoteEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
entry.RemoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
memcpy(entry.RemoteEndpoint.Address.Ipv6, FwEvent->header.remoteAddrV6.byteArray16, 16);
|
||||
}
|
||||
|
||||
|
||||
@@ -586,27 +586,27 @@ BEGIN_SORT_FUNCTION(LocalAddress)
|
||||
memset(&localAddress1, 0, sizeof(SOCKADDR_IN6)); // memset for zero padding (dmex)
|
||||
memset(&localAddress2, 0, sizeof(SOCKADDR_IN6));
|
||||
|
||||
if (node1->LocalEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (node1->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
localAddress1.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&localAddress1.sin6_addr, &node1->LocalEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&node1->LocalEndpoint.Address.InAddr, &localAddress1.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&localAddress1, &node1->LocalEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (node1->LocalEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (node1->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId1.Value = node1->ScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&localAddress1, &node1->LocalEndpoint.Address.In6Addr, scopeId1, 0);
|
||||
}
|
||||
|
||||
if (node2->LocalEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (node2->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
localAddress2.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&localAddress2.sin6_addr, &node2->LocalEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&node2->LocalEndpoint.Address.InAddr, &localAddress2.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&localAddress2, &node2->LocalEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (node2->LocalEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (node2->LocalEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId2.Value = node2->ScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&localAddress2, &node2->LocalEndpoint.Address.In6Addr, scopeId2, 0);
|
||||
@@ -638,27 +638,27 @@ BEGIN_SORT_FUNCTION(RemoteAddress)
|
||||
memset(&remoteAddress1, 0, sizeof(SOCKADDR_IN6)); // memset for zero padding (dmex)
|
||||
memset(&remoteAddress2, 0, sizeof(SOCKADDR_IN6));
|
||||
|
||||
if (node1->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (node1->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
remoteAddress1.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&remoteAddress1.sin6_addr, &node1->RemoteEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&node1->RemoteEndpoint.Address.InAddr, &remoteAddress1.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&remoteAddress1, &node1->RemoteEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (node1->RemoteEndpoint.Address.Type & PH_IPV6_NETWORK_TYPE)
|
||||
else if (node1->RemoteEndpoint.Address.Type & PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId1.Value = node1->ScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&remoteAddress1, &node1->RemoteEndpoint.Address.In6Addr, scopeId1, 0);
|
||||
}
|
||||
|
||||
if (node2->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (node2->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
remoteAddress2.sin6_family = AF_INET6;
|
||||
IN6_SET_ADDR_V4COMPAT(&remoteAddress2.sin6_addr, &node2->RemoteEndpoint.Address.InAddr);
|
||||
IN4_UNCANONICALIZE_SCOPE_ID(&node2->RemoteEndpoint.Address.InAddr, &remoteAddress2.sin6_scope_struct);
|
||||
//IN6ADDR_SETV4MAPPED(&remoteAddress2, &node2->RemoteEndpoint.Address.InAddr, (SCOPE_ID)SCOPEID_UNSPECIFIED_INIT, 0);
|
||||
}
|
||||
else if (node2->RemoteEndpoint.Address.Type & PH_IPV6_NETWORK_TYPE)
|
||||
else if (node2->RemoteEndpoint.Address.Type & PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
scopeId2.Value = node2->ScopeId;
|
||||
IN6ADDR_SETSOCKADDR(&remoteAddress2, &node2->RemoteEndpoint.Address.In6Addr, scopeId2, 0);
|
||||
@@ -962,7 +962,7 @@ BOOLEAN NTAPI FwTreeNewCallback(
|
||||
{
|
||||
switch (node->LocalEndpoint.Address.Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
ULONG ipv4AddressStringLength = RTL_NUMBER_OF(node->LocalAddressString);
|
||||
|
||||
@@ -978,7 +978,7 @@ BOOLEAN NTAPI FwTreeNewCallback(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
ULONG ipv6AddressStringLength = RTL_NUMBER_OF(node->LocalAddressString);
|
||||
|
||||
@@ -1039,7 +1039,7 @@ BOOLEAN NTAPI FwTreeNewCallback(
|
||||
{
|
||||
switch (node->RemoteEndpoint.Address.Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
{
|
||||
ULONG ipv4AddressStringLength = RTL_NUMBER_OF(node->RemoteAddressString);
|
||||
|
||||
@@ -1055,7 +1055,7 @@ BOOLEAN NTAPI FwTreeNewCallback(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
{
|
||||
ULONG ipv6AddressStringLength = RTL_NUMBER_OF(node->RemoteAddressString);
|
||||
|
||||
@@ -1828,7 +1828,7 @@ VOID ShowFwContextMenu(
|
||||
PhSetDisabledEMenuItem(traceMenu);
|
||||
PhSetDisabledEMenuItem(whoisMenu);
|
||||
}
|
||||
else if (fwItems[0]->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
else if (fwItems[0]->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
if (
|
||||
IN4_IS_ADDR_UNSPECIFIED(&fwItems[0]->RemoteEndpoint.Address.InAddr) ||
|
||||
@@ -1845,7 +1845,7 @@ VOID ShowFwContextMenu(
|
||||
PhSetDisabledEMenuItem(whoisMenu);
|
||||
}
|
||||
}
|
||||
else if (fwItems[0]->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (fwItems[0]->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
if (
|
||||
IN6_IS_ADDR_UNSPECIFIED(&fwItems[0]->RemoteEndpoint.Address.In6Addr) ||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <kphcomms.h>
|
||||
#include <kphuser.h>
|
||||
#include <ntuser.h>
|
||||
|
||||
static PH_STRINGREF EtObjectManagerRootDirectoryObject = PH_STRINGREF_INIT(L"\\"); // RtlNtPathSeparatorString
|
||||
static PH_STRINGREF EtObjectManagerUserDirectoryObject = PH_STRINGREF_INIT(L"??"); // RtlDosDevicesPrefix
|
||||
@@ -1572,19 +1573,7 @@ NTSTATUS EtObjectManagerOpenHandle(
|
||||
case EtObjectAlpcPort:
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static NTSTATUS (NTAPI* NtAlpcConnectPortEx_I)(
|
||||
_Out_ PHANDLE PortHandle,
|
||||
_In_ POBJECT_ATTRIBUTES ConnectionPortObjectAttributes,
|
||||
_In_opt_ POBJECT_ATTRIBUTES ClientPortObjectAttributes,
|
||||
_In_opt_ PALPC_PORT_ATTRIBUTES PortAttributes,
|
||||
_In_ ULONG Flags,
|
||||
_In_opt_ PSECURITY_DESCRIPTOR ServerSecurityRequirements,
|
||||
_Inout_updates_bytes_to_opt_(*BufferLength, *BufferLength) PPORT_MESSAGE ConnectionMessage,
|
||||
_Inout_opt_ PSIZE_T BufferLength,
|
||||
_Inout_opt_ PALPC_MESSAGE_ATTRIBUTES OutMessageAttributes,
|
||||
_Inout_opt_ PALPC_MESSAGE_ATTRIBUTES InMessageAttributes,
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
) = NULL;
|
||||
static __typeof__(&NtAlpcConnectPortEx) NtAlpcConnectPortEx_I = NULL;
|
||||
LARGE_INTEGER timeout;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
@@ -1754,10 +1743,7 @@ NTSTATUS EtObjectManagerOpenHandle(
|
||||
case EtObjectWindowStation:
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static HWINSTA (NTAPI* NtUserOpenWindowStation_I)(
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
_In_ ACCESS_MASK DesiredAccess
|
||||
);
|
||||
static __typeof__(&NtUserOpenWindowStation) NtUserOpenWindowStation_I = NULL;
|
||||
HANDLE windowStationHandle;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
@@ -1810,11 +1796,7 @@ NTSTATUS EtObjectManagerOpenHandle(
|
||||
case EtObjectMemoryPartition:
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static NTSTATUS (NTAPI *NtOpenPartition_I)(
|
||||
_Out_ PHANDLE PartitionHandle,
|
||||
_In_ ACCESS_MASK DesiredAccess,
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
||||
);
|
||||
static __typeof__(&NtOpenPartition) NtOpenPartition_I = NULL;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
{
|
||||
@@ -1831,11 +1813,7 @@ NTSTATUS EtObjectManagerOpenHandle(
|
||||
case EtObjectCpuPartition:
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static NTSTATUS(NTAPI * NtOpenCpuPartition_I)(
|
||||
_Out_ PHANDLE CpuPartitionHandle,
|
||||
_In_ ACCESS_MASK DesiredAccess,
|
||||
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
||||
);
|
||||
static __typeof__(&NtOpenCpuPartition) NtOpenCpuPartition_I = NULL;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
{
|
||||
|
||||
@@ -1394,10 +1394,10 @@ ET_FIREWALL_STATUS EtQueryFirewallStatus(
|
||||
if (SUCCEEDED(INetFwMgr_IsPortAllowed(
|
||||
manager,
|
||||
imageFileNameBStr,
|
||||
(NetworkItem->ProtocolType & PH_IPV6_NETWORK_TYPE) ? NET_FW_IP_VERSION_V6 : NET_FW_IP_VERSION_V4,
|
||||
(NetworkItem->ProtocolType & PH_NETWORK_TYPE_IPV6) ? NET_FW_IP_VERSION_V6 : NET_FW_IP_VERSION_V4,
|
||||
NetworkItem->LocalEndpoint.Port,
|
||||
localAddressBStr,
|
||||
(NetworkItem->ProtocolType & PH_UDP_PROTOCOL_TYPE) ? NET_FW_IP_PROTOCOL_UDP : NET_FW_IP_PROTOCOL_TCP,
|
||||
(NetworkItem->ProtocolType & PH_PROTOCOL_TYPE_UDP) ? NET_FW_IP_PROTOCOL_UDP : NET_FW_IP_PROTOCOL_TCP,
|
||||
&allowed,
|
||||
&restricted
|
||||
)))
|
||||
|
||||
@@ -405,7 +405,7 @@ BOOLEAN LookupCountryCodeFromMmdb(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (RemoteAddress.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (RemoteAddress.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
SOCKADDR_IN ipv4SockAddr;
|
||||
|
||||
@@ -483,7 +483,7 @@ BOOLEAN LookupSockInAddr4CountryCode(
|
||||
PH_IP_ADDRESS remoteAddress;
|
||||
|
||||
memset(&remoteAddress, 0, sizeof(PH_IP_ADDRESS));
|
||||
remoteAddress.Type = PH_IPV4_NETWORK_TYPE;
|
||||
remoteAddress.Type = PH_NETWORK_TYPE_IPV4;
|
||||
remoteAddress.InAddr = RemoteAddress;
|
||||
|
||||
return LookupCountryCodeFromMmdb(remoteAddress, CountryCode, CountryName);
|
||||
@@ -499,7 +499,7 @@ BOOLEAN LookupSockInAddr6CountryCode(
|
||||
PH_IP_ADDRESS remoteAddress;
|
||||
|
||||
memset(&remoteAddress, 0, sizeof(PH_IP_ADDRESS));
|
||||
remoteAddress.Type = PH_IPV6_NETWORK_TYPE;
|
||||
remoteAddress.Type = PH_NETWORK_TYPE_IPV6;
|
||||
remoteAddress.In6Addr = RemoteAddress;
|
||||
|
||||
return LookupCountryCodeFromMmdb(remoteAddress, CountryCode, CountryName);
|
||||
|
||||
+13
-13
@@ -86,7 +86,7 @@ static BOOLEAN ParseNetworkAddress(
|
||||
// try parsing the address with RtlIpv4StringToAddressEx since it does support these formats (dmex)
|
||||
RemoteEndpoint->Address.InAddr.s_addr = addressInfo.Ipv4Address.sin_addr.s_addr;
|
||||
RemoteEndpoint->Port = _byteswap_ushort(addressInfo.Ipv4Address.sin_port);
|
||||
RemoteEndpoint->Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
RemoteEndpoint->Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ static BOOLEAN ParseNetworkAddress(
|
||||
{
|
||||
RemoteEndpoint->Address.InAddr.s_addr = ((PSOCKADDR_IN)i->ai_addr)->sin_addr.s_addr;
|
||||
RemoteEndpoint->Port = _byteswap_ushort(((PSOCKADDR_IN)i->ai_addr)->sin_port);
|
||||
RemoteEndpoint->Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
RemoteEndpoint->Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
success = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ static BOOLEAN ParseNetworkAddress(
|
||||
sizeof(((PSOCKADDR_IN6)i->ai_addr)->sin6_addr.s6_addr)
|
||||
);
|
||||
RemoteEndpoint->Port = _byteswap_ushort(((PSOCKADDR_IN6)i->ai_addr)->sin6_port);
|
||||
RemoteEndpoint->Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
RemoteEndpoint->Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
success = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ static BOOLEAN ParseNetworkAddress(
|
||||
{
|
||||
RemoteEndpoint->Address.InAddr.s_addr = addressInfo.Ipv4Address.sin_addr.s_addr;
|
||||
RemoteEndpoint->Port = _byteswap_ushort(addressInfo.Ipv4Address.sin_port);
|
||||
RemoteEndpoint->Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
RemoteEndpoint->Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ static BOOLEAN ParseNetworkAddress(
|
||||
sizeof(addressInfo.Ipv6Address.sin6_addr.s6_addr)
|
||||
);
|
||||
RemoteEndpoint->Port = _byteswap_ushort(addressInfo.Ipv6Address.sin6_port);
|
||||
RemoteEndpoint->Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
RemoteEndpoint->Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ VOID NTAPI NetworkMenuInitializingCallback(
|
||||
PhSetDisabledEMenuItem(traceMenu);
|
||||
PhSetDisabledEMenuItem(pingMenu);
|
||||
}
|
||||
else if (networkItem->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
else if (networkItem->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
if (
|
||||
IN4_IS_ADDR_UNSPECIFIED(&networkItem->RemoteEndpoint.Address.InAddr) ||
|
||||
@@ -338,7 +338,7 @@ VOID NTAPI NetworkMenuInitializingCallback(
|
||||
PhSetDisabledEMenuItem(whoisMenu);
|
||||
}
|
||||
}
|
||||
else if (networkItem->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (networkItem->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
if (
|
||||
IN6_IS_ADDR_UNSPECIFIED(&networkItem->RemoteEndpoint.Address.In6Addr) ||
|
||||
@@ -519,9 +519,9 @@ VOID PhpNetworkItemToRow(
|
||||
)
|
||||
{
|
||||
Row->State = NetworkItem->State;
|
||||
Row->dwLocalAddr = NetworkItem->LocalEndpoint.Address.Ipv4;
|
||||
Row->dwLocalAddr = NetworkItem->LocalEndpoint.Address.InAddr.s_addr;
|
||||
Row->dwLocalPort = _byteswap_ushort((USHORT)NetworkItem->LocalEndpoint.Port);
|
||||
Row->dwRemoteAddr = NetworkItem->RemoteEndpoint.Address.Ipv4;
|
||||
Row->dwRemoteAddr = NetworkItem->RemoteEndpoint.Address.InAddr.s_addr;
|
||||
Row->dwRemotePort = _byteswap_ushort((USHORT)NetworkItem->RemoteEndpoint.Port);
|
||||
}
|
||||
|
||||
@@ -570,7 +570,7 @@ VOID NTAPI NetworkNodeCreateCallback(
|
||||
{
|
||||
if (NetworkExtensionEnabled)
|
||||
{
|
||||
if (networkNode->NetworkItem->ProtocolType == PH_TCP4_NETWORK_PROTOCOL)
|
||||
if (networkNode->NetworkItem->ProtocolType == PH_NETWORK_PROTOCOL_TCP4)
|
||||
{
|
||||
MIB_TCPROW tcpRow;
|
||||
TCP_ESTATS_DATA_RW_v0 dataRw;
|
||||
@@ -584,7 +584,7 @@ VOID NTAPI NetworkNodeCreateCallback(
|
||||
SetPerTcpConnectionEStats(&tcpRow, TcpConnectionEstatsData, (PUCHAR)&dataRw, 0, sizeof(TCP_ESTATS_DATA_RW_v0), 0);
|
||||
SetPerTcpConnectionEStats(&tcpRow, TcpConnectionEstatsPath, (PUCHAR)&pathRw, 0, sizeof(TCP_ESTATS_PATH_RW_v0), 0);
|
||||
}
|
||||
else if (networkNode->NetworkItem->ProtocolType == PH_TCP6_NETWORK_PROTOCOL)
|
||||
else if (networkNode->NetworkItem->ProtocolType == PH_NETWORK_PROTOCOL_TCP6)
|
||||
{
|
||||
MIB_TCP6ROW tcp6Row;
|
||||
TCP_ESTATS_DATA_RW_v0 dataRw;
|
||||
@@ -855,7 +855,7 @@ VOID ProcessesUpdatedCallback(
|
||||
if (!extension || !extension->StatsEnabled)
|
||||
continue;
|
||||
|
||||
if (extension->NetworkItem->ProtocolType == PH_TCP4_NETWORK_PROTOCOL)
|
||||
if (extension->NetworkItem->ProtocolType == PH_NETWORK_PROTOCOL_TCP4)
|
||||
{
|
||||
MIB_TCPROW tcpRow;
|
||||
TCP_ESTATS_DATA_RW_v0 dataRw;
|
||||
@@ -913,7 +913,7 @@ VOID ProcessesUpdatedCallback(
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (extension->NetworkItem->ProtocolType == PH_TCP6_NETWORK_PROTOCOL)
|
||||
else if (extension->NetworkItem->ProtocolType == PH_NETWORK_PROTOCOL_TCP6)
|
||||
{
|
||||
MIB_TCP6ROW tcp6Row;
|
||||
TCP_ESTATS_DATA_RW_v0 dataRw;
|
||||
|
||||
@@ -83,7 +83,7 @@ NTSTATUS TracertHostnameLookupCallback(
|
||||
PPH_STRING dnsReverseNameString = NULL;
|
||||
PDNS_RECORD dnsRecordList;
|
||||
|
||||
if (workitem->Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (workitem->Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
IN_ADDR inAddr4 = ((PSOCKADDR_IN)&workitem->SocketAddress)->sin_addr;
|
||||
|
||||
@@ -97,9 +97,9 @@ NTSTATUS TracertHostnameLookupCallback(
|
||||
dnsLocalQuery = TRUE;
|
||||
}
|
||||
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_IPV4_NETWORK_TYPE, &inAddr4);
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_NETWORK_TYPE_IPV4, &inAddr4);
|
||||
}
|
||||
else if (workitem->Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (workitem->Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
IN6_ADDR inAddr6 = ((PSOCKADDR_IN6)&workitem->SocketAddress)->sin6_addr;
|
||||
|
||||
@@ -111,7 +111,7 @@ NTSTATUS TracertHostnameLookupCallback(
|
||||
dnsLocalQuery = TRUE;
|
||||
}
|
||||
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_IPV6_NETWORK_TYPE, &inAddr6);
|
||||
dnsReverseNameString = PhDnsReverseLookupNameFromAddress(PH_NETWORK_TYPE_IPV6, &inAddr6);
|
||||
}
|
||||
|
||||
if (PhIsNullOrEmptyString(dnsReverseNameString))
|
||||
@@ -200,7 +200,7 @@ VOID TracertQueueHostLookup(
|
||||
ULONG addressStringLength = INET6_ADDRSTRLEN;
|
||||
WCHAR addressString[INET6_ADDRSTRLEN] = L"";
|
||||
|
||||
if (Context->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (Context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
IN_ADDR sockAddrIn;
|
||||
|
||||
@@ -232,7 +232,7 @@ VOID TracertQueueHostLookup(
|
||||
PTRACERT_RESOLVE_WORKITEM resolve;
|
||||
|
||||
resolve = PhAllocateZero(sizeof(TRACERT_RESOLVE_WORKITEM));
|
||||
resolve->Type = PH_IPV4_NETWORK_TYPE;
|
||||
resolve->Type = PH_NETWORK_TYPE_IPV4;
|
||||
resolve->WindowHandle = Context->WindowHandle;
|
||||
resolve->Index = Node->TTL;
|
||||
|
||||
@@ -252,7 +252,7 @@ VOID TracertQueueHostLookup(
|
||||
PhMoveReference(&Node->RemoteCountryName, remoteCountryName);
|
||||
}
|
||||
}
|
||||
else if (Context->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (Context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
IN6_ADDR sockAddrIn6;
|
||||
|
||||
@@ -284,7 +284,7 @@ VOID TracertQueueHostLookup(
|
||||
PTRACERT_RESOLVE_WORKITEM resolve;
|
||||
|
||||
resolve = PhAllocateZero(sizeof(TRACERT_RESOLVE_WORKITEM));
|
||||
resolve->Type = PH_IPV6_NETWORK_TYPE;
|
||||
resolve->Type = PH_NETWORK_TYPE_IPV6;
|
||||
resolve->WindowHandle = Context->WindowHandle;
|
||||
resolve->Index = Node->TTL;
|
||||
|
||||
@@ -352,10 +352,10 @@ NTSTATUS NetworkTracertThreadStart(
|
||||
|
||||
switch (context->RemoteEndpoint.Address.Type)
|
||||
{
|
||||
case PH_IPV4_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV4:
|
||||
icmpHandle = IcmpCreateFile();
|
||||
break;
|
||||
case PH_IPV6_NETWORK_TYPE:
|
||||
case PH_NETWORK_TYPE_IPV6:
|
||||
icmpHandle = Icmp6CreateFile();
|
||||
break;
|
||||
}
|
||||
@@ -363,13 +363,13 @@ NTSTATUS NetworkTracertThreadStart(
|
||||
if (icmpHandle == INVALID_HANDLE_VALUE)
|
||||
goto CleanupExit;
|
||||
|
||||
if (context->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
((PSOCKADDR_IN)&destinationAddress)->sin_family = AF_INET;
|
||||
((PSOCKADDR_IN)&destinationAddress)->sin_addr = context->RemoteEndpoint.Address.InAddr;
|
||||
//((PSOCKADDR_IN)&destinationAddress)->sin_port = (USHORT)context->RemoteEndpoint.Port;
|
||||
}
|
||||
else if (context->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
((PSOCKADDR_IN6)&destinationAddress)->sin6_family = AF_INET6;
|
||||
((PSOCKADDR_IN6)&destinationAddress)->sin6_addr = context->RemoteEndpoint.Address.In6Addr;
|
||||
@@ -393,7 +393,7 @@ NTSTATUS NetworkTracertThreadStart(
|
||||
if (context->Cancel)
|
||||
break;
|
||||
|
||||
if (context->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
icmpReplyLength = ICMP_BUFFER_SIZE(sizeof(ICMP_ECHO_REPLY), icmpEchoBuffer->Length);
|
||||
icmpReplyBuffer = PhAllocateZero(icmpReplyLength);
|
||||
@@ -560,12 +560,12 @@ NTSTATUS NetworkTracertThreadStart(
|
||||
break;
|
||||
}
|
||||
|
||||
if (context->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
if (RtlEqualMemory(&last4ReplyAddress, &((PSOCKADDR_IN)&destinationAddress)->sin_addr, sizeof(IN_ADDR)))
|
||||
break;
|
||||
}
|
||||
else if (context->RemoteEndpoint.Address.Type == PH_IPV6_NETWORK_TYPE)
|
||||
else if (context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV6)
|
||||
{
|
||||
if (RtlEqualMemory(&last6ReplyAddress, &((PSOCKADDR_IN6)&destinationAddress)->sin6_addr, sizeof(IN6_ADDR)))
|
||||
break;
|
||||
@@ -609,7 +609,7 @@ VOID TracertMenuActionCallback(
|
||||
&remoteEndpointPort
|
||||
)))
|
||||
{
|
||||
remoteEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
remoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
ShowPingWindowFromAddress(Context->WindowHandle, remoteEndpoint);
|
||||
break;
|
||||
}
|
||||
@@ -621,7 +621,7 @@ VOID TracertMenuActionCallback(
|
||||
&remoteEndpointPort
|
||||
)))
|
||||
{
|
||||
remoteEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
remoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
ShowPingWindowFromAddress(Context->WindowHandle, remoteEndpoint);
|
||||
break;
|
||||
}
|
||||
@@ -644,7 +644,7 @@ VOID TracertMenuActionCallback(
|
||||
&remoteEndpointPort
|
||||
)))
|
||||
{
|
||||
remoteEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
remoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
ShowTracertWindowFromAddress(Context->WindowHandle, remoteEndpoint);
|
||||
break;
|
||||
}
|
||||
@@ -656,7 +656,7 @@ VOID TracertMenuActionCallback(
|
||||
&remoteEndpointPort
|
||||
)))
|
||||
{
|
||||
remoteEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
remoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
ShowTracertWindowFromAddress(Context->WindowHandle, remoteEndpoint);
|
||||
break;
|
||||
}
|
||||
@@ -679,7 +679,7 @@ VOID TracertMenuActionCallback(
|
||||
&remoteEndpointPort
|
||||
)))
|
||||
{
|
||||
remoteEndpoint.Address.Type = PH_IPV4_NETWORK_TYPE;
|
||||
remoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV4;
|
||||
ShowWhoisWindowFromAddress(Context->WindowHandle, remoteEndpoint);
|
||||
break;
|
||||
}
|
||||
@@ -691,7 +691,7 @@ VOID TracertMenuActionCallback(
|
||||
&remoteEndpointPort
|
||||
)))
|
||||
{
|
||||
remoteEndpoint.Address.Type = PH_IPV6_NETWORK_TYPE;
|
||||
remoteEndpoint.Address.Type = PH_NETWORK_TYPE_IPV6;
|
||||
ShowWhoisWindowFromAddress(Context->WindowHandle, remoteEndpoint);
|
||||
break;
|
||||
}
|
||||
@@ -1085,7 +1085,7 @@ VOID ShowTracertWindow(
|
||||
sizeof(NetworkItem->RemoteEndpoint)
|
||||
);
|
||||
|
||||
if (NetworkItem->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (NetworkItem->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
ULONG remoteAddressStringLength = RTL_NUMBER_OF(context->RemoteAddressString);
|
||||
|
||||
@@ -1136,7 +1136,7 @@ VOID ShowTracertWindowFromAddress(
|
||||
sizeof(RemoteEndpoint)
|
||||
);
|
||||
|
||||
if (RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
ULONG remoteAddressStringLength = RTL_NUMBER_OF(context->RemoteAddressString);
|
||||
|
||||
|
||||
@@ -211,36 +211,11 @@ BOOLEAN GeoLiteDownloadUpdateToFile(
|
||||
|
||||
if (!NT_SUCCESS(status = PhHttpReceiveResponse(httpContext)))
|
||||
goto CleanupExit;
|
||||
|
||||
// Check http request status.
|
||||
|
||||
if (!NT_SUCCESS(status = PhHttpQueryHeaderUlong(httpContext, PH_HTTP_QUERY_STATUS_CODE, &httpStatus)))
|
||||
if (!NT_SUCCESS(status = PhHttpQueryResponseStatus(httpContext)))
|
||||
goto CleanupExit;
|
||||
|
||||
if (httpStatus != PH_HTTP_STATUS_OK)
|
||||
{
|
||||
switch (httpStatus)
|
||||
{
|
||||
case 401:
|
||||
status = STATUS_ACCESS_DENIED;
|
||||
break;
|
||||
default:
|
||||
status = STATUS_UNEXPECTED_NETWORK_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
goto CleanupExit;
|
||||
}
|
||||
|
||||
if (!NT_SUCCESS(status = PhHttpQueryHeaderUlong(httpContext, PH_HTTP_QUERY_CONTENT_LENGTH, &httpContentLength)))
|
||||
goto CleanupExit;
|
||||
|
||||
if (httpContentLength == 0)
|
||||
{
|
||||
status = STATUS_DATA_LATE_ERROR;
|
||||
goto CleanupExit;
|
||||
}
|
||||
|
||||
// Update status message.
|
||||
|
||||
httpString = GeoLiteDatabaseNameFormatString(L"Downloading GeoLite2-%s...");
|
||||
@@ -311,7 +286,7 @@ BOOLEAN GeoLiteDownloadUpdateToFile(
|
||||
status = PhCreateFileWin32Ex(
|
||||
&tempFileHandle,
|
||||
PhGetString(httpHeaderFileName),
|
||||
FILE_GENERIC_READ | FILE_GENERIC_WRITE,
|
||||
FILE_GENERIC_WRITE,
|
||||
&allocationSize,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
FILE_SHARE_READ,
|
||||
|
||||
@@ -829,7 +829,7 @@ VOID WhoisParseAddressString(
|
||||
{
|
||||
ULONG remoteAddressStringLength = RTL_NUMBER_OF(Context->RemoteAddressString);
|
||||
|
||||
if (Context->RemoteEndpoint.Address.Type == PH_IPV4_NETWORK_TYPE)
|
||||
if (Context->RemoteEndpoint.Address.Type == PH_NETWORK_TYPE_IPV4)
|
||||
{
|
||||
if (NT_SUCCESS(RtlIpv4AddressToStringEx(
|
||||
&Context->RemoteEndpoint.Address.InAddr,
|
||||
|
||||
@@ -561,7 +561,7 @@ BOOLEAN NetworkTreeFilterCallback(
|
||||
}
|
||||
|
||||
{
|
||||
if (FlagOn(networkNode->NetworkItem->ProtocolType, PH_TCP_PROTOCOL_TYPE))
|
||||
if (FlagOn(networkNode->NetworkItem->ProtocolType, PH_PROTOCOL_TYPE_TCP))
|
||||
{
|
||||
PCPH_STRINGREF stateName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user