1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
PURPOSE.
Module Name:
CLISRV.h
Abstract:
Header file for functions common to bth echo server and client
Environment:
Kernel mode
--*/
#pragma once
#include <ntddk.h>
#include <wdf.h>
#include <initguid.h>
#include <ntstrsafe.h>
#include <bthdef.h>
#include <ntintsafe.h>
#include <bthguid.h>
#include <bthioctl.h>
#include <sdpnode.h>
#include <bthddi.h>
#include <bthsdpddi.h>
#include <bthsdpdef.h>
#include "trace.h"
#include "public.h"
#define POOLTAG_BTHECHOSAMPLE 'htbw'
enum _BTHECHOSAMPLE_MAX_DATA_LENGTH
{
BthEchoSampleMaxDataLength = 256
};
//
// Device context common to both client and the server
//
typedef struct _BTHECHOSAMPLE_DEVICE_CONTEXT_HEADER
{
//
// Framework device this context is associated with
//
WDFDEVICE Device;
//
// Default I/O target
//
WDFIOTARGET IoTarget;
//
// Profile driver interface which contains profile driver DDI
//
BTH_PROFILE_DRIVER_INTERFACE ProfileDrvInterface;
//
// Local Bluetooth Address
//
BTH_ADDR LocalBthAddr;
#if (NTDDI_VERSION >= NTDDI_WIN8)
//
// Features supported by the local stack
//
BTH_HOST_FEATURE_MASK LocalFeatures;
#endif
//
// Preallocated request to be reused during initialization/deinitialzation phase
// Access to this reqeust is not synchronized
//
WDFREQUEST Request;
} BTHECHOSAMPLE_DEVICE_CONTEXT_HEADER, *PBTHECHOSAMPLE_DEVICE_CONTEXT_HEADER;
#include "connection.h"
_IRQL_requires_max_(DISPATCH_LEVEL)
NTSTATUS
BthEchoSharedDeviceContextHeaderInit(
PBTHECHOSAMPLE_DEVICE_CONTEXT_HEADER header,
WDFDEVICE Device
);
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthEchoSharedRetrieveLocalInfo(
_In_ PBTHECHOSAMPLE_DEVICE_CONTEXT_HEADER DevCtxHdr
);
#if (NTDDI_VERSION >= NTDDI_WIN8)
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthEchoSharedGetHostSupportedFeatures(
_In_ PBTHECHOSAMPLE_DEVICE_CONTEXT_HEADER DevCtxHdr
);
#endif
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthEchoSharedSendBrbSynchronously(
_In_ WDFIOTARGET IoTarget,
_In_ WDFREQUEST Request,
_In_ PBRB Brb,
_In_ ULONG BrbSize
);
_IRQL_requires_max_(DISPATCH_LEVEL)
NTSTATUS
BthEchoSharedSendBrbAsync(
_In_ WDFIOTARGET IoTarget,
_In_ WDFREQUEST Request,
_In_ PBRB Brb,
_In_ size_t BrbSize,
_In_ PFN_WDF_REQUEST_COMPLETION_ROUTINE ComplRoutine,
_In_opt_ WDFCONTEXT Context
);
|