MASM32 Downloads
; pGuiCount: Pointer to a variable that will hold the total amount of objects used on the current processProc StartGdiCapture: Arguments @pGuiCount Uses ecx, edx, edi, eax call 'KERNEL32.GetCurrentProcess' call 'user32.GetGuiResources' eax, &GR_GDIOBJECTS mov edi D@pGuiCount mov D$edi eaxEndP
;; GuiCount: The total amount of objects previously retrieved by StartGdiCapture Returned Value If the function returns 0, it means there is no leaks if eax is bigger then Zero, it means you have a gdi leak A negative value means the gdi objects are being released (When you call DestroyWindow, for example);;Proc IsGdiLeaking: Arguments @GuiCount Uses ecx, edx, edi call 'KERNEL32.GetCurrentProcess' call 'user32.GetGuiResources' eax, &GR_GDIOBJECTS sub eax D@GuiCountEndP
[GdiCount: D$ 0]call StartGdiCapture GdiCountcall MyRoutinecall IsGdiLeaking D$GdiCountIf eax >s 0 ; If eax is positive and bigger then 0 ; Found leak. do somethingEnd_If
I saw that info an hour ago and made those small functions to give a test. It seems to work as expected.
P.S.: "10% of alcoholic levels in your blood." - are you sure? That is far off the Ballmer peak
P.S.: "10% of alcoholic levels in your blood." - are you sure? That is far off the Ballmer peak ::)