次の方法で共有


NetBIOS Provider

[Function Discovery is available for use in the following versions of Windows: Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7, Windows Server 2008, and Windows Vista. It may be altered or unavailable in subsequent versions.]

The NetBIOS provider is an asynchronous network provider that enumerates resources discoverable by NetBIOS and responds to function instance queries for NetBIOS devices. The NetBIOS provider can enumerate WNet network providers, domains, servers, and shares. Any resource that is discoverable by the WNet API can be discovered by the NetBIOS provider. For more information about the WNet API, see Windows Networking (WNet).

Query Results

The NetBIOS provider only supports collection queries. Instance queries are not supported. Collection queries are executed by calling IFunctionInstanceCollectionQuery::Execute. Because the NetBIOS provider is asynchronous, Execute always returns E_PENDING for a successful query.

Results are returned using IFunctionDiscoveryNotification::OnUpdate. In addition, after the NetBIOS provider has finished enumerating resources, the provider sends a FD_EVENTID_SEARCHCOMPLETE notification using IFunctionDiscoveryNotification::OnEvent.

Query Constraints

A query constraint can be added by calling IFunctionInstanceCollectionQuery::AddQueryConstraint on an IFunctionInstanceCollectionQuery object before executing the query.

The following table shows the query constraints supported by the NetBIOS provider. The table also shows possible values to pass to the pszConstraintValue parameter of the AddQueryConstraint method.

Constraint Name Possible Values Remarks
PROVIDERWNET_QUERYCONSTRAINT_TYPE All
Server
Domain
Specifies the resource display types to be enumerated by the NetBIOS provider. By default, the NetBIOS provider enumerates resources with a display type less than or equal to RESOURCEDISPLAYTYPE_SERVER, which means that files and printers are not returned. The default setting is equivalent to applying this constraint with a value of Server. If this constraint has a value of All, the NetBIOS provider enumerates all discoverable resources. If this constraint has a value of Server, the NetBIOS provider enumerates resources with a display type less than or equal to RESOURCEDISPLAYTYPE_SERVER, which means that files and printers are not returned. If this constraint has a value of Domain, the NetBIOS provider enumerates resources with a display type less than or equal to RESOURCEDISPLAYTYPE_DOMAIN, which means that servers, files, and printers are not returned.
Each enumerated resource is returned in the query results, unless the PROVIDERWNET_QUERYCONSTRAINT_RESOURCETYPE constraint is also supplied.
PROVIDERWNET_QUERYCONSTRAINT_PROPERTIES All
Limited
Specifies the properties in the property store to be populated from the NETRESOURCE structure. By default, the NetBIOS provider populates only the PKEY_WNET_DisplayType and PKEY_WNET_Comment PKEYs from the NETRESOURCE structure. The default setting is equivalent to applying this constraint with a value of Limited. If this constraint has a value of All, the NetBIOS provider populates all WNet properties in the property store from the NETRESOURCE structure.
PROVIDERWNET_QUERYCONSTRAINT_RESOURCETYPE Disk
Printer
DiskOrPrinter
Specifies the resource types to be returned by the NetBIOS provider in the query results. This constraint does not change the types of resources enumerated by the provider, it only changes the query results returned by the provider. This constraint is not specified by default. If this constraint is used, then the PROVIDERWNET_QUERYCONSTRAINT_TYPE must be applied with a value of All.If this constraint has a value of Disk, only disk shares (with a display type of RESOURCEDISPLAYTYPE_SHARE and a resource type of RESOURCETYPE_DISK) are returned in the query results. If this constraint has a value of Printer, only printer shares (display type of RESOURCEDISPLAYTYPE_SHARE and a resource type of RESOURCETYPE_PRINTER) are returned in the query results. If this constraint has a value of DiskOrPrinter, then only disk and printer shares (with a display type of RESOURCEDISPLAYTYPE_SHARE) are returned in the query results.

For more information about a named constraint, see Constraint Definitions. For general information about query constraints, see Constraints.

The FD_QUERYCONSTRAINT_PROVIDERINSTANCEID, FD_QUERYCONSTRAINT_SUBCATEGORY, and the FD_QUERYCONSTRAINT_VISIBILITY constraints are not supported by the NetBIOS Provider.

Property Store

The NetBIOS provider implements read-only property stores.

The IFunctionInstance::OpenPropertyStore method can be used to access the property keys (PKEYs) associated with a NetBIOS function instance. The methods of the IPropertyStore interface can be used to get the PKEYs associated with the function instance.

Supported PKEYs

The following table shows the PnP-X PKEYs supported by the NetBIOS provider, and the values assigned to the keys. For more information, see PnP-X Provider PKEYs.

PKEY Description of PKEY Value
PKEY_PNPX_DeviceCategory For servers (resources with a display type of RESOURCEDISPLAYTYPE_SERVER), this key has the value Computer.For disk shares (resources with a resource type of RESOURCETYPE_DISK), this key has the value Storage.
For printer shares (resources with a resource type of RESOURCETYPE_PRINTER), this key has the value Printer.
PKEY_PNPX_NetworkInterfaceGuid The NetBIOS provider determines the GUID by calling GetBestInterfaceEx on the first server discovered in a domain, and then stores the results in this PKEY.
PKEY_PNPX_NetworkInterfaceLuid The NetBIOS provider converts the network interface GUID to a LUID, and then stores the results in this PKEY.
PKEY_PNPX_DomainName For domains (resources with a display type RESOURCEDISPLAYTYPE_DOMAIN), the value of this key is set to the lpRemoteName member of the NETRESOURCE structure associated with the resource. For servers or other resources discovered within a domain container, the value of this key is set to the lpRemoteName member of the NETRESOURCE structure associated with the parent domain resource.
PKEY_PNPX_ShareName For shares (resources with a display type of RESOURCEDISPLAYTYPE_SHARE), the value of this key is set to the lpRemoteName member of the NETRESOURCE structure associated with the resource.

In addition, the PKEYs described in the topic WNet Provider PKEYs are supported by the NetBIOS provider.

Built-in Providers