' ########################################################################################
' Microsoft Windows
' File: avrt.inc
' Contents: Multimedia class scheduler APIs
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_avrt_PBI)
#DEFINE PBX_avrt_PBI
%EQUATE `AVRT_INC = 1
'//
'// AvRt Priorities
'//
' enum _AVRT_PRIORITY
MACRO AVRT_PRIORITY_ENUM = LONG
%EQUATE `AVRT_PRIORITY_LOW = -1
%EQUATE `AVRT_PRIORITY_NORMAL = 0
%EQUATE `AVRT_PRIORITY_HIGH = 1
%EQUATE `AVRT_PRIORITY_CRITICAL = 2
'//
'// Infinite timeout for a thread order group.
'//
%EQUATE `THREAD_ORDER_GROUP_INFINITE_TIMEOUT = -1&& ' (-1I64)
DECLARE FUNCTION AvSetMmThreadCharacteristicsA LIB "avrt.dll" ALIAS "AvSetMmThreadCharacteristicsA" ( BYREF TaskName AS ASCIIZ , BYREF TaskIndex AS QUAD ) AS QUAD
DECLARE FUNCTION AvSetMmThreadCharacteristicsW LIB "avrt.dll" ALIAS "AvSetMmThreadCharacteristicsW" ( BYREF TaskName AS WSTRINGZ
 , BYREF TaskIndex AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
MACRO AvSetMmThreadCharacteristics = AvSetMmThreadCharacteristicsW
#ELSE
MACRO AvSetMmThreadCharacteristics = AvSetMmThreadCharacteristicsA
#ENDIF
DECLARE FUNCTION AvSetMmMaxThreadCharacteristicsA LIB "avrt.dll" ALIAS "AvSetMmMaxThreadCharacteristicsA" ( BYREF FirstTask AS ASCIIZ , BYREF SecondTask AS ASCIIZ , BYREF TaskIndex AS QUAD ) AS QUAD
DECLARE FUNCTION AvSetMmMaxThreadCharacteristicsW LIB "avrt.dll" ALIAS "AvSetMmMaxThreadCharacteristicsW" ( BYREF FirstTask AS WSTRINGZ
 , BYREF SecondTask AS WSTRINGZ
 , BYREF TaskIndex AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
MACRO AvSetMmMaxThreadCharacteristics = AvSetMmMaxThreadCharacteristicsW
#ELSE
MACRO AvSetMmMaxThreadCharacteristics = AvSetMmMaxThreadCharacteristicsA
#ENDIF
DECLARE FUNCTION AvRevertMmThreadCharacteristics LIB "avrt.dll" ALIAS "AvRevertMmThreadCharacteristics" ( BYVAL AvrtHandle AS QUAD ) AS LONG
DECLARE FUNCTION AvSetMmThreadPriority LIB "avrt.dll" ALIAS "AvSetMmThreadPriority" ( BYVAL AvrtHandle AS QUAD
 , BYVAL Priority AS AVRT_PRIORITY_ENUM
 ) AS LONG
' The Period and Timeout parameters have been declared AS ANY to allow the use of
' a LARGE_INTEGER structure of a QUAD variable.
DECLARE FUNCTION AvRtCreateThreadOrderingGroup LIB "avrt.dll" ALIAS "AvRtCreateThreadOrderingGroup" ( BYREF Context AS QUAD , BYREF Period AS ANY , BYREF ThreadOrderingGuid AS GUID , OPTIONAL BYREF Timeout AS ANY ) AS LONG
' The Period and Timeout parameters have been declared AS ANY to allow the use of
' a LARGE_INTEGER structure of a QUAD variable.
DECLARE FUNCTION AvRtCreateThreadOrderingGroupExA LIB "avrt.dll" ALIAS "AvRtCreateThreadOrderingGroupExA" ( BYREF Context AS QUAD , BYREF Period AS ANY , BYREF ThreadOrderingGuid AS GUID , BYREF Timeout AS ANY , BYREF TaskName AS ASCIIZ ) AS LONG
' The Period and Timeout parameters have been declared AS ANY to allow the use of
' a LARGE_INTEGER structure of a QUAD variable.
DECLARE FUNCTION AvRtCreateThreadOrderingGroupExW LIB "avrt.dll" ALIAS "AvRtCreateThreadOrderingGroupExW" ( BYREF Context AS QUAD , BYREF Period AS ANY , BYREF ThreadOrderingGuid AS GUID , BYREF Timeout AS ANY , BYREF TaskName AS WSTRINGZ ) AS LONG
#IF %DEF(%UNICODE)
MACRO AvRtCreateThreadOrderingGroupEx = AvRtCreateThreadOrderingGroupExW
#ELSE
MACRO AvRtCreateThreadOrderingGroupEx = AvRtCreateThreadOrderingGroupExA
#ENDIF
DECLARE FUNCTION AvRtJoinThreadOrderingGroup LIB "avrt.dll" ALIAS "AvRtJoinThreadOrderingGroup" ( BYREF Context AS QUAD , BYREF ThreadOrderingGuid AS GUID , BYVAL Before AS LONG ) AS LONG
DECLARE FUNCTION AvRtWaitOnThreadOrderingGroup LIB "avrt.dll" ALIAS "AvRtWaitOnThreadOrderingGroup" ( BYVAL Context AS QUAD
 ) AS LONG
DECLARE FUNCTION AvRtLeaveThreadOrderingGroup LIB "avrt.dll" ALIAS "AvRtLeaveThreadOrderingGroup" ( BYVAL Context AS DWORD
 ) AS LONG
DECLARE FUNCTION AvRtDeleteThreadOrderingGroup LIB "avrt.dll" ALIAS "AvRtDeleteThreadOrderingGroup" ( BYVAL Context AS DWORD
 ) AS LONG
DECLARE FUNCTION AvQuerySystemResponsiveness LIB "avrt.dll" ALIAS "AvQuerySystemResponsiveness" ( BYVAL AvrtHandle AS DWORD
 , BYREF SystemResponsivenessValue AS DWORD
 ) AS LONG
#ENDIF
