Share via


SetIPSecMode (Windows CE 5.0)

Send Feedback

This function is used to configure the IPSec mode.

 HRESULT SetIPSecMode(  IPSEC_API_MODE_INFO modeInfo,  DWORD flags);

Parameters

  • modeInfo
    [in] Mode info as specified in the IPSEC_API_MODE_INFO structure.
  • flags
    [in] This parameter can be set to one of the following flags:
    Flag Description
    IPSEC_API_NO_ICMP_EXEMPT The Internet Control Messaging Protocol (ICMP) is not exempt from IPSec.
    IPSEC_API_NO_SPECIALSERVERS_EXEMPT Special servers (DNS< DHCP, Gateway, WINS) are not exempt from IPSec.
    IPSEC_API_APPLY_TO_ALL_SRC_IP Apply IPSec policy to all source IP address. This flag should be set if the srcIP field of modeInfo is set to zero.

Return Values

Returns S_OK if successful, or an appropriate HRESULT value otherwise.

Remarks

You can also use this function to modify any IPSec configuration parameters. SetIPSecMode should be called after a successful call to StartIPSec. If the IPSec mode has already been set, the call to SetIPSecMode will fail with an HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION) error code.

To set a different IPSec mode, you cannot call SetIPSecMode consecutively, but you instead must call ResetIPSecMode before calling SetIPSecMode again. It is also recommended that, in addition to calling ResetIPSecMode, you restart IPSec by calling StopIPSec and StartIPSec in sequence. After calling ResetIPMode and restarting IPSec you can call SetIPSecMode and specify a new mode.

If a call to SetIPSecMode has failed, any calls to ResetIPSecMode will also fail.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Ipsec_api.h.
Link Library: Ipsec_api.lib.

See Also

StartIPSec | StopIPSec | ResetIPSecMode | IPSEC_API_MODE_INFO

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.