diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index b5ee386516c2..22a4cf21c974 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -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 diff --git a/src/pal/src/synchobj/semaphore.cpp b/src/pal/src/synchobj/semaphore.cpp index 64905ad48452..a5fe3b89ff3c 100644 --- a/src/pal/src/synchobj/semaphore.cpp +++ b/src/pal/src/synchobj/semaphore.cpp @@ -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 @@ -75,11 +75,20 @@ 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); } /*++ @@ -87,7 +96,7 @@ CreateSemaphoreExA( CreateSemaphoreA Note: - lpSemaphoreAttributes currentely ignored: + lpSemaphoreAttributes currently ignored: -- Win32 object security not supported -- handles to semaphore objects are not inheritable @@ -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); } /*++