question

yoestar avatar image
0 Votes"
yoestar asked ·

Help, MagSetWindowSource has memory leak, thank you.

I use magnification API.
When I use magsetwindowsource + magsetimagescalingcallback, there will be a memory leak every time. I confirm that my destorywindow is successful, and that I call maguninitialize, but I don't release it.
The following is the leak stack I used umdh to grab. Please help me find out if there is a solution. Thank you.


//
// Each log entry has the following syntax:
//
// + BYTES_DELTA (NEW_BYTES - OLD_BYTES) NEW_COUNT allocs BackTrace TRACEID
// + COUNT_DELTA (NEW_COUNT - OLD_COUNT) BackTrace TRACEID allocations
// ... stack trace ...
//
// where:
//
// BYTES_DELTA - increase in bytes between before and after log
// NEW_BYTES - bytes in after log
// OLD_BYTES - bytes in before log
// COUNT_DELTA - increase in allocations between before and after log
// NEW_COUNT - number of allocations in after log
// OLD_COUNT - number of allocations in before log
// TRACEID - decimal index of the stack trace in the trace database
// (can be used to search for allocation instances in the original
// UMDH logs).
//


 + 40b7800 ( 40b7800 -     0)      5 allocs BackTrace2667B888
 +       5 (     5 -     0) BackTrace2667B888 allocations
    
 ntdll!RtlpCallInterceptRoutine+26
 ntdll!RtlpAllocateHeapInternal+50DDF
 ntdll!RtlAllocateHeap+3E
 Magnification!CMilMagnifier::FilterTextureD3D9+20C
 Magnification!CMilMagnifier::UpdateContentSurfaces+2A9
 Magnification!CMilMagnifier::ProcessGdiDesktopBits+A2
 Magnification!CMilMagnifier::SetSource+72
 Magnification!Magnifier_WndProc+585
 USER32!_InternalCallWinProc+2B
 USER32!UserCallWinProcCheckWow+33A
 USER32!SendMessageWorker+829
 USER32!SendMessageW+6F
 InfraCore32!IfAddHook+11846
 Magnification!MagSetWindowSource+62
 xcast!xcast_vdict_set_uint8+32CED4
 xcast!xcast_vdict_set_uint8+32C2F6
 xcast!xcast_vdict_set_uint8+32CB29
 xcast!xcast_vdict_set_uint8+3297AE
 xcast!xcast_vdict_set_uint8+1CB2E6
 xcast!xcast_vdict_set_uint8+14749A
 xcast!xcast_vdict_set_uint8+4C44E5
 KERNEL32!BaseThreadInitThunk+19
 InfraCore32!IfAddHook+19299
 ntdll!__RtlUserThreadStart+2F
 ntdll!_RtlUserThreadStart+1B
not-supported
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @yoestar What is your windows version? According to the document:

Note The MagSetImageScalingCallback function is deprecated in Windows 7 and later, and should not be used in new applications. There is no alternate functionality.
This function requires Windows Display Driver Model (WDDM)-capable video cards.
This function works only when Desktop Window Manager (DWM) is off.


0 Votes 0 ·

win 10,but my code is too old to rewrite it.

0 Votes 0 ·

And the operation is very stable, only long-term use, because of memory leakage caused by the problem, is there a solution?

0 Votes 0 ·
yoestar avatar image
0 Votes"
yoestar answered ·

It's a tie.
Find the memory that has not been released and release it, but this is indeed a bug of MS API.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

yoestar avatar image
0 Votes"
yoestar answered ·

up it. I'm looking forward to your reply

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.