mIRC Homepage
Posted By: 95102 mIRC DLL question - 26/03/09 07:32 PM
Functions that mIRC execute in DLLs have a specific list of arguments, the `char* data` argument can be filled with data to be returned from the $dll() call in mIRC, how many bytes can it hold?

Also, would it be safe for me to free() the memory `data` points to and point it to some memory I've allocated myself?
Posted By: argv0 Re: mIRC DLL question - 26/03/09 08:06 PM
For the last year, mIRC now holds roughly(!) 4000 bytes of data in strings/variables/results-- this limit is not universal across mIRC, though I believe this is now the limit for DLLs. If not, ~900 should work.

Quote:
would it be safe for me to free() the memory `data` points to and point it to some memory I've allocated myself?

No, it would be extremely unsafe for you to do that.

The char *data is pre-allocated and managed by mIRC. It is used after the dll call to read results, specifically:

Code:
strcpy(data, "/echo -a hello world");
return 2;


If you free()'d data, mIRC would crash, either by attempting to read invalid memory or by free'ing already-deallocated memory.
Posted By: tontito Re: mIRC DLL question - 29/03/09 06:49 PM
I can confirm that at least 3800 bytes of data can be used with dlls.
More than that, may be an issue for some cases.
© mIRC Discussion Forums