最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

windows - Why is the data returned by WMI not same as the structrue in NDIS_OFFLOAD - Stack Overflow

matteradmin8PV0评论

I followd this article to query URO state with wmi

Using this script in windows powershell:

$NDIS_WMI_METHOD_HEADER_REVISION_1             = 1
$NDIS_WMI_OBJECT_TYPE_METHOD                   = 0x02
$NDIS_SIZEOF_WMI_METHOD_HEADER_REVISION_1      = 0xffff
function Get-NdisObjectHeader
{
param(
$revision = $NDIS_WMI_METHOD_HEADER_REVISION_1,
$type     = $NDIS_WMI_OBJECT_TYPE_METHOD,
$size     = $NDIS_SIZEOF_WMI_METHOD_HEADER_REVISION_1
)
$hdr = ([wmiclass]'root\wmi:MSNdis_ObjectHeader').CreateInstance()
$hdr.Revision      = $revision
$hdr.Type          = $type
$hdr.Size          = $size
return $hdr
}
function Get-NdisWmiHeader
{
param($timeout = 5)
$whdr = ([wmiclass]'root\wmi:MSNdis_WmiMethodHeader').CreateInstance()
$whdr.Header       = Get-NdisObjectHeader
$whdr.PortNumber   = 0
$whdr.NetLuid      = 0
$whdr.Padding      = 0
$whdr.RequestId    = 0
$whdr.Timeout      = $timeout
return $whdr
}
$whdr = Get-NdisWmiHeader
$r = Get-WmiObject -Class MSNdis_TcpOffloadCurrentConfig -Namespace "root\WMI"
$x=$r[3].WmiQueryCurrentOffloadConfig($whdr)

PS C:\Windows\System32> $x.Offload
__GENUS          : 2
__CLASS          : MSNdis_WmiOffload
__SUPERCLASS     : MSNdis
__DYNASTY        : MSNdis
__RELPATH        :
__PROPERTY_COUNT : 6
__DERIVATION     : {MSNdis}
__SERVER         :
__NAMESPACE      :
__PATH           :
Checksum         : System.Management.ManagementBaseObject
Flags            : 0
Header           : System.Management.ManagementBaseObject
IPsecV1          : System.Management.ManagementBaseObject
LsoV1            : System.Management.ManagementBaseObject
LsoV2            : System.Management.ManagementBaseObject
PSComputerName   :

The result returned by wmi does not include the field UdpRsc in NDIS_OFFLOAD

typedef struct _NDIS_OFFLOAD {
  NDIS_OBJECT_HEADER                       Header;
  NDIS_TCP_IP_CHECKSUM_OFFLOAD             Checksum;
  NDIS_TCP_LARGE_SEND_OFFLOAD_V1           LsoV1;
  NDIS_IPSEC_OFFLOAD_V1                    IPsecV1;
  NDIS_TCP_LARGE_SEND_OFFLOAD_V2           LsoV2;
  ULONG                                    Flags;
  NDIS_IPSEC_OFFLOAD_V2                    IPsecV2;
  NDIS_TCP_RECV_SEG_COALESCE_OFFLOAD       Rsc;
  NDIS_ENCAPSULATED_PACKET_TASK_OFFLOAD    EncapsulatedPacketTaskOffloadGre;
  NDIS_ENCAPSULATED_PACKET_TASK_OFFLOAD_V2 EncapsulatedPacketTaskOffloadVxlan;
  UCHAR                                    EncapsulationTypes;
  NDIS_RFC6877_464XLAT_OFFLOAD             Rfc6877Xlat;
  NDIS_UDP_SEGMENTATION_OFFLOAD            UdpSegmentation;
  NDIS_UDP_RSC_OFFLOAD                     UdpRsc;
} NDIS_OFFLOAD, *PNDIS_OFFLOAD;

and looks like missing many fields, such IPsecV2,Rsc,EncapsulatedPacketTaskOffloadGre .

How can I get the udpRsc field and my windows os version is 24h2

Post a comment

comment list (0)

  1. No comments so far