Code: Alles auswählen
int main(int argc, char* argv[])
{
printf("Element Offset Size\n");
printf("InterfaceLuid %6d %6d\n", offsetof(MIB_IF_ROW2, InterfaceLuid), sizeof(((MIB_IF_ROW2*)(NULL))->InterfaceLuid));
printf("InterfaceIndex %6d %6d\n", offsetof(MIB_IF_ROW2, InterfaceIndex), sizeof(((MIB_IF_ROW2*)(NULL))->InterfaceIndex));
printf("InterfaceGuid %6d %6d\n", offsetof(MIB_IF_ROW2, InterfaceGuid), sizeof(((MIB_IF_ROW2*)(NULL))->InterfaceGuid));
printf("Alias %6d %6d\n", offsetof(MIB_IF_ROW2, Alias), sizeof(((MIB_IF_ROW2*)(NULL))->Alias));
printf("Description %6d %6d\n", offsetof(MIB_IF_ROW2, Description), sizeof(((MIB_IF_ROW2*)(NULL))->Description));
printf("PhysicalAddressLength %6d %6d\n", offsetof(MIB_IF_ROW2, PhysicalAddressLength), sizeof(((MIB_IF_ROW2*)(NULL))->PhysicalAddressLength));
printf("PhysicalAddress %6d %6d\n", offsetof(MIB_IF_ROW2, PhysicalAddress), sizeof(((MIB_IF_ROW2*)(NULL))->PhysicalAddress));
printf("PermanentPhysicalAddress %6d %6d\n", offsetof(MIB_IF_ROW2, PermanentPhysicalAddress), sizeof(((MIB_IF_ROW2*)(NULL))->PermanentPhysicalAddress));
printf("Mtu %6d %6d\n", offsetof(MIB_IF_ROW2, Mtu), sizeof(((MIB_IF_ROW2*)(NULL))->Mtu));
printf("Type %6d %6d\n", offsetof(MIB_IF_ROW2, Type), sizeof(((MIB_IF_ROW2*)(NULL))->Type));
printf("TunnelType %6d %6d\n", offsetof(MIB_IF_ROW2, TunnelType), sizeof(((MIB_IF_ROW2*)(NULL))->TunnelType));
printf("MediaType %6d %6d\n", offsetof(MIB_IF_ROW2, MediaType), sizeof(((MIB_IF_ROW2*)(NULL))->MediaType));
printf("PhysicalMediumType %6d %6d\n", offsetof(MIB_IF_ROW2, PhysicalMediumType), sizeof(((MIB_IF_ROW2*)(NULL))->PhysicalMediumType));
printf("AccessType %6d %6d\n", offsetof(MIB_IF_ROW2, AccessType), sizeof(((MIB_IF_ROW2*)(NULL))->AccessType));
printf("DirectionType %6d %6d\n", offsetof(MIB_IF_ROW2, DirectionType), sizeof(((MIB_IF_ROW2*)(NULL))->DirectionType));
printf("InterfaceAndOperStatusFlags %6d %6d\n", offsetof(MIB_IF_ROW2, InterfaceAndOperStatusFlags), sizeof(((MIB_IF_ROW2*)(NULL))->InterfaceAndOperStatusFlags));
printf("OperStatus %6d %6d\n", offsetof(MIB_IF_ROW2, OperStatus), sizeof(((MIB_IF_ROW2*)(NULL))->OperStatus));
printf("AdminStatus %6d %6d\n", offsetof(MIB_IF_ROW2, AdminStatus), sizeof(((MIB_IF_ROW2*)(NULL))->AdminStatus));
printf("MediaConnectState %6d %6d\n", offsetof(MIB_IF_ROW2, MediaConnectState), sizeof(((MIB_IF_ROW2*)(NULL))->MediaConnectState));
printf("NetworkGuid %6d %6d\n", offsetof(MIB_IF_ROW2, NetworkGuid), sizeof(((MIB_IF_ROW2*)(NULL))->NetworkGuid));
printf("ConnectionType %6d %6d\n", offsetof(MIB_IF_ROW2, ConnectionType), sizeof(((MIB_IF_ROW2*)(NULL))->ConnectionType));
printf("TransmitLinkSpeed %6d %6d\n", offsetof(MIB_IF_ROW2, TransmitLinkSpeed), sizeof(((MIB_IF_ROW2*)(NULL))->TransmitLinkSpeed));
printf("ReceiveLinkSpeed %6d %6d\n", offsetof(MIB_IF_ROW2, ReceiveLinkSpeed), sizeof(((MIB_IF_ROW2*)(NULL))->ReceiveLinkSpeed));
printf("InOctets %6d %6d\n", offsetof(MIB_IF_ROW2, InOctets), sizeof(((MIB_IF_ROW2*)(NULL))->InOctets));
printf("InUcastPkts %6d %6d\n", offsetof(MIB_IF_ROW2, InUcastPkts), sizeof(((MIB_IF_ROW2*)(NULL))->InUcastPkts));
printf("InNUcastPkts %6d %6d\n", offsetof(MIB_IF_ROW2, InNUcastPkts), sizeof(((MIB_IF_ROW2*)(NULL))->InNUcastPkts));
printf("InDiscards %6d %6d\n", offsetof(MIB_IF_ROW2, InDiscards), sizeof(((MIB_IF_ROW2*)(NULL))->InDiscards));
printf("InErrors %6d %6d\n", offsetof(MIB_IF_ROW2, InErrors), sizeof(((MIB_IF_ROW2*)(NULL))->InErrors));
printf("InUnknownProtos %6d %6d\n", offsetof(MIB_IF_ROW2, InUnknownProtos), sizeof(((MIB_IF_ROW2*)(NULL))->InUnknownProtos));
printf("InUcastOctets %6d %6d\n", offsetof(MIB_IF_ROW2, InUcastOctets), sizeof(((MIB_IF_ROW2*)(NULL))->InUcastOctets));
printf("InMulticastOctets %6d %6d\n", offsetof(MIB_IF_ROW2, InMulticastOctets), sizeof(((MIB_IF_ROW2*)(NULL))->InMulticastOctets));
printf("InBroadcastOctets %6d %6d\n", offsetof(MIB_IF_ROW2, InBroadcastOctets), sizeof(((MIB_IF_ROW2*)(NULL))->InBroadcastOctets));
printf("OutOctets %6d %6d\n", offsetof(MIB_IF_ROW2, OutOctets), sizeof(((MIB_IF_ROW2*)(NULL))->OutOctets));
printf("OutUcastPkts %6d %6d\n", offsetof(MIB_IF_ROW2, OutUcastPkts), sizeof(((MIB_IF_ROW2*)(NULL))->OutUcastPkts));
printf("OutNUcastPkts %6d %6d\n", offsetof(MIB_IF_ROW2, OutNUcastPkts), sizeof(((MIB_IF_ROW2*)(NULL))->OutNUcastPkts));
printf("OutDiscards %6d %6d\n", offsetof(MIB_IF_ROW2, OutDiscards), sizeof(((MIB_IF_ROW2*)(NULL))->OutDiscards));
printf("OutErrors %6d %6d\n", offsetof(MIB_IF_ROW2, OutErrors), sizeof(((MIB_IF_ROW2*)(NULL))->OutErrors));
printf("OutUcastOctets %6d %6d\n", offsetof(MIB_IF_ROW2, OutUcastOctets), sizeof(((MIB_IF_ROW2*)(NULL))->OutUcastOctets));
printf("OutMulticastOctets %6d %6d\n", offsetof(MIB_IF_ROW2, OutMulticastOctets), sizeof(((MIB_IF_ROW2*)(NULL))->OutMulticastOctets));
printf("OutBroadcastOctets %6d %6d\n", offsetof(MIB_IF_ROW2, OutBroadcastOctets), sizeof(((MIB_IF_ROW2*)(NULL))->OutBroadcastOctets));
printf("OutQLen %6d %6d\n", offsetof(MIB_IF_ROW2, OutQLen), sizeof(((MIB_IF_ROW2*)(NULL))->OutQLen));
system("PAUSE");
return 0;
}
Gibts dafür eigentlich keine Definitionsdateien wo man nicht erst alle includes abklappern muss?
Und noch was: für GUIDs gibts doch in PB bereits ne Struktur oder nicht? Das wär doch irgendwie sinnvoller als ein byte-array.