@@ -24,10 +24,14 @@ import (
24
24
)
25
25
26
26
var (
27
- ole32 = windows .NewLazySystemDLL ("ole32" )
27
+ kernel32 = windows .NewLazySystemDLL ("kernel32" )
28
+ ole32 = windows .NewLazySystemDLL ("ole32" )
28
29
)
29
30
30
31
var (
32
+ procGetCurrentThread = kernel32 .NewProc ("GetCurrentThread" )
33
+ procSetThreadPriority = kernel32 .NewProc ("SetThreadPriority" )
34
+
31
35
procCoCreateInstance = ole32 .NewProc ("CoCreateInstance" )
32
36
)
33
37
@@ -49,6 +53,7 @@ const (
49
53
_SPEAKER_FRONT_CENTER = 0x4
50
54
_SPEAKER_FRONT_LEFT = 0x1
51
55
_SPEAKER_FRONT_RIGHT = 0x2
56
+ _THREAD_PRIORITY_ABOVE_NORMAL = 1
52
57
_WAVE_FORMAT_EXTENSIBLE = 0xfffe
53
58
)
54
59
@@ -188,6 +193,16 @@ func _CoCreateInstance(rclsid *windows.GUID, pUnkOuter unsafe.Pointer, dwClsCont
188
193
return v , nil
189
194
}
190
195
196
+ func _GetCurrentThread () windows.Handle {
197
+ r , _ , _ := procGetCurrentThread .Call ()
198
+ return windows .Handle (uint32 (r ))
199
+ }
200
+
201
+ func _SetThreadPriority (hThread windows.Handle , nPriority int ) bool {
202
+ r , _ , _ := procSetThreadPriority .Call (uintptr (hThread ), uintptr (nPriority ))
203
+ return uint32 (r ) != 0
204
+ }
205
+
191
206
type _IAudioClient2 struct {
192
207
vtbl * _IAudioClient2_Vtbl
193
208
}
0 commit comments