为什么在 PMIB_TCPROW2 结构的 dwLocalPort 中使用 0xFFFF 的位掩码?

Why is a bitmask of 0xFFFF used when dwLocalPort from PMIB_TCPROW2 structure?

我发现这个答案很有用:Getting PID of peer socket on Windows ..但也很有趣。

我想知道:为什么在 dwLocalPort 的 32 个 DWORD 位中 row->dwLocalPort & 0xFFFF 屏蔽了 16 位?

我知道位掩码是用来给1个数字增加更多信息的,但我觉得这里没有必要。我是不是忽略了一些简单的事情?

根据 MSDN "The maximum size of an IP port number is 16 bits, so only the lower 16 bits should be used. The upper 16 bits may contain uninitialized data."

https://msdn.microsoft.com/en-ca/subscriptions/bb485761.aspx