Share via


WSALookupServiceBegin (Bluetooth) (Compact 2013)

3/26/2014

This function initiates a client query that is constrained by the information contained within a WSAQUERYSET (Bluetooth) structure.

Syntax

INT WSALookupServiceBegin(
  LPWSAQUERYSET pQuerySet,
  DWORD dwFlags,
  LPHANDLE lphLookup
);

Parameters

  • pQuerySet
    [in] Pointer to the search criteria.
  • dwFlags
    [in] The following table shows a list of flags for this parameter.

    Flag

    Description

    LUP_CONTAINERS

    Specifies that device discovery is to be performed. If this flag is not set, service discovery will be performed instead.

    LUP_RES_SERVICE

    Searches the local Service Discovery Protocol (SDP) database. Clear this flag to search for services on a peer device.

Return Value

Returns zero on success; otherwise SOCKET_ERROR. The specific error code can be retrieved by calling WSAGetLastError.

Remarks

Note

This function is actually a Winsock function. However, the information that is presented in it is specific to Bluetooth.

If LUP_CONTAINERS is set, SDP performs a device inquiry to find other Bluetooth devices in the area. This function performs the query. The WSALookupServiceNext function retrieves the results one device at a time.

You can specify extra parameters for device inquiries by having the WSAQUERYSET.lpBlob point to a BTHNS_INQUIRYBLOB structure.

If LUP_CONTAINERS is not set, an SDP service search is performed. The WSAQUERYSET.lpBlob must point to a BTHNS_RESTRICTIONBLOB data structure.

Requirements

Header

winsock2.h

Library

Ws2.lib

See Also

Reference

Bluetooth API Miscellaneous Functions
BTHNS_INQUIRYBLOB
BTHNS_RESTRICTIONBLOB
WSALookupServiceEnd (Bluetooth)
WSALookupServiceNext (Bluetooth)
WSAQUERYSET (Bluetooth)