MprAdminInterfaceCreate

[This is preliminary documentation and subject to change.]

The MprAdminInterfaceCreate function creates an interface on a specified server.

DWORD MprAdminInterfaceCreate(
  MPR_SERVER_HANDLE hMprServer,  // handle to router
  DWORD dwLevel,                 // level of information provided
  LPBYTE lpBuffer,               // info that describes interface
  HANDLE *phInterface            // handle to the interface
);

Parameters

hMprServer
[in] Handle to the Windows 2000 router on which to execute this call. Obtain this handle by calling MprAdminServerConnect.
dwLevel
[in] Specifies the level of information passed in lpBuffer. Must be zero, indicating that the lpBuffer parameter points to the MPR_INTERFACE_0 structure.

Windows 2000 and later: The dwLevel parameter may have a value of zero, one, or two. A value of one indicates that lpBuffer points to an MPR_INTERFACE_1 structure. A value of two indicates that lpBuffer points to an MPR_INTERFACE_2 structure.

lpBuffer
[in] Pointer to an MPR_INTERFACE_0 structure that contains the information to create the interface. The hInterface member of this structure is ignored.

Windows 2000 and later: The lpBuffer parameter points to either an MPR_INTERFACE_0, MPR_INTERFACE_1, or MPR_INTERFACE_2 structure. The dwLevel parameter indicates the type of structure.

phInterface
[out] Pointer to a HANDLE variable. The variable receives a handle to use in all subsequent calls to manage this interface.

Return Values

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Value Meaning
ERROR_ACCESS_DENIED The calling application does not have sufficient privileges.
ERROR_DDM_NOT_RUNNING The router interface type specified in the MPR_INTERFACE_0 or MPR_INTERFACE_1 structure is not supported because the Dynamic Interface Manager is configured to run only on a LAN.
ERROR_INTERFACE_ALREADY_EXISTS An interface with the same name already exists.
ERROR_NOT_ENOUGH_MEMORY Insufficient resources to complete the operation.
ERROR_NOT_SUPPORTED The dwLevel value is invalid.

Remarks

Windows 2000 and later: The MprAdminInterfaceCreate function supports the MPR_INTERFACE_2 structure. However, MprConfigInterfaceCreate does not. In order to create a demand-dial interface that is persistent after a reboot, call MprAdminInterfaceCreate with MPR_INTERFACE_2, then call MprConfigInterfaceCreate with MPR_INTERFACE_0 or MPR_INTERFACE_1.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Mprapi.h.
  Library: Use Mprapi.lib.

See Also

Router Management Reference, Router Administration Functions, MPR_INTERFACE_0, MPR_INTERFACE_1, MPR_INTERFACE_2, MprAdminInterfaceDelete, MprAdminServerConnect