Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


IddCx leaks memory - where to ask for help?

KeloCubeKeloCube Member Posts: 4
edited May 22 in NTDEV

Hey everyone,

I've developed a virtual display driver using the IddCx framework in Windows 10, but I have a small problem. The framework seems to be leaking about ~2-3 MB of memory each time the display is "plugged in" and eventually disconnected.

According to https://docs.microsoft.com/en-us/windows-hardware/drivers/display/iddcx-objects the IDDCX_MONITOR object is destroyed upon calling IddCxMonitorDeparture and should not be reused, but since this leaks memory I've also tried the following with poor success:

  • Deleting IDDCX_MONITOR with WdfObjectDelete before or after IddCxMonitorDeparture results in a crash.
  • Reusing the object with another call to IddCxMonitorArrival after calling IddCxMonitorDeparture gives an errornous result.

For what it's worth, a commercial driver by Spacedesk seems to exhibit the same behaviour of leaking a few MB of memory each time the virtual display is plugged in.

I suppose I could just let this be, but I'm curious if there's a mailing list or similar where someone from Microsoft could take a look at this?

Otto

Comments

  • Marcel_RuedingerMarcel_Ruedinger Member Posts: 147

    I developed spacedesk and its IddCx driver. This is funny - nobody ever noticed this memory leak - even though our installed base is a two digit million number of Windows PCs. Probably because people never plug and unplug their display monitors hundreds of times before rebooting their PCs...

    We are in contact with the IddCx team at Microsoft - I can forward this if applicable (needs to be thoroughly verified first, though). Just file a case in the spacedesk support forum, then I can contact you by email.

    PS: You can also try the Microsoft WDK forum. However, I have hardly ever seen any answers to WDDM display driver questions there beside my own ones.

    Marcel Ruedinger
    datronicsoft

  • KeloCubeKeloCube Member Posts: 4

    Hey Marcel, thanks for the reply!

    I agree that a few MB per plug-in/plug-out cycle is not a very big deal, but I don't see harm in letting the IddCx team know either. You can contact me at [email protected] - unless you need me to file a case on your support forum? Although I'm not sure how that would look given that I'm working on a competing product :wink:

    If you feel like you don't want to spend the time verifying and reporting this, then that's fine too - it can't be a very big issue if not one user in a million has been bothered by it. I was mostly asking if there's something akin to https://www.freelists.org/list/wdmaudiodev for Windows display drivers, which you've answered. :smile:

    Otto

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,166

    There are various ways you can file a bug on this with MSFT. I guess if you’re asking here, you’re not on Collaborate? That would be the first and best place to file. You can also go through paid WDK support (if it’s a bug you ultimately won’t be charged).

    I don’t do display drivers, so I can’t hook you up with anyone on that team, but it sounds like @Marcel_Ruedinger can. Marcel... off line send him to a helpful PM or something.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • KeloCubeKeloCube Member Posts: 4

    Thanks for the pointers, Peter. I registered for Collaborate but I'll wait for Marcel's comment before filing any feedback.

    Otto

  • Marcel_RuedingerMarcel_Ruedinger Member Posts: 147
    edited May 23

    Private emails exchanged. Public info: Solid prerequisite before reporting to Microsoft involves reproducing with DisplayLink USB display, with Microsoft Windows Miracast IddCx driver and a minimum possible modification to WDK IddCx Indirect Display driver sample (e.g. hardcoded loop plugging and unplugging the display monitor).

    Marcel Ruedinger
    datronicsoft

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,166

    Thank you, Mr. Ruedinger...I agree it’s important to do your homework before running off to the dev team with error reports.

    SpaceDesk looks like quite a nice little utility, btw. Bravo.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • JiaBang_LinJiaBang_Lin Member - All Emails Posts: 31
    via Email
    I am not sure if this helps. Running WHQL test might help to catch the
    culprit. When I was developing IDDCX driver for my company, I still
    remembered that there are so many leaks caught by the WHQL test back then.
    Eventually I got it all fixed.

    KeloCube 於 2020年5月22日 週五
    上午8:08寫道:
  • KeloCubeKeloCube Member Posts: 4
    edited May 29

    Thank you for all the comments. I spoke with Marcel and agreed to test this out on some reference hardware before moving forward with an error report. I haven't tried setting up any WHQL tests yet as I'm working on a software product and so far I've been quite happy with attestation signing, but I will look into them if the issue is not reproduced on the reference hardware.

    Otto

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE