❔ WPF application crashes when streamed by discord
Hello everyone,
I'm trying to build a WPF application, when i try to stream the application using discord's video streaming feature it crashes the application instantly after focusing the application no exceptions thrown or anything.
I tried creating a new WPF project and building the project and both produce the same behavior, i also found out that discord's signed DLL which you can disable in discord's video and audio settings seems be the cause of these crashes.
I would appreciate any ideas on how to fix it rather than changing discord's settings (:
16 Replies
If you attach a debugger and then do the same thing do you get more info?
do you mean an external debugger other than the one in visual studio ? i can try if you can recommend one, but in case you meant the one provided in visual studio it unfortunately doesn't provide further information
Event logs?
What does your app do? Does it have e.g. a dependency on audio devices?
Is your laptop powerful? Maybe the resources are completely depleted when screensharing.
Do have any OnFocus event handlers in your app?
i've looked through these, i couldn't deduce anything
There are no event logs that are relevant or you couldn't interpret the results?
it plays videos using LibVLCSharp, so there is a dependency on audio devices but the app crashes before playing any video or initiating the VLC instance in code. I'm using a pc with good specs so it's unlikely due to resources depleting, i also don't have any onFocus events in code
ah
sounds like a contention issue at a hardware level?
might be
i got a procdump from the application
it throws an exception before closing ( Unhandled: C0000409 ), after running the procdump in the debugger it throws an Unhandled exception at 0x00007FFE3CFF2350 (ntdll.dll) in Sparrow.exe_230803_202650.dmp: Indirect call guard check detected invalid control transfer.
hmmm i'm not that smart of a guy so i suspect it's the latter, i found the event where the process stops but i found lots of image loading and unloading before, i use a lot of images in the app
That's why you're not getting any exceptions; that's a "Fail Fast Exception"
it's something like a security panic exception iirc
apparently isn't not a security panic exception any longer
https://learn.microsoft.com/en-us/shows/inside/c0000409
that fits with recollection that I've had in the past
i tried running VS in administrator after your comment about security, i don't believe i didn't think of that before but it streamed after getting administrator rights
but I can't say what it's doing now in your app, this is back when it was a security failfast back in the past.
I remember encountering the same issue with WPF, even a blank new WPF project fails when discord attempts to hook
I won't be much help here other than recognizing the code from a headache I had years back; apologies.
no problems, you helped me greatly thank you
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.