首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

[]CreateIpForwardEntry 添加路由失败(返回值为0)

2013-01-08 
[求助]CreateIpForwardEntry 添加路由失败(返回值为0)大神些 我用CreateIpForwardEntry添加路由,为什么在

[求助]CreateIpForwardEntry 添加路由失败(返回值为0)
大神些 
我用CreateIpForwardEntry添加路由,为什么在某一台机器上怎么都添加不上去,在其他机器都添加上去了,虽然添加不上去但是api还是返回的成功,操作系统为2003 sp1(不是所有sp1都添加失败)

cmd 里面 route add命令能添加成功


[解决办法]
权限问题?
仅供参考:
CreateIpForwardEntrySee Also
IP Helper Functions 
[解决办法]
 DeleteIpForwardEntry 
[解决办法]
 MIB_IPFORWARDROW 
[解决办法]
 SetIpForwardEntry

Requirements
OS Versions: Windows CE 3.0 and later.
Header: Iphlpapi.h.
Link Library: Iphlpapi.lib.
This function creates a route in the local computer's IP routing table.

DWORD CreateIpForwardEntry( 
  PMIB_IPFORWARDROW pRoute
);
Parameters
pRoute 
[in] Pointer to a MIB_IPFORWARDROW structure that contains the information for the new route. The caller must specify values for all members of this structure. The caller must specify PROTO_IP_NETMGMT for the dwForwardProto member of MIB_IPFORWARDROW. 
Return Values
Returns NO_ERROR if successful. If the function fails, it returns an error code. For a complete list of error codes, see Error Values or the SDK header file Winerror.h.

Remarks
To modify an existing route in the IP routing table, use the SetIpForwardEntry function.

The caller should not specify a routing protocol — for example, PROTO_IP_OSPF — for the dwForwardProto member of the MIB_IPFORWARDROW structure. Routing protocol identifiers are used only to identify route information received through the specified routing protocol. For example, PROTO_IP_OSPF is used only to identify route information received through the OSPF routing protocol.

The dwForwardPolicy member of the MIB_IPFORWARDROW structure is currently unused. The caller should specify zero for this member.

Requirements
OS Versions: Windows CE 3.0 and later.
Header: Iphlpapi.h.
Link Library: Iphlpapi.lib.

See Also
IP Helper Functions 
[解决办法]
 DeleteIpForwardEntry 
[解决办法]
 MIB_IPFORWARDROW 
[解决办法]
 SetIpForwardEntry


热点排行