IMoniker->BindToObject error: HRESULT: 0x80070002 to avscamera driver that is sample from windows driver sample

榮章 林 (Jethro Lin) 0 Reputation points
2023-04-19T02:26:37.3+00:00

I use Windows-driver-samples on github to make an original camera driver https://github.com/microsoft/Windows-driver-samples/tree/main/avstream/avscamera The compiler environment is used the following combinations

  1. visual studio 2022 and wdk 10.0.22621.382
  2. visual studio 2019 and wdk 10.0.19041
  3. visual studio 2017 and wdk 10.0.17763 And I install the driver on Windows 10 19045 version. I failed to bind the IBasefilter object by "Selecting a Capture Device" with error code 0x80070002.
IBaseFilter *pCap = NULL; 
hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&pCap);
// hr = 0x80070002

But it works on Windows 11 22000 and 22621. How to resolve this problem? I will be grateful for any help.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,195 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,121 Reputation points
    2023-04-20T08:26:43.5533333+00:00

    Hello there, As the driver sample works in other version I would suggest raise this in feedback hub. Also try this go to Extentions and updates then Search Nuget and uninstall it, restart visual studio, again install Nuget then again restart. you should be able to create your new project. The Feedback Hub app lets you tell Microsoft about any problems you run into while using Windows . You can also send suggestions to help us improve your Windows experience. Send feedback to Microsoft with the Feedback Hub app https://support.microsoft.com/en-us/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332 Hope this resolves your Query !! --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments