Module: wine Branch: master Commit: 5e4f15db1f8cf6de4a6ef8ad0aa073b9488293d6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5e4f15db1f8cf6de4a6ef8ad0a...
Author: Sebastian Lackner sebastian@fds-team.de Date: Wed Oct 1 02:39:49 2014 +0200
shlwapi: Fixed swapped argument order in SHLWAPI_DupSharedHandle command.
---
dlls/shlwapi/ordinal.c | 6 +++--- dlls/shlwapi/tests/ordinal.c | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 303c63a..e5da1cf 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -106,7 +106,7 @@ static HANDLE SHLWAPI_DupSharedHandle(HANDLE hShared, DWORD dwDstProcId, if (hSrc) { /* Make handle available to dest process */ - if (!DuplicateHandle(hDst, hShared, hSrc, &hRet, + if (!DuplicateHandle(hSrc, hShared, hDst, &hRet, dwAccess, 0, dwOptions | DUPLICATE_SAME_ACCESS)) hRet = NULL;
@@ -201,7 +201,7 @@ PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId) TRACE("(%p %d)\n", hShared, dwProcId);
/* Get handle to shared memory for current process */ - hDup = SHLWAPI_DupSharedHandle(hShared, dwProcId, GetCurrentProcessId(), + hDup = SHLWAPI_DupSharedHandle(hShared, GetCurrentProcessId(), dwProcId, FILE_MAP_ALL_ACCESS, 0); /* Get View */ pMapped = MapViewOfFile(hDup, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); @@ -252,7 +252,7 @@ BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId) TRACE("(%p %d)\n", hShared, dwProcId);
/* Get a copy of the handle for our process, closing the source handle */ - hClose = SHLWAPI_DupSharedHandle(hShared, dwProcId, GetCurrentProcessId(), + hClose = SHLWAPI_DupSharedHandle(hShared, GetCurrentProcessId(), dwProcId, FILE_MAP_ALL_ACCESS,DUPLICATE_CLOSE_SOURCE); /* Close local copy */ return CloseHandle(hClose); diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index 481a771..64b07f3 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -505,16 +505,13 @@ static void test_alloc_shared(int argc, char **argv) if (hmem2) { p = pSHLockShared(hmem2, procid); - todo_wine ok(p != NULL,"SHLockShared failed: %u\n", GetLastError()); if (p != NULL) ok(p->value == 0xDEADBEEF, "Wrong value in shared memory: %d instead of %d\n", p->value, 0xDEADBEEF); ret = pSHUnlockShared(p); - todo_wine ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
ret = pSHFreeShared(hmem2, procid); - todo_wine ok(ret, "SHFreeShared failed: %u\n", GetLastError()); } }