Fairbanks FB3000 Kernel Program Operators Manual User Manual

Page 49

Advertising
background image

Appendix II: I/O Addresses & Controls

04/12

49

51146 Rev. 3

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 )

Advertising