From: SF/projects/mingw n. l. <min...@li...> - 2012-10-23 16:44:22
|
Bugs item #3490471, was opened at 2012-02-21 18:25 Message generated for change (Comment added) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3490471&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: WSL (Windows System Libraries) >Group: Feature in WSL 4.1 Status: Open >Resolution: Later Priority: 5 Private: No Submitted By: Salsaman (gfinch) Assigned to: Earnie Boyd (earnie) Summary: SYSTEM_LOGICAL_PROCESSOR_INFORMATION et al missing Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2012-10-23 09:44 Message: 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 ---------------------------------------------------------------------- Comment By: Anton Lavrentiev (alavrentiev) Date: 2012-06-13 10:01 Message: 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 ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2012-02-22 04:29 Message: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3490471&group_id=2435 |