-
Notifications
You must be signed in to change notification settings - Fork 15.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
access_denied in CreateForMonitor #40455
Comments
We require the template to be filled out on all new issues and pull requests. We do this so that we can be certain we have all the information we need to address your submission efficiently. This allows the maintainers to spend more time fixing bugs, implementing enhancements, and reviewing and merging pull requests. We will be able to more closely look at your issue once you do so. This issue will be closed in 10 days if the above is not addressed. |
Hello @HuntCode. Thanks for reporting this and helping to make Electron better! Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. Now adding the
blocked/need-repro
|
Thanks for your answer,I will close this issue and submit a new issue with bug template |
@HuntCode Have you fixed this problem? I come across the same problem with electron add-on when useing CreateForMonitor. |
@shixiaolong-tech I didn't fix this problem,but I had a workaround. I will check if the D3D11 supported,like this bool SupportD3D11()
{
auto activation_factory = winrt::get_activation_factory<
winrt::Windows::Graphics::Capture::GraphicsCaptureItem>();
auto interop_factory =
activation_factory.as<IGraphicsCaptureItemInterop>();
winrt::Windows::Graphics::Capture::GraphicsCaptureItem item = { nullptr };
struct monitor_info monitor = { 0 };
monitor.desired_id = 0;
EnumDisplayMonitors(NULL, NULL, enum_monitor, (LPARAM)&monitor);
const HRESULT hr = interop_factory->CreateForMonitor(
monitor.handle,
winrt::guid_of<ABI::Windows::Graphics::Capture::
IGraphicsCaptureItem>(),
reinterpret_cast<void**>(
winrt::put_abi(item)));
if (FAILED(hr))
{
blog(LOG_ERROR, "CreateForMonitor (0x%08X)", hr);
return false;
}
return true;
}```
if D3D11 is not supported,I will use OpenGL
Hope this method could help you |
Hello,
I developed A.dll with OSB libs(use IGraphicsCaptureItemInterop::CreateForMonitor),when I write a addon.node with A.dll,it works fine when run with non-admin Powershell,but it doesn't work when run with amin Powershell. The results is same as I debug with VS2022
Details in access_denied in CreateForMonitor in some cases #125
I'm not familiar with Electron, so I'm confused with the different results between MFC and Electron apps
A LowIP or a cef sandbox problem?
The text was updated successfully, but these errors were encountered: