private bool NvFanCoolersGetControl(int busId, out PrivateFanCoolersControlV1 info) { info = new PrivateFanCoolersControlV1(); if (NvapiNativeMethods.NvFanCoolersGetControl == null) { return(false); } try { if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle)) { return(false); } info.version = (uint)(VERSION1 | (Marshal.SizeOf(typeof(PrivateFanCoolersControlV1)))); var r = NvapiNativeMethods.NvFanCoolersGetControl(handle, ref info); if (r != NvStatus.NVAPI_OK) { NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvFanCoolersGetControl)} {r.ToString()}"); return(false); } return(true); } catch { } return(false); }
private bool NvFanCoolersGetControl(int busId, out PrivateFanCoolersControlV1 info) { info = new PrivateFanCoolersControlV1(); if (NvapiNativeMethods.NvFanCoolersGetControl == null) { return(false); } info.version = (uint)(VERSION1 | (Marshal.SizeOf(typeof(PrivateFanCoolersControlV1)))); var r = NvapiNativeMethods.NvFanCoolersGetControl(HandlesByBusId[busId], ref info); if (r != NvStatus.OK) { Write.DevError($"{nameof(NvapiNativeMethods.NvFanCoolersGetControl)} {r}"); return(false); } return(true); }
private static bool NvFanCoolersGetControl(int busId, out PrivateFanCoolersControlV1 info) { info = PrivateFanCoolersControlV1.Create(); if (NvapiNativeMethods.NvFanCoolersGetControl == null) { return(false); } try { if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle)) { return(false); } var r = NvapiNativeMethods.NvFanCoolersGetControl(handle, ref info); if (r != NvStatus.NVAPI_OK) { NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvFanCoolersGetControl)} {r.ToString()}"); return(false); } return(true); } catch { } return(false); }