@WINAPI with a void WINAPI?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
In another thread, I mentioned
echo %@winapi[shell32.dll,SHChangeNotify,%@eval[0x8000000],%@eval[0x1000],0,0] > nul
for refreshing the desktop. It works with no apparent ill effects. The value of @WINAPI is 1975412412 but SHChangeNotify is of type void. I'm wondering what goes on inside TCC when I use @WINAPI with a function of void type. Is there a chance of corruption?
It's simply whatever is on the stack at the time. It will vary depending on what was done previously. But it will always be meaningless.
It seems to always be 1975412412, regardless of what was done previously or TCC version. And that's what I meant ... popping something off the stack when you shouldn't ... no problem with that?
You're not popping anything off the stack, you're just referencing a value on the stack. If you tried to use it as a pointer, it would be bad. Otherwise, it's utterly meaningless.
OK, that's comforting. What would happen if you used @WINAPI with something like GetTickCount64()? Would you get only the low DWORD of the ULONGLONG return value?