Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IoGetRemainingStackSize returns address of local variable #3

Open
harjoc opened this issue Nov 29, 2019 · 1 comment
Open

IoGetRemainingStackSize returns address of local variable #3

harjoc opened this issue Nov 29, 2019 · 1 comment

Comments

@harjoc
Copy link

harjoc commented Nov 29, 2019

When compiling a source file which includes wdm.h from this project using GCC 7.3, it warns about:

km/wdm.h: In function ‘IoGetRemainingStackSize’:
km/wdm.h: function returns address of local variable [-Wreturn-local-addr]                                                                                                                         
      return((ULONG_PTR)(&Top) - Bottom );

According to msdn, it should return Top - Bottom instead of &Top - Bottom.

@HBelusca
Copy link

Using &Top takes into account the current stack location where Top and Bottom variables are currently located.
Also remember that these are the official windows headers, so if you have complaints about them, you should send some feedback somewhere on their github (https://github.com/microsoft)
These headers have just been dumped here by tpn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@harjoc @HBelusca and others