Remove unroll access for Drupal for NV gpus
[hashcat.git] / include / ext_ADL.h
index b90128b..71ec07f 100644 (file)
@@ -160,11 +160,17 @@ typedef struct ADLODPerformanceLevel
   int iVddc;
 } ADLODPerformanceLevel;
 
+/*
+ * Attention: we had to change this struct due to an out-of-bound problem mentioned here:
+ * https://github.com/hashcat/oclHashcat/issues/244
+ * the change: ADLODPerformanceLevel aLevels [1] -> ADLODPerformanceLevel aLevels [2]
+ */
+
 typedef struct ADLODPerformanceLevels
 {
   int iSize;
   int iReserved;
-  ADLODPerformanceLevel aLevels [1];
+  ADLODPerformanceLevel aLevels [2];
 } ADLODPerformanceLevels;
 
 typedef struct ADLOD6FanSpeedInfo
@@ -221,12 +227,18 @@ typedef struct ADLOD6PerformanceLevel
   int iMemoryClock;
 } ADLOD6PerformanceLevel;
 
+/*
+ * Attention: we had to change this struct due to an out-of-bound problem mentioned here:
+ * https://github.com/hashcat/oclHashcat/issues/244
+ * the change: ADLOD6PerformanceLevel aLevels [1] -> ADLOD6PerformanceLevel aLevels [2]
+ */
+
 typedef struct ADLOD6StateInfo
 {
   int iNumberOfPerformanceLevels;
   int iExtValue;
   int iExtMask;
-  ADLOD6PerformanceLevel aLevels [1];
+  ADLOD6PerformanceLevel aLevels [2];
 } ADLOD6StateInfo;
 
 typedef struct ADLOD6PowerControlInfo
@@ -238,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 );