l͌͂Ă
޲ٔł\Ă܂PCł
i-mobile

ҰٽۯĂ̔rɂ‚

ҰٽۯĂgp۾ԒʐMsĂ܂
http://www.kumei.ne.jp/c_lang/sdk3/sdk_250.htm
http://msdn.microsoft.com/ja-jp/library/cc429615.aspx

Ŏ₳Ē܂

ҰٽۯĂͤҰٽۯĂĤM۾үނ
M۾ŎM̂łM鎞܂M鎞
ҰٽۯĂɑ΂ĔrKv͂Ȃ̂ł傤H
ƂWindows̕ŔrĂ̂ł傤H

̓Iɂͤ
WriteFile鎞
ReadFile鎞
ł
ȂWriteFilê͕(2ˆȏ)۾̹܂

낵肢܂

: futurista
ú:߭ wK
:I
񓚐 : 3/3

ŐV̉񓚂

1 ҂

OSŏǂݏo^݂Ă܂

http://www.ipa.go.jp/security/awareness/vendor/programmingv1/b08_02.html

http://www.compago.it/clng_ja/298-leggere-e-scrivere-su-un-mailslot-con-delphi.html


2
33߲

WriteFile鎞

ReadFile鎞

CreateFile֐̑OFILE_SHARE_READƂĂ܂̂Ť݂̓͋֎~ł̓ǂݏo͋‚ƂƂɂȂ܂

http://msdn.microsoft.com/ja-jp/library/cc429198.aspx

Gkł

قҰٽۯĂ̂ŤݾقȂ(http://q.hatena.ne.jp/1315259024)̂ققŽٰĂ܂

Windows Çّr䣂ȂǂłȂΌĂ॥Ĉقđ厖

҂̕ԓ

񓚂肪Ƃ܂

CreateFile֐̑Oͤ

FILE_SHARE_WRITE | FILE_SHARE_READ

w肵Ă܂

ƂƂͤǂݏ‚ƍlĂ悢̂ł傤H


3 TransFreeBSD
100߲ ޽ıݻ

{Iɔr䂷Kv͂܂

ҰٽۯĂ̓ǂݏүޒPʂōsꤕēǂݏ邱Ƃ͏oȂ͂ł

܂ŏɑүނŏɓǂ܂FIFO̷ɒ߂Ă褏ԂύXrǂނƂo܂

ĤҰٽۯĂ̓ǂݏɊւĂͤr䂷Kv܂

http://msdn.microsoft.com/en-us/library/aa365576.aspx


(ReadFile)ق𕡐pĕŎ󂯎ĂꍇGetMailslotInfoReadFile܂ł̊Ԃɕ۾گނoĂ܂”\͂܂

̏ꍇr䂷Ζh܂үނ̍ő廲ނ߂ĤŎ󂯎悤ɂGetMailslotInfoKvȂȂƎv܂

----

[NjL]

L2‚̊֐ĂƂčlꍇ

̑OɔrKvƂƂł傤H

GetMailslotInfo

ReadFile

KvHƌƤꍇɂKvłΤƂɂȂ܂

ȉhttp://msdn.microsoft.com/en-us/library/aa365130.aspx

This handle must be used when a process reads messages from the mailslot. Only the process that creates a mailslot or has obtained the handle by some other mechanism (such as inheritance) can read from the mailslot.

Fق۾ҰٽۯĂүނǂ݂ۂɎgpȂ΂ȂȂҰٽۯĂ쐬(1)܂(p(2))̎dg݂ɂق^ꂽ۾݂̂ҰٽۯĂǂݏo

܂http://msdn.microsoft.com/ja-jp/library/cc429615.aspx

w肳ꂽOҰٽۯĂɑ݂ĂꍇͤװɂȂ܂

Ĥگނ褖IɌp”\ɂĎq۾肵ȂΤǂݏo”\Ȃ̂͒P۾PگނɌ܂(CreateFile֐ōقł͓ǂݏo͏oȂ)


ǂݏo”\Ȃ̂P۾PگނłΔr͈Ӗ܂

q۾ҰٽۯقpĤe۾Ǝq۾܂͕̎q۾œǂݏôłΔr䂪Kv܂

گފ‹łlȔzKvƎv܂گނȂ瓖OƌΓOȎł͂܂


Ƥ⑫Iɡ

http://msdn.microsoft.com/en-us/library/aa365467.aspx

If ReadFile attempts to read from a mailslot that has a buffer that is too small, the function returns FALSE and GetLastError returns ERROR_INSUFFICIENT_BUFFER.

Fޯ̧ɂҰٽۯĂ̓ǂݍ݂݂ꍇFALSEԂGetLastErrorERROR_INSUFFICIENT_BUFFERԂ

炭ںނ菬ȒPʂł̓ǂݏo͎ŝƎv܂

܂ޯ̧ނ傫Ƃओǂݍ݂1ںނ݂̂Ǝv܂

Ė߂lװK؂ɍsΤቺȊȎ傫Ȗ͔ȂƎv܂


ԊmȂ̂ͻٺޏĂ݂邱Ƃł

҂̕ԓ

񓚂肪Ƃ܂

L2‚̊֐ĂƂčlꍇ

̑OɔrKvƂƂł傤H

GetMailslotInfo

ReadFile

үނ̻ނ͕sł

֘A

ƒT



0.l͌͂Ăį
8.߰ނFBɏЉ
9.߰ނ̐擪
Ή@ꗗ
₢킹
/m点
۸޲
հްo^
͂Ăį