1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
// ReadMem.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
extern "C" void __stdcall RecupMemoirePartagee()
{
// Attente mutex
dwWaitResult = WaitForSingleObject(hMutexIHMIn,10L);
if (dwWaitResult==WAIT_OBJECT_0)
{
// Transfert des donnees depuis la memoire partagee
memcpy (&to_ihm_data, ToIHMPtr, sizeof(t_to_ihm));
// Relachement du mutex
if (!ReleaseMutex(hMutexIHMIn) )
{
printf ("IO : fail to release mutex IHM In.\n") ;
}
}
else
{
printf ("IO : fail to obtain mutex IHM In.\n") ;
}
} |
Partager