Size of buffer passed to f_FUNCTION?

May 20, 2008
12,169
133
Syracuse, NY, USA
I couldn't find it documented. Experiment says 16K (WCHARS). Is that correct?
In my tests associated with this question, using LPWSTR psz as argument to f_FUNCTION, TCC did not catch my writing beyond the end of the buffer pointed to by psz (and TCC crashed). Should it have caught such an error?
 

rconn

Administrator
Staff member
May 14, 2008
12,556
167
I couldn't find it documented. Experiment says 16K (WCHARS). Is that correct?

I have no idea what you're asking about -- what is "f_FUNCTION"?

If you're asking about the size of the buffer passed to a plugin function or command, it's 32K bytes (and always has been), regardless of whether it's a function or command.

TCC itself has no limits on string sizes, but I can't change it in the plugin calls without breaking every plugin in existence.

And no, TCC can't do anything about an ill-behaved plugin writing beyond the end of memory. There is no automagical way to uncorrupt a heap.

(And TCC didn't crash, your plugin did. If you neglected to include exception handling, you could take the TCC process down as well.)
 
Last edited: