Since several days I try to find the following: I have a tiny C ++ program that continuously reads some data from the serial port. This data is stored in shared memory as follows:
HANDLE hMapFile;
hMapFile = CreateFileMapping(
INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE,
0,
10,
NULL);
LPCTSTR pBuf;
pBuf = (LPTSTR) MapViewOfFileEx(
hMapFile,
FILE_MAP_ALL_ACCESS,
0,
0,
10,
NULL);
while(true)
{
CopyMemory((PVOID)pBuf, szMsg, (_tcslen(szMsg) * sizeof(TCHAR)));
}
Now I would like to access this shared memory using PHP. so I tried to do the following:
$shm_id = shmop_open($key, $mode, $security, $size);
$read = shmop_read($shm_id, 0, 10);
But I do not know what key, mode, security and size I must install!
, - :
"MapViewOfFileEx()", , PHP .
"0x00030000" ++, PHP. ++ FileMapping, PHP : shmop_open(): .
$mode "a" .
0777 ...
$size 10 .
PHP-, , 0 $security AND $size, , .
? , BaseAdress ++ , $ PHP,
PHP, ?
: ++ PHP ( wamp-)?
PS: , , ... named-pipe, named-pipe? / ++ PHP?