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

THREADINFOCLASS declares only 2 of many enum values #1439

Closed
AArnott opened this issue Jan 24, 2023 · 12 comments
Closed

THREADINFOCLASS declares only 2 of many enum values #1439

AArnott opened this issue Jan 24, 2023 · 12 comments
Assignees
Labels
missing api Some documented API is missing from the metadata

Comments

@AArnott
Copy link
Member

AArnott commented Jan 24, 2023

The THREADINFOCLASS enum in the metadata defines only two of many enum values:

metadata:

public enum THREADINFOCLASS
{
	ThreadIsIoPending = 16,
	ThreadNameInformation = 38
}

source

typedef enum _THREADINFOCLASS {
    ThreadBasicInformation,
    ThreadTimes,
    ThreadPriority,
    ThreadBasePriority,
    ThreadAffinityMask,
    ThreadImpersonationToken,
    ThreadDescriptorTableEntry,
    ThreadEnableAlignmentFaultFixup,
    ThreadEventPair_Reusable,
    ThreadQuerySetWin32StartAddress,
    ThreadZeroTlsCell,
    ThreadPerformanceCount,
    ThreadAmILastThread,
    ThreadIdealProcessor,
    ThreadPriorityBoost,
    ThreadSetTlsArrayAddress,
    ThreadIsIoPending,
    ThreadHideFromDebugger,
    ThreadBreakOnTermination,
    ThreadSwitchLegacyState,
    ThreadTebInformation,
    ThreadIoPriority,
    ThreadIsJoinedToReserve,
    ThreadResourceManagement,
    ThreadPagePriority,
    MaxThreadInfoClass
    } THREADINFOCLASS;
@AArnott AArnott added the missing api Some documented API is missing from the metadata label Jan 24, 2023
@mikebattista
Copy link
Collaborator

The 2 values that are there appear to be the only 2 values defined in the SDK header. Are the others coming from the WDK?

@AArnott
Copy link
Member Author

AArnott commented Jan 24, 2023

I don't know how to tell whether a given header file is in the SDK or WDK. But the link in the issue description shows just how many places this is defined, and nearly all of them have a much longer list than the metadata. The only 'short' def I could find didn't match the metadata either.

@mikebattista
Copy link
Collaborator

The only headers that matter are the ones at https://github.com/microsoft/win32metadata/tree/main/generation/WinSDK/RecompiledIdlHeaders which we get from the public SDK NuGet packages.

@AArnott
Copy link
Member Author

AArnott commented Jan 24, 2023

If that's the public SDK, how come this doc documents more than what's in the public SDK?

@mikebattista
Copy link
Collaborator

Those are WDK docs. That may contain more definitions.

@AArnott
Copy link
Member Author

AArnott commented Jan 24, 2023

When an enum has values that are split across two worlds like this, how do we see CsWin32 generating code when the WDK is available, when the 2 metadata winmd's each contain subsets of the same enum type? If one is 'complete' and one is partial, we still need a definitive plan for how to merge them in code generation.

@kennykerr
Copy link
Contributor

Unless the WDK is merged with the SDK metadata, overlapping types would presumably be moved entirely into the SDK and the WDK would then depend on the SDK e.g. Windows.Wdk.winmd would refer to Windows.Win32.winmd.

@mikebattista
Copy link
Collaborator

Yes I'd expect any overlapping definitions would need to move to the SDK metadata.

@mikebattista mikebattista added the wdk Windows Driver Kit label Jan 24, 2023
@mikebattista mikebattista self-assigned this Jan 24, 2023
@mikebattista mikebattista removed the wdk Windows Driver Kit label Feb 22, 2023
@mikebattista
Copy link
Collaborator

Keeping this issue here since shared definitions should be consolidated into the SDK metadata.

mikebattista added a commit to microsoft/wdkmetadata that referenced this issue Feb 28, 2023
@mikebattista
Copy link
Collaborator

Are these enums supposed to be int or uint?

@AArnott
Copy link
Member Author

AArnott commented Mar 2, 2023

That's hard to say sometimes. I did find this in one of the Windows headers:

typedef int THREADINFOCLASS;

So maybe go with int.

@mikebattista
Copy link
Collaborator

Thanks.

mikebattista added a commit that referenced this issue Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing api Some documented API is missing from the metadata
Projects
None yet
Development

No branches or pull requests

3 participants