Platform SDK: Network Management

USE_INFO_2

The USE_INFO_2 structure contains information about a connection between a local computer and a shared resource, including connection type, connection status, user name, and domain name.

typedef struct _USE_INFO_2 {
  LPWSTR   ui2_local;
  LPWSTR   ui2_remote;
  LPWSTR   ui2_password;
  DWORD    ui2_status;
  DWORD    ui2_asg_type;
  DWORD    ui2_refcount;
  DWORD    ui2_usecount;
  LPWSTR   ui2_username;
  LPWSTR   ui2_domainname;
}USE_INFO_2, *PUSE_INFO_2, *LPUSE_INFO_2;

Members

ui2_local
Pointer to a Unicode string that contains the local device name (for example, drive E or LPT1) being redirected to the shared resource. The constant DEVLEN specifies the maximum number of characters in the string. This member can be NULL. For more information, see the following Remarks section.
ui2_remote
Pointer to a Unicode string that specifies the share name of the remote resource. The string is in the form
\\servername\sharename
 
ui2_password
Pointer to a Unicode string that contains the password needed to establish a session with a specific workstation.
ui2_status
Specifies the status of the connection. This element is not used by the NetUseAdd function. The following values are defined.
Value Meaning
USE_OK The connection is successful.
USE_PAUSED Paused by a local workstation.
USE_SESSLOST Disconnected.
USE_DISCONN An error occurred.
USE_NETERR A network error occurred.
USE_CONN The connection is being made.
SE_RECONN Reconnecting.

ui2_asg_type
Specifies the type of remote resource being accessed. This member can be one of the following values.
Value Meaning
USE_WILDCARD Matches the type of the server's shared resources. Wildcards can be used only with the NetUseAdd function, and only when the ui2_local member is a null string. For more information, see the following Remarks section.
USE_DISKDEV Disk device.
USE_SPOOLDEV Spooled printer.
USE_IPC Interprocess communication (IPC).

ui2_refcount
Specifies the number of files, directories, and other processes that are open on the remote resource. This element is not used by the NetUseAdd function.
ui2_usecount
Specifies the number of explicit connections (redirection with a local device name) or implicit UNC connections (redirection without a local device name) that are established with the resource.
ui2_username
Pointer to the name of the user who initiated the connection.
ui2_domainname
Pointer to the domain name of the remote resource.

Remarks

Specifying a NULL ui2_local member requests authentication with the server without redirecting a drive letter or a device. Future redirections involving the server while the same connection is in effect use the authentication information specified in the initial call to the NetUseAdd function. This information includes the combination of the ui2_password, ui2_username, and ui2_domainname members.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Lmuse.h.

See Also

Network Management Overview, Network Management Structures, Use Functions, NetUseAdd, NetUseEnum, NetUseGetInfo