disabled deprecated API warning for GetVersionEx in dsound, wmme and wdmks host APIs.
This commit is contained in:
parent
71b8f8142e
commit
b3216e814b
3 changed files with 37 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue