EN
本內容沒有您的語言版本,但有英文版本。

BluetoothSdpGetContainerElementData function

The BluetoothSdpGetContainerElementData function iterates a container stream and returns each element contained within the container element.

Syntax


DWORD BluetoothSdpGetContainerElementData(
  _In_     LPBYTE pContainerStream,
  _In_     ULONG cbContainerLength,
  _Inout_  HBLUETOOTH_CONTAINER_ELEMENT *pElement,
  _Out_    PSDP_ELEMENT_DATA pData
);

Parameters

pContainerStream [in]

A pointer to valid SDP stream. The first element in the stream must be a sequence or an alternative.

cbContainerLength [in]

The size, in bytes, of the pContainerStream parameter.

pElement [in, out]

A value used to track the location in the stream. The first time the BluetoothSdpGetContainerElementData function is called for a container, *pElement should be NULL. For subsequent calls, the value should be unmodified.

pData [out]

A pointer to a buffer filled with data from the current SDP element of pContainerStream.

Return value

Returns ERROR_SUCCESS upon success, indicating that the pData parameter contains the data. Returns error codes upon failure. The following table describes common error codes associated with the BluetoothSdpGetContainerElementData function:

Return codeDescription
ERROR_NO_MORE_ITEMS

There are no more items in the list. The caller should stop calling the BluetoothSdpGetContainerElementData function for this container.

ERROR_INVALID_PARAMETER

A required pointer is NULL, or the container is not a valid SDP stream.

 

Examples


#include <windows.h>
#include <bluetoothapis.h>


typedef int HBLUETOOTH_CONTAINER_ELEMENT;
typedef int SDP_ELEMENT_DATA;

void main()
{
 HBLUETOOTH_CONTAINER_ELEMENT element;
 SDP_ELEMENT_DATA data;
 LPBYTE ContainerStream;
 ULONG ContainerLength;
 ULONG result;
 element = NULL;

 while (TRUE) {
      result = BluetoothSdpGetContainerElementData(
          ContainerStream, ContainerLength, element, data);

      if (result == ERROR_NO_MORE_ITEMS) {
          // Operation is complete.
          break;
      }
      else if (result != ERROR_SUCCESS) {
          // error
      }

      // Perform another data operation.
      }

}


Requirements

Minimum supported client

Windows Vista, Windows XP with SP2 [desktop apps only]

Minimum supported server

None supported

Header

BluetoothAPIs.h (include Bthsdpdef.h or BluetoothAPIs.h)

Library

Bthprops.lib

DLL

Bthprops.dll

See also

BluetoothSdpEnumAttributes
BluetoothSdpGetElementData
BluetoothSdpGetString
SDP_ELEMENT_DATA
SDP_STRING_TYPE_DATA

 

 

社群新增項目

新增
顯示:
© 2014 Microsoft