# How can I access the raw stack data? MS callback proc prototype changes when asm starts popping the stack

**URL:** <https://clarionhub.com/t/how-can-i-access-the-raw-stack-data-ms-callback-proc-prototype-changes-when-asm-starts-popping-the-stack/5377>\
**Category:** questions\
**Created:** [August 27, 2022, 12:02am UTC](https://clarionhub.com/t/how-can-i-access-the-raw-stack-data-ms-callback-proc-prototype-changes-when-asm-starts-popping-the-stack/5377 "2022-08-27T00:02:02Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [August 31, 2022, 9:39am UTC](https://clarionhub.com/t/how-can-i-access-the-raw-stack-data-ms-callback-proc-prototype-changes-when-asm-starts-popping-the-stack/5377/18 "2022-08-31T09:39:13Z")

</div>

> [@Bruce](#):
>
> I think you’ve over-thought this Richard. Because of the extra Class parameter you went down a road, but alas you’ve now gone round in circles. It’s time to back right up and start again

For these apis and their Ex versions  
[EnumResourceTypesA function (winbase.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-enumresourcetypesa)  
[EnumResourceNamesA - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-enumresourcenamesa)  
[EnumResourceLanguagesA function (winbase.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-enumresourcelanguagesa)

with these callback procedures  
[ENUMRESTYPEPROCA (libloaderapi.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nc-libloaderapi-enumrestypeproca)  
[ENUMRESNAMEPROCA (libloaderapi.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nc-libloaderapi-enumresnameproca)  
[EnumResLangProc callback function (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms648033(v=vs.85))

**there is no combination of pragma statement with or without the C or Pascal attribute that works with full access to the Class methods and properties that called it unless you do whats described below!**

So by having the first 3 parameters as Longs which do nothing, and then adding the parameters defined in the callback procedures above in reverse order to how MS have documented, you get the correct parameters back and it all works very nicely. 😃

I’ll be using this on other callback procedures of this type now that I’ve discovered it because I have the added luxury of being able to access the class in its entirety when I change the lParam datatype from a long to my BaseClassName. This is afterall what I wanted to achieve anyway, I have it working and I’m running with it.

You aint changing my mind on this one! 🤨

---

_[View the full topic](https://clarionhub.com/t/how-can-i-access-the-raw-stack-data-ms-callback-proc-prototype-changes-when-asm-starts-popping-the-stack/5377)._
