Closed seritools closed 2 months ago
This is more of a Win32 metadata issue - will forward for their consideration.
I think you're looking for SYNCHRONIZATION_SYNCHRONIZE
, here's the enum:
[Flags]
public enum SYNCHRONIZATION_ACCESS_RIGHTS : uint
{
EVENT_ALL_ACCESS = 0x1F0003u,
EVENT_MODIFY_STATE = 2u,
MUTEX_ALL_ACCESS = 0x1F0001u,
MUTEX_MODIFY_STATE = 1u,
SEMAPHORE_ALL_ACCESS = 0x1F0003u,
SEMAPHORE_MODIFY_STATE = 2u,
TIMER_ALL_ACCESS = 0x1F0003u,
TIMER_MODIFY_STATE = 2u,
TIMER_QUERY_STATE = 1u,
SYNCHRONIZATION_DELETE = 0x10000u,
SYNCHRONIZATION_READ_CONTROL = 0x20000u,
SYNCHRONIZATION_WRITE_DAC = 0x40000u,
SYNCHRONIZATION_WRITE_OWNER = 0x80000u,
SYNCHRONIZATION_SYNCHRONIZE = 0x100000u
}
interesting! I guess it doesn't match the MSDN docs because it collides with the FILE_ACCESS_RIGHTS definition. rustdoc/windows-docs-rs doesn't seem to have an easy way for "give me all constants of this type" → gotta remember to fire up IlSpy in the future to check ^^
thanks! not sure if there are any actionable issues then, feel free to close
Yup, we're forced to ensure enum constants are unique as some projections emit them as global constants. Will close for now, but feel free to reach out again as needed.
Suggestion
Functions like
OpenMutexW
expect aSYNCHRONIZATION_ACCESS_RIGHTS
value, however the constants for it are not exposed.It seems like the ones that are shared with
windows::Win32::Storage::FileSystem::FILE_ACCESS_RIGHTS
, such asSYNCHRONIZE
, are missing inwindows::Win32::System::Threading
.This makes it a bit harder to discover the values, esp. if the
"Win32_Storage_FileSystem"
feature is not enabled. In our project, my colleague ported somewinapi
-based code, but couldn't findSYNCHRONIZE
with the correct newtype wrapper and fell back to manually specifying the value0x00100000
for it.