Added support for --gpu-temp-retain for nvidia devices on windows
[hashcat.git] / include / ext_ADL.h
index 0146b8b..285f0e2 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef EXT_ADL_H
 #define EXT_ADL_H
 
-#if defined(HAVE_HWMON) && defined(HAVE_ADL)
+#if defined(HAVE_HWMON)
 
 #include <common.h>
 
@@ -162,7 +162,7 @@ typedef struct ADLODPerformanceLevel
 
 /*
  * Attention: we had to change this struct due to an out-of-bound problem mentioned here:
- * https://github.com/hashcat/oclHashcat/issues/244
+ * https://github.com/hashcat/hashcat/issues/244
  * the change: ADLODPerformanceLevel aLevels [1] -> ADLODPerformanceLevel aLevels [2]
  */
 
@@ -229,7 +229,7 @@ typedef struct ADLOD6PerformanceLevel
 
 /*
  * Attention: we had to change this struct due to an out-of-bound problem mentioned here:
- * https://github.com/hashcat/oclHashcat/issues/244
+ * https://github.com/hashcat/hashcat/issues/244
  * the change: ADLOD6PerformanceLevel aLevels [1] -> ADLOD6PerformanceLevel aLevels [2]
  */
 
@@ -250,9 +250,18 @@ typedef struct ADLOD6PowerControlInfo
   int iExtMask;
 } ADLOD6PowerControlInfo;
 
+/* __stdcall definition, platform-dependent:
+ * - Already defined on Windows compilers
+ * - GCC has a suitable equivalent on 32-bit platforms
+ * - Leave it blank for other platforms/compilers
+ */
 #if !(defined (_WIN32) || defined (_WIN64))
+#if (defined(__GNUC__) && defined(__i386__))
+#define __stdcall __attribute__((stdcall))
+#else
 #define __stdcall
-#endif
+#endif /* GCC 32-bit  */
+#endif /* Not windows */
 
 typedef void* (__stdcall *ADL_MAIN_MALLOC_CALLBACK )( int );
 
@@ -303,6 +312,7 @@ typedef int (*ADL_OVERDRIVE6_CAPABILITIES_GET) (int, ADLOD6Capabilities *);
 typedef int (*ADL_OVERDRIVE6_STATE_SET) (int, int, ADLOD6StateInfo *);
 typedef int (*ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *);
 typedef int (*ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *);
+typedef int (*ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *);
 
 typedef struct
 {
@@ -340,6 +350,7 @@ typedef struct
   ADL_OVERDRIVE6_CURRENTSTATUS_GET ADL_Overdrive6_CurrentStatus_Get;
   ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set;
   ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get;
+  ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get;
 
 } hm_adl_lib_t;
 
@@ -380,7 +391,8 @@ int hm_ADL_Overdrive_Capabilities_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6Ca
 int hm_ADL_Overdrive_State_Set (ADL_PTR *adl, int iAdapterIndex, int type, ADLOD6StateInfo *state);
 int hm_ADL_Overdrive6_PowerControl_Caps (ADL_PTR *adl, int iAdapterIndex, int *lpSupported);
 int hm_ADL_Overdrive6_TargetTemperatureData_Get (ADL_PTR *adl, int iAdapterIndex, int *cur_temp, int *default_temp);
+int hm_ADL_Overdrive6_TargetTemperatureRangeInfo_Get (ADL_PTR *adl, int iAdapterIndex, ADLOD6ParameterRange *lpTargetTemperatureInfo);
 
-#endif // HAVE_HWMON && HAVE_ADL
+#endif // HAVE_HWMON
 
 #endif // EXT_ADL_H