Fixed some macros
[hashcat.git] / src / hashcat.c
index dec2065..3c816fe 100644 (file)
@@ -78,7 +78,7 @@ double TARGET_MS_PROFILE[4]     = { 2, 12, 96, 480 };
 #define NVIDIA_SPIN_DAMP        100
 #define GPU_TEMP_DISABLE        0
 #define GPU_TEMP_ABORT          90
-#define GPU_TEMP_RETAIN         0
+#define GPU_TEMP_RETAIN         65
 #define WORKLOAD_PROFILE        2
 #define KERNEL_ACCEL            0
 #define KERNEL_LOOPS            0
@@ -4235,7 +4235,11 @@ static void *thread_monitor (void *p)
                   }
                   else if (device_param->device_vendor_id == VENDOR_ID_NV)
                   {
-                    #ifdef _POSIX
+                    #ifdef WIN
+                    hm_set_fanspeed_with_device_id_nvapi (device_id, fan_speed_new, 1);
+                    #endif
+
+                    #ifdef LINUX
                     hm_set_fanspeed_with_device_id_xnvctrl (device_id, fan_speed_new);
                     #endif
                   }
@@ -14066,11 +14070,11 @@ int main (int argc, char **argv)
           {
             need_nvml = 1;
 
-            #ifdef _POSIX
+            #ifdef LINUX
             need_xnvctrl = 1;
             #endif
 
-            #ifdef _WIN
+            #ifdef WIN
             need_nvapi = 1;
             #endif
           }
@@ -14512,7 +14516,7 @@ int main (int argc, char **argv)
         }
       }
 
-      if (data.hm_adl == NULL && data.hm_nvml == NULL && data.hm_xnvctrl)
+      if (data.hm_adl == NULL && data.hm_nvml == NULL && data.hm_xnvctrl == NULL)
       {
         gpu_temp_disable = 1;
       }
@@ -14654,7 +14658,7 @@ int main (int argc, char **argv)
           data.hm_device[device_id].xnvctrl           = 0;
           data.hm_device[device_id].od_version        = hm_adapters_adl[platform_devices_id].od_version;
           data.hm_device[device_id].fan_get_supported = hm_adapters_adl[platform_devices_id].fan_get_supported;
-          data.hm_device[device_id].fan_set_supported = hm_adapters_adl[platform_devices_id].fan_set_supported;
+          data.hm_device[device_id].fan_set_supported = 0;
         }
 
         if (device_param->device_vendor_id == VENDOR_ID_NV)
@@ -16180,8 +16184,12 @@ int main (int argc, char **argv)
               }
               else if (device_param->device_vendor_id == VENDOR_ID_NV)
               {
-                #ifdef _POSIX
-                rc = hm_set_fanspeed_with_device_id_xnvctrl (device_id, fanspeed);
+                #ifdef LINUX
+                rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE);
+                #endif
+
+                #ifdef WIN
+                rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, 1);
                 #endif
               }
 
@@ -18382,9 +18390,13 @@ int main (int argc, char **argv)
               }
               else if (device_param->device_vendor_id == VENDOR_ID_NV)
               {
-                #ifdef _POSIX
+                #ifdef LINUX
                 rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE);
                 #endif
+
+                #ifdef WIN
+                rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, fanpolicy);
+                #endif
               }
 
               if (rc == -1) log_info ("WARNING: Failed to restore default fan speed and policy for device #%", device_id + 1);