CaptureEngine Error 0x80070005 (access is denied)

the_real_boiler 21 Reputation points
2022-08-19T12:32:27.483+00:00

Hi all,

I'm trying the CaptureEngine example from the classic examples but I got the error :

MF_CAPTURE_ENGINE_EVENT: {219992BC-CF92-4531-A1AE-96E1E886C8F1} (hr = 0x80070005)
Ausnahme ausgelöst bei 0x76B1CA42 (KernelBase.dll) in CaptureEngine.exe: WinRT originate error - 0x80070005 : 'Zugriff verweigert'.

I'm using Windows 10 and VS 2017 with latest and greatest SDK.

What can I do?
Thanks and Best
Mario

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,387 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,482 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,524 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Tony 96 Reputation points
    2023-02-24T23:18:48.3866667+00:00

    Well, this whole issue was related due to wrong releasing the object. It seems releasing an interface in c++ is easier than other languages, such as Pascal.

    1 person found this answer helpful.
    0 comments No comments

  2. Xiaopo Yang - MSFT 11,081 Reputation points Microsoft Vendor
    2022-08-22T08:57:50.603+00:00

    The issue can be reproduced when the Camera is disabled for desktop apps in settings like figure below:
    233438-microsoftteams-image.png

    You really need to check the access to devices.

    0 comments No comments

  3. the_real_boiler 21 Reputation points
    2022-08-22T16:10:03.603+00:00

    Yes, this was my first step, I've allowed desktop applications to access the camera but this didn't solve the issue. Any other idea?


  4. Tony 96 Reputation points
    2023-01-27T15:04:14.7066667+00:00

    I'm facing the same error on Windows 11 latest build..

    This error is thrown when switching to another capture device, just after calling CaptureEngine::StartPreview() that results with S_OK, but IMFMediaEvent::GetStatus() throws 0x80070005. Restarting the application and then select the second device does what is expected. But switching to the first device raises the same issue..

    When I trace the code in the debugger, the debugger says:

    avcore\mf\mfmediaengine\svr\presentationhandlerexceptionwrapper.cpp(64)\mfsvr.dll!5DF7D8CE: (caller: 5DF1B9FF) ReturnHr(1) tid(6768) 80070005 Access Denied.

    I'm wondering why the CaptureEngine has this feature, while doing the same with IMFSourceReader, all goes fine.

    0 comments No comments