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

OBJ_INHERIT and related attributes are int whereas OBJECT_ATTRIBUTES.Attributes is uint #73

Open
ChrisDenton opened this issue Jul 15, 2024 · 0 comments
Assignees

Comments

@ChrisDenton
Copy link

In the metadata Windows.Wdk.Foundation.OBJECT_ATTRIBUTES is defined as:

public struct OBJECT_ATTRIBUTES
{
	public uint Length;
	public HANDLE RootDirectory;
	[Const]
	public unsafe UNICODE_STRING* ObjectName;

	public uint Attributes;

	[Const]
	public unsafe void* SecurityDescriptor;
	[Const]
	public unsafe void* SecurityQualityOfService;
}

Note that the Attributes field is uint. However, the attributes that can be set are defined as int:

// Windows.Win32.System.Kernel.Apis
public static class Apis
{
	public const int OBJ_INHERIT = 2;
	public const int OBJ_PERMANENT = 16;
	public const int OBJ_EXCLUSIVE = 32;
	public const int OBJ_CASE_INSENSITIVE = 64;
	public const int OBJ_OPENIF = 128;
	public const int OBJ_OPENLINK = 256;
	public const int OBJ_KERNEL_HANDLE = 512;
	public const int OBJ_FORCE_ACCESS_CHECK = 1024;
	public const int OBJ_IGNORE_IMPERSONATED_DEVICEMAP = 2048;
	public const int OBJ_DONT_REPARSE = 4096;
	public const int OBJ_VALID_ATTRIBUTES = 8178;
}
@mikebattista mikebattista self-assigned this Nov 8, 2024
mikebattista added a commit to microsoft/win32metadata that referenced this issue Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants