Changeset 12394 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Sep 11, 2008 7:29:28 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfoNet.cpp
r12393 r12394 17 17 int vboxVMInfoNet(VBOXINFORMATIONCONTEXT* a_pCtx) 18 18 { 19 DWORD dwCurIface = 0;20 21 19 SOCKET sd = WSASocket(AF_INET, SOCK_DGRAM, 0, 0, 0, 0); 22 20 if (sd == SOCKET_ERROR) … … 39 37 char szTemp [_MAX_PATH+1] = {0}; 40 38 int nNumInterfaces = nBytesReturned / sizeof(INTERFACE_INFO); 39 int iCurIface = 0; 41 40 42 41 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/Count"); 43 42 vboxVMInfoWritePropInt(a_pCtx, szPropPath, (nNumInterfaces > 1 ? nNumInterfaces-1 : 0)); 44 45 dwCurIface = 0;46 43 47 44 for (int i = 0; i < nNumInterfaces; ++i) … … 52 49 sockaddr_in *pAddress; 53 50 pAddress = (sockaddr_in *) & (InterfaceList[i].iiAddress); 54 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/IP", i );51 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/IP", iCurIface); 55 52 vboxVMInfoWriteProp(a_pCtx, szPropPath, inet_ntoa(pAddress->sin_addr)); 56 53 57 54 pAddress = (sockaddr_in *) & (InterfaceList[i].iiBroadcastAddress); 58 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Broadcast", i );55 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Broadcast", iCurIface); 59 56 vboxVMInfoWriteProp(a_pCtx, szPropPath, inet_ntoa(pAddress->sin_addr)); 60 57 61 58 pAddress = (sockaddr_in *) & (InterfaceList[i].iiNetmask); 62 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Netmask", i );59 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Netmask", iCurIface); 63 60 vboxVMInfoWriteProp(a_pCtx, szPropPath, inet_ntoa(pAddress->sin_addr)); 64 61 … … 69 66 RTStrPrintf(szTemp, sizeof(szTemp), "Down"); 70 67 71 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/Status", i );68 RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/Status", iCurIface); 72 69 vboxVMInfoWriteProp(a_pCtx, szPropPath, szTemp); 70 71 iCurIface++; 73 72 } 74 73
Note:
See TracChangeset
for help on using the changeset viewer.