Open Junffzz opened 4 months ago
Sounds like a question for the Win32 metadata repo.
Does this related to #1948?
So to clarify the original issue, the OpenInputDesktop
method accepts an ACCESS_MASK
. Currently, that's mapped to a synthetic enum DESKTOP_ACCESS_FLAGS
, which is missing GENERIC_ALL
(or similar) constant. As a workaround, you can use Windows.Win32.Foundation.GENERIC_ACCESS_RIGHTS.GENERIC_ALL
.
This enum appears to duplicate a lot of existing standard rights, which is something we're discussing in #1948 as well.
public enum DESKTOP_ACCESS_FLAGS : uint
{
DESKTOP_DELETE = 65536u,
DESKTOP_READ_CONTROL = 131072u,
DESKTOP_WRITE_DAC = 262144u,
DESKTOP_WRITE_OWNER = 524288u,
DESKTOP_SYNCHRONIZE = 1048576u,
DESKTOP_READOBJECTS = 1u,
DESKTOP_CREATEWINDOW = 2u,
DESKTOP_CREATEMENU = 4u,
DESKTOP_HOOKCONTROL = 8u,
DESKTOP_JOURNALRECORD = 16u,
DESKTOP_JOURNALPLAYBACK = 32u,
DESKTOP_ENUMERATE = 64u,
DESKTOP_WRITEOBJECTS = 128u,
DESKTOP_SWITCHDESKTOP = 256u
}
So to clarify the original issue, the
OpenInputDesktop
method accepts anACCESS_MASK
. Currently, that's mapped to a synthetic enumDESKTOP_ACCESS_FLAGS
, which is missingGENERIC_ALL
(or similar) constant. As a workaround, you can useWindows.Win32.Foundation.GENERIC_ACCESS_RIGHTS.GENERIC_ALL
.This enum appears to duplicate a lot of existing standard rights, which is something we're discussing in #1948 as well.
public enum DESKTOP_ACCESS_FLAGS : uint { DESKTOP_DELETE = 65536u, DESKTOP_READ_CONTROL = 131072u, DESKTOP_WRITE_DAC = 262144u, DESKTOP_WRITE_OWNER = 524288u, DESKTOP_SYNCHRONIZE = 1048576u, DESKTOP_READOBJECTS = 1u, DESKTOP_CREATEWINDOW = 2u, DESKTOP_CREATEMENU = 4u, DESKTOP_HOOKCONTROL = 8u, DESKTOP_JOURNALRECORD = 16u, DESKTOP_JOURNALPLAYBACK = 32u, DESKTOP_ENUMERATE = 64u, DESKTOP_WRITEOBJECTS = 128u, DESKTOP_SWITCHDESKTOP = 256u }
I can't use Windows.Win32.Foundation.GENERIC_ACCESS_RIGHTS.GENERIC_ALL because OpenInputDesktop's parameter is DESKTOP_ACCESS_FLAGS, but it's of type GENERICACCESS RIGHTS
You would need to cast it, yes. (DESKTOP_ACCESS_FLAGS)GENERIC_ALL
or similar.
Suggestion
The OpenInputDesktop function does not have a GENERIC_ALL parameter, or a parameter for complete replacement.