WNetSetConnection

This function is used to change the characteristics of a network connection.

DWORD WNetSetConnection(
    LPCTSTR lpName,
    DWORD dwProperty,
    LPVOID pvValue
    );
 
lpName
The name of either the redirected local device or a remote network resource.
dwProperty
A value representing the type of property to change. There is currently only one property type:
NETPROPERTY_PERSISTENT the persistent property. The corresponding property value is a DWORD. lpName must be the name of a redirected local device. If the property value is TRUE, the connection is made persistent with the current user authentication. . If the property value is FALSE, then the connection is made no longer persistent without breaking any current connection to the network (if not currently connected to the network, this is the same effect as cancelling the connection).

pvValue
Pointer to the property value for the property type supplied. The data type of the property value depends upon the property type.
WN_NOT_CONNECTED lpName not a redirected device