@WINAPI with a void WINAPI?

May 20, 2008
12,167
133
Syracuse, NY, USA
In another thread, I mentioned
Code:
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?
 
May 20, 2008
12,167
133
Syracuse, NY, USA
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?
 
May 20, 2008
12,167
133
Syracuse, NY, USA
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?