Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Outbound service subscriptions not handled properly if more than one sink #46

Closed
pierredelisle opened this issue Nov 22, 2019 · 1 comment

Comments

@pierredelisle
Copy link
Contributor

In WDMFeature.cpp, set outParam.mSubscribeRequestPrepareNeeded.mPathListSize to kSinkHandle_Max as shown below.

Otherwise, only the first subscription is registered.

Note that this is not an issue with the sample app currently because it only has one sink, but is an issue when additional sinks are added in applications that are cloned from this sample app.

void WDMFeature::HandleOutboundServiceSubscriptionEvent(
                                                        void * appState, 
                                                        SubscriptionClient::EventID eventType,
                                                        const SubscriptionClient::InEventParam & inParam,
                                                        SubscriptionClient::OutEventParam & outParam)
{
    switch (eventType)
    {
        case SubscriptionClient::kEvent_OnSubscribeRequestPrepareNeeded:
        {
            outParam.mSubscribeRequestPrepareNeeded.mPathList                  = &(sWDMfeature.mServiceSinkTraitPaths[0]);
 -->        outParam.mSubscribeRequestPrepareNeeded.mPathListSize              = 1;  // change this to kSinkHandle_Max
            outParam.mSubscribeRequestPrepareNeeded.mVersionedPathList         = NULL;
            outParam.mSubscribeRequestPrepareNeeded.mNeedAllEvents             = false;

I'll send a PR shortly.

suryanshup pushed a commit that referenced this issue Mar 17, 2020
@suryanshup
Copy link
Contributor

This was fixed in an earlier PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants