mIRC Home    About    Download    Register    News    Help

Print Thread
#210820 26/03/09 07:32 PM
Joined: Mar 2009
Posts: 1
9
95102 Offline OP
Mostly harmless
OP Offline
Mostly harmless
9
Joined: Mar 2009
Posts: 1
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?

95102 #210821 26/03/09 08:06 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #210951 29/03/09 06:49 PM
Joined: Feb 2003
Posts: 307
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
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.


Link Copied to Clipboard