Fairbanks FB3000 II Operators Manual User Manual
Page 50

Appendix II: System Resource
02/10
50
51220 Rev. 1
Shared Memory (Kernel Mapped Output), Continued
MappedOutputHandle = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL,
PAGE_READWRITE,
0,
sizeof(struct FileMapStruct),
“Output1”);
if( MappedOutputHandle == NULL )
{
CloseHandle(rSemaphore);
rSemaphore = NULL;
CloseHandle(wSemaphore);
wSemaphore = NULL;
return 0;
}
}
if( MapOutputData == NULL ) {
MapOutputData = (struct FileMapStruct*)MapViewOfFile(MappedOutputHandle,
FILE_MAP_WRITE,
0, 0,
sizeof(struct FileMapStruct));
}
if( MapOutputData != NULL )
{
// wait for kernel to release
if( WaitForSingleObject(rSemaphore, 5) == WAIT_FAILED )
return false;
// Check Counter to see if Kernel has sent a new string
if( MapOutputData->counter != LastCounter )