News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

SYSTEM_CPU_SET_INFORMATION struct

Started by six_L, June 29, 2020, 08:10:24 PM

Previous topic - Next topic

six_L

hello all.
this is the struct of C++ from Microsoft documentation
typedef struct _SYSTEM_CPU_SET_INFORMATION {
  DWORD                    Size;
  CPU_SET_INFORMATION_TYPE Type;
  union {
    struct {
      DWORD   Id;
      WORD    Group;
      BYTE    LogicalProcessorIndex;
      BYTE    CoreIndex;
      BYTE    LastLevelCacheIndex;
      BYTE    NumaNodeIndex;
      BYTE    EfficiencyClass;
      union {
        BYTE AllFlags;
        struct {
          BYTE Parked : 1;
          BYTE Allocated : 1;
          BYTE AllocatedToTargetProcess : 1;
          BYTE RealTime : 1;
          BYTE ReservedFlags : 4;
        } DUMMYSTRUCTNAME;
      } DUMMYUNIONNAME2;
      union {
        DWORD Reserved;
        BYTE  SchedulingClass;
      };
      DWORD64 AllocationTag;
    } CpuSet;
  } DUMMYUNIONNAME;
} SYSTEM_CPU_SET_INFORMATION

this is the struct of h2incx Transformation.
SYSTEM_CPU_SET_INFORMATION struct
Size_ DWORD ?
Type_ CPU_SET_INFORMATION_TYPE ?
union DUMMYUNIONNAME
struct CpuSet
Id DWORD ?
Group_ WORD ?
LogicalProcessorIndex BYTE ?
CoreIndex BYTE ?
LastLevelCacheIndex BYTE ?
NumaNodeIndex BYTE ?
EfficiencyClass BYTE ?
union DUMMYUNIONNAME2
AllFlags BYTE ?
struct DUMMYSTRUCTNAME
DUMMYSTRUCTNAME_R0 RECORD Parked:1,Allocated:1,AllocatedToTargetProcess:1,RealTime:1,ReservedFlags:4
DUMMYSTRUCTNAME_R0 <>
ends
ends
union
Reserved DWORD ?
SchedulingClass BYTE ?
ends
AllocationTag DWORD64 ?
ends
ends
SYSTEM_CPU_SET_INFORMATION ends

I think it should be as following.

CPU_SET_INFORMATION_TYPE typedef DWORD

DUMMYSTRUCTNAME struct
Parked BYTE ?
Allocated BYTE ?
AllocatedToTargetProcess BYTE ?
RealTime BYTE ?
ReservedFlags BYTE ?
DUMMYSTRUCTNAME ends

CPUSET struct
Id DWORD ?
Group_ WORD ?
LogicalProcessorIndex BYTE ?
CoreIndex BYTE ?
LastLevelCacheIndex BYTE ?
NumaNodeIndex BYTE ?
EfficiencyClass BYTE ?
union
AllFlags BYTE ?
dummystructname_ DUMMYSTRUCTNAME<>
ends
union
Reserved DWORD ?
SchedulingClass BYTE ?
ends
AllocationTag DWORD64 ?
CPUSET ends

SYSTEM_CPU_SET_INFORMATION struct
_Size DWORD ?
_Type CPU_SET_INFORMATION_TYPE ?
union
CpuSet_ CPUSET<?>

ends
SYSTEM_CPU_SET_INFORMATION ends

is it right?
Say you, Say me, Say the codes together for ever.

Biterider

#1
Hi
As far as I remember this C structure
struct {
          BYTE Parked : 1;
          BYTE Allocated : 1;
          BYTE AllocatedToTargetProcess : 1;
          BYTE RealTime : 1;
          BYTE ReservedFlags : 4;
        } DUMMYSTRUCTNAME;

is a bit field packed into a single BYTE. There are compiler implementation differences but you can get the idea here https://en.wikipedia.org/wiki/Bit_field#:~:text=A%20bit%20field%20is%20a,the%20set%20can%20be%20addressed.

Biterider

TouEnMasm

#2
DEFALIGNMASM TEXTEQU <QWORD>

RECASYSTEM_CPU_SET_INFORMATION      RECORD     AAReservedFlags : 4,
            AARealTime : 1,
            AAAllocatedToTargetProcess : 1,
            AAAllocated : 1,
            AAParked : 1

SYSTEM_CPU_SET_INFORMATION   STRUCT DEFALIGNMASM
   asize DWORD ?
   atype CPU_SET_INFORMATION_TYPE ?
   union   DUMMYUNIONNAME
   STRUCT   CpuSet
   Id DWORD ?
   agroup WORD ?
   LogicalProcessorIndex BYTE ?
   CoreIndex BYTE ?
   LastLevelCacheIndex BYTE ?
   NumaNodeIndex BYTE ?
   EfficiencyClass BYTE ?
   union   DUMMYUNIONNAME2
   AllFlags BYTE ?
   STRUCT   DUMMYSTRUCTNAME
   RECASYSTEM_CPU_SET_INFORMATION BYTE ?
   ENDS
   ENDS
   union
   Reserved DWORD ?
   SchedulingClass BYTE ?
   ENDS
   AllocationTag QWORD ?
   ENDS
   ENDS
SYSTEM_CPU_SET_INFORMATION      ENDS

Fa is a musical note to play with CL

six_L

hello,Biterider,TouEnMasm.
thanks you for the useable infomation. :thumbsup:
I need a lot of time to learn deeply.
hope to someone would maintain the inc and lib of UASM.
Say you, Say me, Say the codes together for ever.

TouEnMasm

Fa is a musical note to play with CL

six_L

hi,TouEnMasm
thanks you for the link(Headinc : http://luce.yves.pagesperso-orange.fr/header.htm)
Say you, Say me, Say the codes together for ever.