Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,17 @@ CreateSemaphoreA(
IN LONG lMaximumCount,
IN LPCSTR lpName);

PALIMPORT
HANDLE
PALAPI
CreateSemaphoreExA(
IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
IN LONG lInitialCount,
IN LONG lMaximumCount,
IN LPCSTR lpName,
IN /*_Reserved_*/ DWORD dwFlags,
IN DWORD dwDesiredAccess);

PALIMPORT
HANDLE
PALAPI
Expand Down
34 changes: 25 additions & 9 deletions src/pal/src/synchobj/semaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CAllowedObjectTypes aotSempahore(otiSemaphore);
CreateSemaphoreExA

Note:
lpSemaphoreAttributes currentely ignored:
lpSemaphoreAttributes currently ignored:
-- Win32 object security not supported
-- handles to semaphore objects are not inheritable

Expand All @@ -75,19 +75,28 @@ CreateSemaphoreExA(
IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
IN LONG lInitialCount,
IN LONG lMaximumCount,
IN LPCSTR lpName)
IN LPCSTR lpName,
IN /*_Reserved_*/ DWORD dwFlags,
IN DWORD dwDesiredAccess)
{
// TODO: Implement this!
ERROR("Needs Implementation!!!");
return NULL;
// dwFlags is reserved and unused, and dwDesiredAccess is currently
// only ever used as SEMAPHORE_ALL_ACCESS. The other parameters
// all map to CreateSemaphoreA.
_ASSERTE(SEMAPHORE_ALL_ACCESS == dwDesiredAccess);

return CreateSemaphoreA(
lpSemaphoreAttributes,
lInitialCount,
lMaximumCount,
lpName);
}

/*++
Function:
CreateSemaphoreA

Note:
lpSemaphoreAttributes currentely ignored:
lpSemaphoreAttributes currently ignored:
-- Win32 object security not supported
-- handles to semaphore objects are not inheritable

Expand Down Expand Up @@ -190,9 +199,16 @@ CreateSemaphoreExW(
IN /*_Reserved_*/ DWORD dwFlags,
IN DWORD dwDesiredAccess)
{
// TODO: Implement this!
ERROR("Needs Implementation!!!");
return NULL;
// dwFlags is reserved and unused, and dwDesiredAccess is currently
// only ever used as SEMAPHORE_ALL_ACCESS. The other parameters
// all map to CreateSemaphoreW.
_ASSERTE(SEMAPHORE_ALL_ACCESS == dwDesiredAccess);

return CreateSemaphoreW(
lpSemaphoreAttributes,
lInitialCount,
lMaximumCount,
lpName);
}

/*++
Expand Down