Home > Net >  There is a passage about NVAPI C # how to structure the C version?
There is a passage about NVAPI C # how to structure the C version?

Time:04-11

[StructLayout (LayoutKind. Sequential)]
Internal struct PrivateFanCoolersControlV1 {
Internal NvU32 version;
Internal uint UnknownUInt;
Internal uint FanCoolersControlCount;

[MarshalAs (UnmanagedType ByValArray, SizeConst=8)]
Internal uint [] Reserved;

[MarshalAs (UnmanagedType. ByValArray, SizeConst=NvapiConst MaxNumberOfFanCoolerControlEntries)]
Internal FanCoolersControlEntry [] FanCoolersControlEntries;

Public static PrivateFanCoolersControlV1 the Create () {
Var r=new PrivateFanCoolersControlV1 {
Version=(uint) (NvapiConst VERSION1 | (Marshal. SizeOf (typeof (PrivateFanCoolersControlV1)))),
Reserved=new NvU32 [8],
FanCoolersControlEntries=new FanCoolersControlEntry [NvapiConst MaxNumberOfFanCoolerControlEntries]
};
for (int i=0; I R.F anCoolersControlEntries [I]=FanCoolersControlEntry. The Create ();
}

return r;
}
}
  •  Tags:  
  • C#
  • Related