shlwapi: Fixed swapped argument order in SHLWAPI_DupSharedHandle command.

This commit is contained in:
Sebastian Lackner 2014-10-01 02:39:49 +02:00 committed by Alexandre Julliard
parent cad3e3e5dc
commit 5e4f15db1f
2 changed files with 3 additions and 6 deletions

View File

@ -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);

View File

@ -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());
}
}