⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdpcommon.h

📁 Windows CE操作系统中适用的蓝牙驱动程序
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
// SdpCommon.h: Commonly used functions...


ISdpRecord *CreateSDPRecordFromStream(UCHAR *szResponse, DWORD cbResponse);

STDMETHODIMP
ServiceAndAttributeSearchParse(
    UCHAR *szResponse,             // in - response returned from SDP ServiceAttribute query
    DWORD cbResponse,            // in - length of response
    ISdpRecord ***pppSdpRecords, // out - array of pSdpRecords
    ULONG *pNumRecords           // out - number of elements in pSdpRecords
    );


// Function type for when printing to PrintRecordInfo
typedef void (*PFN_SDPPRINT)(PVOID pvContext, BOOL fError, WCHAR *szFormat,...);

void PrintRecordInfo(ISdpRecord *pRecord, int iRecordIndex, PFN_SDPPRINT pfnPrint, PVOID pvContext);

const WCHAR *GetAttribFromID(USHORT usAttribId);


void SdpPrintAttribUUIDs(UCHAR *pStream, ULONG size, PFN_SDPPRINT pfnPrint, PVOID pvContext);
const WCHAR *GetErrorFromId(USHORT usErrCode);
const WCHAR *GetPduNameFromId(UCHAR id);



// When calling ISdpRecord::GetAttribute(), if the returned type is to be an URL 
// or STRING the function allocates the string.  This simple wrapper guarantees
// that the string is automatically freed.  Also use this for GetNodeStringData()

class CNodeDataFreeString : public NodeData {
public:
	CNodeDataFreeString() {
		type = SDP_TYPE_NIL;
	}

	~CNodeDataFreeString() {
		if (type == SDP_TYPE_STRING)
			CoTaskMemFree(u.str.val);
		else if (type == SDP_TYPE_URL)
			CoTaskMemFree(u.url.val);
	}
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -