I've been studying the echo bit sample from WDF Windows.
There is a function BthEchoSrvRegisterPSM
in server.c which registers PSM.
It looks like that:
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
BthEchoSrvRegisterPSM(
_In_ PBTHECHOSAMPLE_SERVER_CONTEXT DevCtx
)
/*++
Description:
Registers server PSM.
Arguments:
DevCtx - Device context of the server
Return Value:
NTSTATUS Status code.
--*/
{
NTSTATUS status;
struct _BRB_PSM * brb;
DevCtx->Header.ProfileDrvInterface.BthReuseBrb(
&(DevCtx->RegisterUnregisterBrb),
BRB_REGISTER_PSM
);
brb = (struct _BRB_PSM *)
&(DevCtx->RegisterUnregisterBrb);
//
// Send in our preferred PSM
//
brb->Psm = DevCtx->Psm;
status = BthEchoSharedSendBrbSynchronously(
DevCtx->Header.IoTarget,
DevCtx->Header.Request,
(PBRB) brb,
sizeof(*brb)
);
if (!NT_SUCCESS(status))
{
TraceEvents(TRACE_LEVEL_ERROR, DBG_PNP,
"BRB_REGISTER_PSM failed, Status code %!STATUS!\n", status);
goto exit;
}
//
// Store PSM obtained
//
DevCtx->Psm = brb->Psm;
exit:
return status;
}
My question is what is 'our preferred PSM'? Isn't PSM defined as a specific service? How can I set it for a remote device? Where does it come from?