00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __JackMMCSS__
00023 #define __JackMMCSS__
00024
00025 #include "JackSystemDeps.h"
00026 #include "JackCompilerDeps.h"
00027 #include <windows.h>
00028 #include <map>
00029
00030 namespace Jack
00031 {
00032
00033 typedef enum _AVRT_PRIORITY {
00034 AVRT_PRIORITY_LOW = -1,
00035 AVRT_PRIORITY_NORMAL,
00036 AVRT_PRIORITY_HIGH,
00037 AVRT_PRIORITY_CRITICAL
00038 } AVRT_PRIORITY, *PAVRT_PRIORITY;
00039
00040 typedef HANDLE (WINAPI *avSetMmThreadCharacteristics)(LPCTSTR, LPDWORD);
00041 typedef BOOL (WINAPI *avRevertMmThreadCharacteristics)(HANDLE);
00042 typedef BOOL (WINAPI *avSetMmThreadPriority)(HANDLE, AVRT_PRIORITY);
00043
00048 class SERVER_EXPORT JackMMCSS
00049 {
00050
00051 private:
00052
00053 static JACK_HANDLE fAvrtDll;
00054 static avSetMmThreadCharacteristics ffMMCSSFun1;
00055 static avSetMmThreadPriority ffMMCSSFun2;
00056 static avRevertMmThreadCharacteristics ffMMCSSFun3;
00057 static std::map<jack_native_thread_t, HANDLE> fHandleTable;
00058
00059 public:
00060
00061 JackMMCSS();
00062 ~JackMMCSS();
00063
00064 static int MMCSSAcquireRealTime(jack_native_thread_t thread);
00065 static int MMCSSDropRealTime(jack_native_thread_t thread);
00066
00067 };
00068
00069 }
00070
00071 #endif
00072