mIRC Home    About    Download    Register    News    Help

Print Thread
#83608 20/05/04 11:23 PM
Joined: Jul 2003
Posts: 77
B
Babel fish
OP Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
now i know that mIRC uses a mapped file to chit chat with dlls but im curious as to why he just didnt export two functions like

M_EVAULATE(char *string,char *buffer,int sizeBuffer);
M_COMMAND(char *string,int how);

i just think that woulda been easier not that the mapped file is a big deal but i just think itd been better to export some fns to do it and GetProcAddress it from a dll maybe im just stupid any ideas y he chose mapped files?


hmmm signed by me
#83609 20/05/04 11:45 PM
Joined: Jun 2003
Posts: 195
N
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
The main issue is in synchronizing among threads. If mIRC exported the functions one process could be in the middle of a call when another one attempts to call it.

Im certain mIRC is not reentrant safe wich would most likely crash with an access violation.

Mapped files are system global and managed by the system so only one process can access the object at a time. This is not really an issue in a dll but alot of people are writing external applications designed to communicate with mirc as well.

p.s
of course mIRC could manage calls using any of the number of interprocess sync objects it would just be more work. Definately possible tho

Have Fun smile

Last edited by Narusegawa_Naru; 20/05/04 11:46 PM.

Have Fun smile
#83610 29/05/04 10:35 AM
Joined: Dec 2002
Posts: 89
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2002
Posts: 89
Actually access to mapped files is not synchronized.

The reason why it was used is because you cannot pass "char *buffer" from another process. Different applications have different virtual address spaces.


Sincerely,
Necroman, #mIRC @ Undernet
#83611 29/05/04 05:37 PM
Joined: Jun 2003
Posts: 195
N
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
indeed i stand corrected. i was aware you cannot pass the character buffer from one process to the next but i swore Mapped files were synched. Perhaps i was thinking of something else.


Have Fun smile

Link Copied to Clipboard