mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 20:50:41 +00:00
[SHLWAPI] Implement SHLockSharedEx function (#2430)
- Implement shlwapi!SHLockSharedEx function. - Modify shlwapi.spec file (some argument conversions from long to ptr). CORE-13950
This commit is contained in:
parent
8532c3b6f6
commit
7fcdf0be03
2 changed files with 48 additions and 4 deletions
|
@ -193,6 +193,46 @@ HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
|
|||
return hRet;
|
||||
}
|
||||
|
||||
#ifdef __REACTOS__
|
||||
/*************************************************************************
|
||||
* @ [SHLWAPI.510]
|
||||
*
|
||||
* Get a pointer to a block of shared memory from a shared memory handle,
|
||||
* with specified access rights.
|
||||
*
|
||||
* PARAMS
|
||||
* hShared [I] Shared memory handle
|
||||
* dwProcId [I] ID of process owning hShared
|
||||
* bWriteAccess [I] TRUE to get a writable block,
|
||||
* FALSE to get a read-only block
|
||||
*
|
||||
* RETURNS
|
||||
* Success: A pointer to the shared memory
|
||||
* Failure: NULL
|
||||
*/
|
||||
LPVOID WINAPI
|
||||
SHLockSharedEx(HANDLE hShared, DWORD dwProcId, BOOL bWriteAccess)
|
||||
{
|
||||
HANDLE hDup;
|
||||
LPVOID pMapped;
|
||||
DWORD dwAccess;
|
||||
|
||||
TRACE("(%p %d %d)\n", hShared, dwProcId, bWriteAccess);
|
||||
|
||||
/* Get handle to shared memory for current process */
|
||||
hDup = SHMapHandle(hShared, dwProcId, GetCurrentProcessId(), FILE_MAP_ALL_ACCESS, 0);
|
||||
|
||||
/* Get View */
|
||||
dwAccess = (FILE_MAP_READ | (bWriteAccess ? FILE_MAP_WRITE : 0));
|
||||
pMapped = MapViewOfFile(hDup, dwAccess, 0, 0, 0);
|
||||
CloseHandle(hDup);
|
||||
|
||||
if (pMapped)
|
||||
return (char *) pMapped + sizeof(DWORD); /* Hide size */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*************************************************************************
|
||||
* @ [SHLWAPI.8]
|
||||
*
|
||||
|
@ -209,6 +249,9 @@ HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
|
|||
*/
|
||||
PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
return SHLockSharedEx(hShared, dwProcId, TRUE);
|
||||
#else
|
||||
HANDLE hDup;
|
||||
LPVOID pMapped;
|
||||
|
||||
|
@ -224,6 +267,7 @@ PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
|
|||
if (pMapped)
|
||||
return (char *) pMapped + sizeof(DWORD); /* Hide size */
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
5 stdcall -noname PathFindOnPathExA(str ptr long)
|
||||
6 stdcall -noname PathFindOnPathExW(wstr ptr long)
|
||||
7 stdcall -ordinal SHAllocShared(ptr long long)
|
||||
8 stdcall -ordinal SHLockShared(long long)
|
||||
8 stdcall -ordinal SHLockShared(ptr long)
|
||||
9 stdcall -ordinal SHUnlockShared(ptr)
|
||||
10 stdcall -ordinal SHFreeShared(long long)
|
||||
11 stdcall -noname SHMapHandle(long long long long long)
|
||||
10 stdcall -ordinal SHFreeShared(ptr long)
|
||||
11 stdcall -noname SHMapHandle(ptr long long long long)
|
||||
12 stdcall -noname SHCreateMemStream(ptr long)
|
||||
13 stdcall -noname RegisterDefaultAcceptHeaders(ptr ptr)
|
||||
14 stdcall -ordinal GetAcceptLanguagesA(ptr ptr)
|
||||
|
@ -507,7 +507,7 @@
|
|||
507 stdcall -stub -noname SHPropertyBag_ReadDWORD(ptr ptr ptr)
|
||||
508 stub -noname SHPropertyBag_WriteDWORD
|
||||
509 stdcall -noname IUnknown_OnFocusChangeIS(ptr ptr long)
|
||||
510 stub -noname SHLockSharedEx
|
||||
510 stdcall -noname SHLockSharedEx(ptr long long)
|
||||
511 stdcall -stub -noname PathFileExistsDefExtAndAttributesW(wstr long ptr)
|
||||
512 stub -ordinal IStream_ReadPidl
|
||||
513 stub -ordinal IStream_WritePidl
|
||||
|
|
Loading…
Reference in a new issue