Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenInputDesktop no found GENERIC_ALL #1949

Open
Junffzz opened this issue Jul 16, 2024 · 5 comments
Open

OpenInputDesktop no found GENERIC_ALL #1949

Junffzz opened this issue Jul 16, 2024 · 5 comments
Labels
question Further information is requested

Comments

@Junffzz
Copy link

Junffzz commented Jul 16, 2024

Suggestion

The OpenInputDesktop function does not have a GENERIC_ALL parameter, or a parameter for complete replacement.

@Junffzz Junffzz added the enhancement New feature or request label Jul 16, 2024
@kennykerr kennykerr added question Further information is requested and removed enhancement New feature or request labels Jul 16, 2024
@kennykerr
Copy link
Contributor

Sounds like a question for the Win32 metadata repo.

@kennykerr kennykerr transferred this issue from microsoft/windows-rs Jul 16, 2024
@0x5bfa
Copy link

0x5bfa commented Jul 17, 2024

Does this related to #1948?

@riverar
Copy link
Collaborator

riverar commented Jul 17, 2024

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
}

@Junffzz
Copy link
Author

Junffzz commented Jul 17, 2024

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
}

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 GENERIC_ACCESS_ RIGHTS

@riverar
Copy link
Collaborator

riverar commented Jul 17, 2024

You would need to cast it, yes. (DESKTOP_ACCESS_FLAGS)GENERIC_ALL or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants