From aee9a2f168d95e1416344220e28f2acd3ec7245b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 27 Nov 2014 17:36:05 +0100 Subject: ftclient: copy the data actual Issue: #97 --- freetrackclient/freetrackclient.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/freetrackclient/freetrackclient.c b/freetrackclient/freetrackclient.c index 7fba2cee..8e6c2b7f 100644 --- a/freetrackclient/freetrackclient.c +++ b/freetrackclient/freetrackclient.c @@ -75,11 +75,9 @@ FT_EXPORT(BOOL) FTGetData(FTData* data) return FALSE; if (ipc_mutex && WaitForSingleObject(ipc_mutex, 16) == WAIT_OBJECT_0) { - if (ipc_heap) { - if (ipc_heap->data.DataID > (1 << 29)) - ipc_heap->data.DataID = 0; - data->DataID = ipc_heap->data.DataID; - } + memcpy(data, &ipc_heap->data, sizeof(FTData)); + if (ipc_heap->data.DataID > (1 << 29)) + ipc_heap->data.DataID = 0; ReleaseMutex(ipc_mutex); } return TRUE; -- cgit v1.2.3