I just have a simple question...i saw in a bunch of places that i could use Microsoft's mailslot functions to send messages equivlent to those from the Messenging Service using NetMessageBufferSend(), but this works on 9x as well, so i could broadcast the same messages from my 9x comps in my LAN...

I'm not very familar with the mailslots, so i'm probably doing alot of stuff wrong, the only source i actually got ahold of was in TASM, and at my level, i couldn't decipher a thing....and it didn't help much.

Well, here is my source:

It is suppose to broadcast the equivelent of those 'netsend' message in the primary domain:

it doesn't have much commenting, sowiee. :(

.486

.model flat, stdcall
option casemap:none

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\gdi32.lib

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\gdi32.inc

.data

MailSlot BYTE '\\*\MAILSLOT\MESSNGR',0
MailMsg BYTE 'asdf',0
nNumberOfBytesToWrite = ($-MailSlot)
hfile DWORD ?
lpNumberOfBytesWritten DWORD ?



.code
start:


invoke CreateFile,
addr MailSlot,
GENERIC_WRITE,
FILE_SHARE_READ,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
-1

mov hfile,eax

invoke WriteFile,
hfile,
addr MailMsg,
nNumberOfBytesToWrite,
addr lpNumberOfBytesWritten,
0

invoke CloseHandle,hfile
invoke ExitProcess,NULL

end start


Any help will be greatly appreciated!

:stupid:


bah, the spacing is sorta messed up
Posted on 2003-03-16 14:57:44 by Drocon
As i see the message format is wrong.
It should be like this:
'sender',0,'receiver',0,'message',0
In your case:


MailMsg BYTE 'me',0,'you',0,'asdf',0
Posted on 2003-03-18 09:41:03 by rdo
Hmm, thank you!


However, i have one more question, is it possible to send this message to a specific IP instead of primary domain?

//192.168.1.101/mailslot/messngr

doesn't work, and neither does

//127.0.0.1/mailslot/messngr


thanks!
Posted on 2003-03-19 21:37:27 by Drocon
Just replace * with the ip or computer name, and the message will be delivered to that computer.
\\192.168.1.101\MAILSLOT\MESSNGR
This should work.
Posted on 2003-03-20 03:05:01 by rdo
BackSlash is the correct delimiter.

Your non-working text shows Forward Slashes.

I also have a MASM sample program, but it's not mine and I can not remember where or who, to give credit to.

Regards, P1
Posted on 2003-03-20 13:24:26 by Pone
Oops, i made a mistake in the previous post, i meant \\s instead of //s. Is there anything special i need to do with the IPs or something?

Pone, would it be possible that you could attach it or something? I am quite interested in it.

thanks!!
Posted on 2003-03-20 16:07:25 by Drocon