VirtualBox

Changeset 17502 in vbox


Ignore:
Timestamp:
Mar 6, 2009 5:48:04 PM (16 years ago)
Author:
vboxsync
Message:

NetIf/win: fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/win/NetIfList-win.cpp

    r17501 r17502  
    799799struct StaticIpConfig
    800800{
    801     RTNETADDRIPV4  IPAddress;
    802     RTNETADDRIPV4  IPNetMask;
     801    ULONG  IPAddress;
     802    ULONG  IPNetMask;
    803803};
    804804
    805805struct StaticIpV6Config
    806806{
    807     RTNETADDRIPV6  IPV6Address;
    808     RTNETADDRIPV6  IPV6NetMaskLength;
     807    BSTR           IPV6Address;
     808    ULONG          IPV6NetMaskLength;
    809809};
    810810
     
    941941                        /* no parameters */
    942942                        rc = S_OK;
     943                        endLoop = true;
     944                        break;
     945                    }
     946                    case SVCHlpMsg::Error:
     947                    {
     948                        /* read the error message */
     949                        Utf8Str errMsg;
     950                        vrc = aClient->read (errMsg);
     951                        if (RT_FAILURE (vrc)) break;
     952
     953                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     954                        endLoop = true;
     955                        break;
     956                    }
     957                    default:
     958                    {
     959                        endLoop = true;
     960                        rc = E_FAIL; // TODO: ComAssertMsgFailedBreak ((
     961                            //"Invalid message code %d (%08lX)\n",
     962                            //reply, reply),
     963                            //rc = E_FAIL);
     964                    }
     965                }
     966            }
     967
     968            break;
     969        }
     970        case SVCHlpMsg::EnableDynamicIpConfig: /* see usage in code */
     971        {
     972            LogFlowFunc (("EnableDynamicIpConfig:\n"));
     973            LogFlowFunc (("Network connection name = '%ls'\n", d->name.raw()));
     974
     975            /* write message and parameters */
     976            vrc = aClient->write (d->msgCode);
     977            if (RT_FAILURE (vrc)) break;
     978            vrc = aClient->write (Utf8Str (d->name));
     979            if (RT_FAILURE (vrc)) break;
     980
     981            /* wait for a reply */
     982            bool endLoop = false;
     983            while (!endLoop)
     984            {
     985                SVCHlpMsg::Code reply = SVCHlpMsg::Null;
     986
     987                vrc = aClient->read (reply);
     988                if (RT_FAILURE (vrc)) break;
     989
     990                switch (reply)
     991                {
     992                    case SVCHlpMsg::OK:
     993                    {
     994                        /* no parameters */
     995                        rc = d->iface->updateConfig();
     996                        endLoop = true;
     997                        break;
     998                    }
     999                    case SVCHlpMsg::Error:
     1000                    {
     1001                        /* read the error message */
     1002                        Utf8Str errMsg;
     1003                        vrc = aClient->read (errMsg);
     1004                        if (RT_FAILURE (vrc)) break;
     1005
     1006                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     1007                        endLoop = true;
     1008                        break;
     1009                    }
     1010                    default:
     1011                    {
     1012                        endLoop = true;
     1013                        rc = E_FAIL; // TODO: ComAssertMsgFailedBreak ((
     1014                            //"Invalid message code %d (%08lX)\n",
     1015                            //reply, reply),
     1016                            //rc = E_FAIL);
     1017                    }
     1018                }
     1019            }
     1020
     1021            break;
     1022        }
     1023        case SVCHlpMsg::EnableStaticIpConfig: /* see usage in code */
     1024        {
     1025            LogFlowFunc (("EnableStaticIpConfig:\n"));
     1026            LogFlowFunc (("Network connection name = '%ls'\n", d->name.raw()));
     1027
     1028            /* write message and parameters */
     1029            vrc = aClient->write (d->msgCode);
     1030            if (RT_FAILURE (vrc)) break;
     1031            vrc = aClient->write (Utf8Str (d->name));
     1032            if (RT_FAILURE (vrc)) break;
     1033            vrc = aClient->write (d->u.StaticIP.IPAddress);
     1034            if (RT_FAILURE (vrc)) break;
     1035            vrc = aClient->write (d->u.StaticIP.IPNetMask);
     1036            if (RT_FAILURE (vrc)) break;
     1037
     1038            /* wait for a reply */
     1039            bool endLoop = false;
     1040            while (!endLoop)
     1041            {
     1042                SVCHlpMsg::Code reply = SVCHlpMsg::Null;
     1043
     1044                vrc = aClient->read (reply);
     1045                if (RT_FAILURE (vrc)) break;
     1046
     1047                switch (reply)
     1048                {
     1049                    case SVCHlpMsg::OK:
     1050                    {
     1051                        /* no parameters */
     1052                        rc = d->iface->updateConfig();
     1053                        endLoop = true;
     1054                        break;
     1055                    }
     1056                    case SVCHlpMsg::Error:
     1057                    {
     1058                        /* read the error message */
     1059                        Utf8Str errMsg;
     1060                        vrc = aClient->read (errMsg);
     1061                        if (RT_FAILURE (vrc)) break;
     1062
     1063                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     1064                        endLoop = true;
     1065                        break;
     1066                    }
     1067                    default:
     1068                    {
     1069                        endLoop = true;
     1070                        rc = E_FAIL; // TODO: ComAssertMsgFailedBreak ((
     1071                            //"Invalid message code %d (%08lX)\n",
     1072                            //reply, reply),
     1073                            //rc = E_FAIL);
     1074                    }
     1075                }
     1076            }
     1077
     1078            break;
     1079        }
     1080        case SVCHlpMsg::EnableStaticIpConfigV6: /* see usage in code */
     1081        {
     1082            LogFlowFunc (("EnableStaticIpConfigV6:\n"));
     1083            LogFlowFunc (("Network connection name = '%ls'\n", d->name.raw()));
     1084
     1085            /* write message and parameters */
     1086            vrc = aClient->write (d->msgCode);
     1087            if (RT_FAILURE (vrc)) break;
     1088            vrc = aClient->write (Utf8Str (d->name));
     1089            if (RT_FAILURE (vrc)) break;
     1090            vrc = aClient->write (Utf8Str(d->u.StaticIPV6.IPV6Address));
     1091            if (RT_FAILURE (vrc)) break;
     1092            vrc = aClient->write (d->u.StaticIPV6.IPV6NetMaskLength);
     1093            if (RT_FAILURE (vrc)) break;
     1094
     1095            /* wait for a reply */
     1096            bool endLoop = false;
     1097            while (!endLoop)
     1098            {
     1099                SVCHlpMsg::Code reply = SVCHlpMsg::Null;
     1100
     1101                vrc = aClient->read (reply);
     1102                if (RT_FAILURE (vrc)) break;
     1103
     1104                switch (reply)
     1105                {
     1106                    case SVCHlpMsg::OK:
     1107                    {
     1108                        /* no parameters */
     1109                        rc = d->iface->updateConfig();
    9431110                        endLoop = true;
    9441111                        break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette