Comments (4)
Not really fixed, but good enough. What follows is some additional thoughts on the matter, not necessarily correct, nor really that important. I wouldn't mind if you leave the samples as it currently is in the dev branch since I understand that event security isn't the focus of the samples.
CreateEventEx(nullptr, nullptr, FALSE, EVENT_ALL_ACCESS)
is somewhat better but still not entirely right. The 3rd parameter is a bitflag not a boolean. But at least it'd do something sensible if someone passed TRUE.
Actually I'm not entirely sure why you need to use CreateEventEx instead of CreateEvent in the first place, something to do with the gpu driver needing additional access rights? The MSDN docs of DX12 suggest to use CreateEvent and not CreateEventEx, which works just fine according to my tests. Also the original (wrong) parameters of the samples hint that your code originally used CreateEvent and then someone changed it to CreateEventEx to specify access rights, but didn't realize the signature is totally different.
From what I understand the handle returned by CreateEvent already has full access, as does the handle returned from CreateEventEx, regardless of what you specify, the initial handle always has full access. The access rights you specify, I believe, is intended for other sites accessing the event. Since you don't give the event a name that could only happen by handle inheritance (or possibly handle duplication, not sure). So basically you give everyone full access to that event, as long as he can get a hand on the handle in some way. Not really best practice, but I doubt someone can do much harm by getting control over these event handles. Maybe crash your app/game by messing with the fence waits.
As I said, thats just some thoughts, and I'm no expert on handle security, so some of this might be wrong. It's just a bit of a mystery to me why the samples use the more complex CreateEventEx and have to specify additional security stuff, when it seems to work perfectly fine (for me) going with the simple CreateEvent and default security settings.
from directx-graphics-samples.
Fixed in develop branch. Will merge to master with next release.
from directx-graphics-samples.
sigh. And it's only Monday. I agree that there's no added benefit to using CreateEventEx. I switched the code back to using CreateEvent.
from directx-graphics-samples.
👍 Thanks, and sorry for bothering with these minor details
from directx-graphics-samples.
Related Issues (20)
- FrameResource HOT 3
- Path too long HOT 1
- D3D1211On12 logs warnings by default HOT 2
- ResolveQueryData only have 2 items
- DXGIAdapterRemovalSupportTest nt.h not found HOT 2
- D3D12RaytracingMiniEngineSample custom amount of rays
- D3D12_VIDEO_MOTION_ESTIMATOR_INPUT.pHintMotionVectorHeap use case HOT 1
- nBodyGravity waitable object timing issue HOT 2
- D3D12 Meshlet Culling sample HOT 1
- how to use D3D12 to create swapchain for multiple windows
- How to use DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE in D3D12 HOT 4
- Hello world crashes when creating swap chain. Access violation HOT 15
- In directx12 mesh shaders example,there is an error. HOT 1
- Dynamic resources sample
- There is no need to call UnbindAllValid(); function in dynamicdescriptorheap.cpp HOT 1
- VADecoder cannot preperly decode VAEncoder output HOT 1
- Direct3D 12 Motion Estimation use case (resources preparation onboard - pixelshift)
- [HELP] Can somebody tell me what's the size of this repo....
- DXGI ERROR: IDXGISwapChain::GetContainingOutput: The swapchain's adapter does not control the output on which the swapchain's window resides. HOT 5
- Add example showing Agility SDK being used from Rust HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directx-graphics-samples.