]> Repos - portaudio/commitdiff
disabled deprecated API warning for GetVersionEx in dsound, wmme and wdmks host APIs.
authorrbencina <rbencina@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 21 Jan 2015 06:24:32 +0000 (06:24 +0000)
committerrbencina <rbencina@0f58301d-fd10-0410-b4af-bbb618454e57>
Wed, 21 Jan 2015 06:24:32 +0000 (06:24 +0000)
src/hostapi/dsound/pa_win_ds.c
src/hostapi/wdmks/pa_win_wdmks.c
src/hostapi/wmme/pa_win_wmme.c

index d06fcc2b3ebf15354d68d3accd53c8d874c0d54f..35fac5f7f03c2579710d983fbd8ad3fdfbd3ecda 100644 (file)
@@ -318,10 +318,21 @@ typedef struct PaWinDsStream
  */
 static double PaWinDS_GetMinSystemLatencySeconds( void )
 {
+/*
+NOTE: GetVersionEx() is deprecated as of Windows 8.1 and can not be used to reliably detect
+versions of Windows higher than Windows 8 (due to manifest requirements for reporting higher versions).
+Microsoft recommends switching to VerifyVersionInfo (available on Win 2k and later), however GetVersionEx
+is is faster, for now we just disable the deprecation warning.
+See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx
+See: http://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe
+*/
+#pragma warning (disable : 4996) /* use of GetVersionEx */
+
     double minLatencySeconds;
     /* Set minimal latency based on whether NT or other OS.
      * NT has higher latency.
      */
+
     OSVERSIONINFO osvi;
     osvi.dwOSVersionInfoSize = sizeof( osvi );
     GetVersionEx( &osvi );
@@ -342,6 +353,8 @@ static double PaWinDS_GetMinSystemLatencySeconds( void )
         minLatencySeconds = PA_DS_WIN_9X_DEFAULT_LATENCY_;
     }
     return minLatencySeconds;
+
+#pragma warning (default : 4996)
 }
 
 
index 6d37bd179d6de2ee847636d04477fb09dc115cae..129b9e2e398d5e1856160f90dd30c6cfde51edac 100644 (file)
@@ -641,6 +641,16 @@ static BOOL IsDeviceTheSame(const PaWinWdmDeviceInfo* pDev1,
 
 static BOOL IsEarlierThanVista()
 {
+/*
+NOTE: GetVersionEx() is deprecated as of Windows 8.1 and can not be used to reliably detect
+versions of Windows higher than Windows 8 (due to manifest requirements for reporting higher versions).
+Microsoft recommends switching to VerifyVersionInfo (available on Win 2k and later), however GetVersionEx
+is is faster, for now we just disable the deprecation warning.
+See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx
+See: http://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe
+*/
+#pragma warning (disable : 4996) /* use of GetVersionEx */
+
     OSVERSIONINFO osvi;
     osvi.dwOSVersionInfoSize = sizeof(osvi);
     if (GetVersionEx(&osvi) && osvi.dwMajorVersion<6)
@@ -648,6 +658,8 @@ static BOOL IsEarlierThanVista()
         return TRUE;
     }
     return FALSE;
+
+#pragma warning (default : 4996)
 }
 
 
index 25fe0cc415f36661d523a3b93428fa652abb45c1..2fb2d49230c34d25c3ed7a6fa8f6967057a13042 100644 (file)
@@ -917,6 +917,16 @@ error:
 
 static void GetDefaultLatencies( PaTime *defaultLowLatency, PaTime *defaultHighLatency )
 {
+/*
+NOTE: GetVersionEx() is deprecated as of Windows 8.1 and can not be used to reliably detect
+versions of Windows higher than Windows 8 (due to manifest requirements for reporting higher versions).
+Microsoft recommends switching to VerifyVersionInfo (available on Win 2k and later), however GetVersionEx
+is is faster, for now we just disable the deprecation warning.
+See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx
+See: http://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe
+*/
+#pragma warning (disable : 4996) /* use of GetVersionEx */
+
     OSVERSIONINFO osvi;
     osvi.dwOSVersionInfoSize = sizeof( osvi );
     GetVersionEx( &osvi );
@@ -936,6 +946,8 @@ static void GetDefaultLatencies( PaTime *defaultLowLatency, PaTime *defaultHighL
     }     
 
     *defaultHighLatency = *defaultLowLatency * 2;
+
+#pragma warning (default : 4996)
 }