Use Level 1
struct use_info_1 {
unsigned char ui1_local[DEVLEN+1];
unsigned char ui1_pad_1;
unsigned char LSFAR * LSPTR ui1_remote;
unsigned char LSFAR * LSPTR ui1_password;
unsigned short ui1_status;
short ui1_asg_type;
unsigned short ui1_refcount;
unsigned short ui1_usecount;
};
where:
- The first two fields in this data structure are identical
to those in the previous level.
- ui1_remote points to an ASCIIZ string specifying
the UNC name of the remote resource being accessed. The string must be in
the form \\servername\netname.
- ui1_password points to an ASCIIZ string containing
the password needed to establish a session between a specific requester
and server. This field is used only by NetUseAdd.
- ui1_status specifies the status of the connection.
The following values for ui1_status are defined in the USE.H header
file: ┌────────────────────┬───────┬─────────────────────────────────────────────────┐
│ SYMBOLIC CONSTANT │ VALUE │ MEANING │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_OK │ 0 │ Connection valid. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_PAUSED │ 1 │ Paused by local requester. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_SESSLOST │ 2 │ Session removed. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_DISCONN │ 2 │ Connection disconnected. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_NETERR │ 3 │ Network error. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_CONN │ 4 │ Connection being made. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_RECONN │ 5 │ Reconnecting. │
└────────────────────┴───────┴─────────────────────────────────────────────────┘
- ui1_asg_type specifies the type of remote resource
being accessed. The following types of resources are defined in USE.H: ┌────────────────────┬───────┬─────────────────────────────────────────────────┐
│ SYMBOLIC CONSTANT │ VALUE │ MEANING │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_WILDCARD │ -1 │ Matches the type of the share of the server.
│
│ │ │ (Wildcards are used only when ui1_local is a │
│ │ │ null string.) │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_DISKDEV │ 0 │ Disk device. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_SPOOLDEV │ 1 │ Spooled printer. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_CHARDEV │ 2 │ Serial device. │
├────────────────────┼───────┼─────────────────────────────────────────────────┤
│ USE_IPC │ 3 │ Interprocess communication (IPC). │
└────────────────────┴───────┴─────────────────────────────────────────────────┘
To establish a connection with a null local device, set the asg_type
field to USE_WILDCARD (-1). To establish a connection that maps a local
device to the resource, use one of the other four values defined in the
previous table.
- ui1_refcount indicates the number of files,
directories, and other processes that are open on the remote resource.
- ui1_usecount indicates the number of explicit
connections (redirection of a local device name) or implicit UNC connections
(redirection of a null local device name) that are established with the
resource.
If both an explicit and an implicit connection exist between a requester
and a resource, the usecount of the server is 1 and the usecount
of the requester is 2.
[Back: Use Level 0]
[Next: NetUseAdd or Net32UseAdd]