NETRESOURCEA structure (winnetwk.h)
The following structure contains information about a network resource. It is used by several of the network provider functions, including NPOpenEnum and NPAddConnection.
Syntax
typedef struct _NETRESOURCEA {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPSTR lpLocalName;
LPSTR lpRemoteName;
LPSTR lpComment;
LPSTR lpProvider;
} NETRESOURCEA, *LPNETRESOURCEA;
Members
dwScope
Indicates the scope of the enumeration. This can be one of the following values.
dwType
Indicates the resource type. This can be one of the following values.
dwDisplayType
Set by the provider to indicate what display type a user interface should use to represent this resource. The following types are defined.
dwUsage
A bitmask that indicates how you can enumerate information about the resource. It is defined only if dwScope is set to RESOURCE_GLOBALNET. The dwUsage field can contain one or more of the following flags.
Value | Meaning |
---|---|
|
You can connect to the resource by calling NPAddConnection. If dwType is RESOURCETYPE_DISK, then, after you have connected to the resource, you can use the file system APIs, such as FindFirstFile, and FindNextFile, to enumerate any files and directories the resource contains. |
|
The resource is a container for other resources that can be enumerated by means of the
NPOpenEnum,
NPEnumResource, and
NPCloseEnum functions.
The container may, however, be empty at the time the enumeration is made. In other words, the first call to NPEnumResource may return WN_NO_MORE_ENTRIES. |
lpLocalName
If dwScope is RESOURCE_CONNECTED, the lpLocalName field contains the name of a redirected device. If the connection is a deviceless connection, this field contains NULL.
If dwScope is not set to RESOURCE_CONNECTED, this field is undefined.
lpRemoteName
If the enumerated item is a network resource, this field contains a remote network name. This name may be then passed to NPAddConnection to make a network connection if dwUsage is set to RESOURCEUSAGE_CONNECTABLE. If the enumerated item is a current connection, this field will refer to the remote network name that lpLocalName is connected to.
lpComment
May be any provider-supplied comment associated with the enumerated item.
lpProvider
Specifies the name of the provider that owns this enumerated item.
Remarks
Note
The winnetwk.h header defines NETRESOURCE as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header | winnetwk.h |