#1626 SYSTEM_LOGICAL_PROCESSOR_INFORMATION et al missing

WSL
pending
Earnie Boyd
None
Bug
later
Feature_in_WSL_4.1
False
2013-02-11
2012-02-22
Salsaman
No

Attempting to compile the code here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms683194%28v=vs.85%29.aspx
produces a number of errors:

error: unknown type name 'PSYSTEM_LOGICAL_PROCESSOR_INFORMATION'
error: 'SYSTEM_LOGICAL_PROCESSOR_INFORMATION' undeclared
error: unknown type name 'PCACHE_DESCRIPTOR'
error: 'RelationNumaNode' undeclared
error: 'RelationProcessorCore' undeclared
error: 'RelationCache' undeclared
error: 'RelationProcessorPackage' undeclared

at the very least it would be nice to have (P)SYSTEM_LOGICAL_PROCESSOR_INFORMATION and RelationProcessorCore in order to be able to count the number of processors available.

Discussion

  • Earnie Boyd
    Earnie Boyd
    2012-02-22

    These are absent because no one has supplied a patch. As new API become available someone who is interested in needing the new functionality will supply a patch to have it included in the appropriate header guarded by the correct versions of windows the API appeared. Some of what you are using came about for Vista, some came about in Windows 7. If no patch is forth coming eventually, Chris will take care of the addition, but based on his time.

     
  • Earnie Boyd
    Earnie Boyd
    2012-02-22

    • assigned_to: nobody --> ir0nh34d
     
  • At least for GetSystemLogicalProcessInformation, MS SDK does not conditionalize
    this with any kind of WINVER control (in winbase.h, probably because it was documented to be a dynamically linked
    API, requiring GetProcAddress() in the past):

    WINBASEAPI
    BOOL
    WINAPI
    GetLogicalProcessorInformation(
    __out_bcount_part_opt(*ReturnedLength, *ReturnedLength) PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer,
    __inout PDWORD ReturnedLength
    );

    The Ex version is only prototyped when WINVER >= 0x0601 (not shown here).

    The structures are also unconditionally defined in winnt.h:

    typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP {
    RelationProcessorCore,
    RelationNumaNode,
    RelationCache,
    RelationProcessorPackage,
    RelationGroup,
    RelationAll = 0xffff
    } LOGICAL_PROCESSOR_RELATIONSHIP;

    #define LTP_PC_SMT 0x1

    typedef enum _PROCESSOR_CACHE_TYPE {
    CacheUnified,
    CacheInstruction,
    CacheData,
    CacheTrace
    } PROCESSOR_CACHE_TYPE;

    #define CACHE_FULLY_ASSOCIATIVE 0xFF

    typedef struct _CACHE_DESCRIPTOR {
    BYTE Level;
    BYTE Associativity;
    WORD LineSize;
    DWORD Size;
    PROCESSOR_CACHE_TYPE Type;
    } CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR;

    typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION {
    ULONG_PTR ProcessorMask;
    LOGICAL_PROCESSOR_RELATIONSHIP Relationship;
    union {
    struct {
    BYTE Flags;
    } ProcessorCore;
    struct {
    DWORD NodeNumber;
    } NumaNode;
    CACHE_DESCRIPTOR Cache;
    ULONGLONG Reserved[2];
    } DUMMYUNIONNAME;
    } SYSTEM_LOGICAL_PROCESSOR_INFORMATION, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION;

    The Ex version requires more data structures (I'm not including these here).

    I checked the non-Ex API, and it works just as documented, so including at least
    that into win32api support would already help a great deal (so that I can drop
    the local declarations of what supposed to be included in the standard headers).

    Thanks!

    AL

     
  • Earnie Boyd
    Earnie Boyd
    2012-08-04

    • assigned_to: ir0nh34d --> earnie
     
  • Earnie Boyd
    Earnie Boyd
    2012-10-23

    • labels: 103945 --> WSL (Windows System Libraries)
    • milestone: --> Feature_in_WSL_4.1
    • status: open --> open-later
     
  • Earnie Boyd
    Earnie Boyd
    2012-10-23

    I need to study the effects of the requirements before including these.

    Requirements
    Minimum supported client
    Windows Vista, Windows XP Professional x64 Edition
    Minimum supported server
    Windows Server 2003

     
  • Earnie Boyd
    Earnie Boyd
    2012-10-24

    • status: open-later --> pending-later
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-18

    • category: --> Feature_in_WSL_4.1
    • milestone: Feature_in_WSL_4.1 --> WSL
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-04

    • labels: WSL (Windows System Libraries) -->
    • status: pending-later --> pending
    • resolution: --> later
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-11

    • type: --> Bug
    • patch_attached: --> False