From 066816ae82c37547bcb01407d8d7f75d43537e29 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 25 Apr 2014 08:46:57 +0200 Subject: [PATCH] Source and DLL are consistent. Painfull error!!! --- .../Plugins/SharedMemory/Contrib/SharedMem.c | 26 ++++++++++++++---- .../SharedMemory/Plugins/sharedmem.dll | Bin 20480 -> 20480 bytes 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Installation/Windows/Plugins/SharedMemory/Contrib/SharedMem.c b/Installation/Windows/Plugins/SharedMemory/Contrib/SharedMem.c index 1e5cc90fb0..641b9430a3 100644 --- a/Installation/Windows/Plugins/SharedMemory/Contrib/SharedMem.c +++ b/Installation/Windows/Plugins/SharedMemory/Contrib/SharedMem.c @@ -121,9 +121,11 @@ PUBLIC_FUNCTION(CreateSharedMemory) if (pBuf == NULL) { - CloseHandle(hMapFile); - hMapFile = NULL; PushReturnValue(GetLastError()); // Could not map view of file + + CloseHandle(hMapFile); + + hMapFile = NULL; } @@ -162,7 +164,7 @@ PUBLIC_FUNCTION(WriteIntoSharedMem) } pBuf = (LPTSTR)MapViewOfFile(hMapFile, // handle to map object - FILE_MAP_ALL_ACCESS, // read/write permission + FILE_MAP_WRITE, // read/write permission 0, 0, BUF_SIZE); @@ -182,6 +184,9 @@ PUBLIC_FUNCTION(WriteIntoSharedMem) // read name for mem segment from stack popstring(szMsg); CopyMemory((PVOID)pBuf, szMsg, (_tcslen(szMsg) * sizeof(TCHAR))); + + CloseHandle(hMapFile); + PushReturnValue(0); } PUBLIC_FUNCTION_END @@ -204,6 +209,9 @@ PUBLIC_FUNCTION(ReadIntoSharedMem) if (hMapFile == NULL) { + + pushstring(TEXT("Could not open file mapping object")); + PushReturnValue(GetLastError()); // _tprintf(TEXT("Could not open file mapping object (%d).\n"), // GetLastError()); @@ -220,6 +228,7 @@ PUBLIC_FUNCTION(ReadIntoSharedMem) { // _tprintf(TEXT("Could not map view of file (%d).\n"), // GetLastError()); + pushstring(TEXT("Could not map view of file")); PushReturnValue(GetLastError()); @@ -229,13 +238,14 @@ PUBLIC_FUNCTION(ReadIntoSharedMem) } + pushstring(TEXT(pBuf)); + + PushReturnValue(0); + UnmapViewOfFile(pBuf); CloseHandle(hMapFile); - PushReturnValue(0); - - pushstring(TEXT(pBuf)); } PUBLIC_FUNCTION_END @@ -255,6 +265,10 @@ PUBLIC_FUNCTION(ExistsSharedMem) // GetLastError()); return; } + + CloseHandle(hMapFile); + + PushReturnValue(1); } PUBLIC_FUNCTION_END diff --git a/Installation/Windows/Plugins/SharedMemory/Plugins/sharedmem.dll b/Installation/Windows/Plugins/SharedMemory/Plugins/sharedmem.dll index 377f05815d7dbc4d1dca09cc40cc79cf77d9daf7..d97f7d8b5f069d4019ed1a39dea1fb251a1d31ba 100755 GIT binary patch delta 1332 zcmZ9Me@q)?7{}jhuUTPbIhAI#(CsLlu#Ih{J$iSgcL%x(MA44@aFUUrqx@(nB?!}~ zWW^}1+JRuwKIN;zS4@RjCy5N#peKTzt(kW?{u=XItVI5XH;xCF@tD=XL!2RE$)?wJf zW!bJCWV+g~bTtAApisn-N!Tv{>)36k;q7cQ?*$t%S6GxVTu=v#2RI3|03ARN@H!B} zE9UwqGDRogJO#`GKg%^Gl19F&y+_H@+K&mGTQyc;B$|%Ge2@xwA6SIbqNI2b%EolC z&j(tL0l3mt`pnaT{;pQKJJ3f5dc56qTW6P-_P^ZI)7jll2VU`cPxmSLna`FM6!e)+ z?`w3RZ8Jq~a`h55*(xoKNO@@x`3Mfqb-+nr7llv>kPB!4ANU4P$4y(iOc*`;F_{wqJae!@Ry{w<@ zX9w7GY?S?+{f6Da8M$W8%lWx}Zh(t$pKzDCYuqhvg`#Doc9 zQutd)3Mm1Jr05g-#fW%O92H~Ygm^=|D;7&-Qn_T67>ScyQnhqg`ap_GBhsi8Q+^-o z<{ufdRMb{jZKCbCt;P1CZQZtE)7W?0Mf*{Ev;B;H&>pszT(oyHeasuoAoDIW%$#RN bm`|Ar=1XRp`I?z!zGrSSKgk0P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