@@ -102,7 +102,7 @@ var (
102
102
)
103
103
104
104
func netpollinit () {
105
- iocphandle = stdcall4 (_CreateIoCompletionPort , _INVALID_HANDLE_VALUE , 0 , 0 , _DWORD_MAX )
105
+ iocphandle = stdcall (_CreateIoCompletionPort , _INVALID_HANDLE_VALUE , 0 , 0 , _DWORD_MAX )
106
106
if iocphandle == 0 {
107
107
println ("runtime: CreateIoCompletionPort failed (errno=" , getlasterror (), ")" )
108
108
throw ("runtime: netpollinit failed" )
@@ -115,7 +115,7 @@ func netpollIsPollDescriptor(fd uintptr) bool {
115
115
116
116
func netpollopen (fd uintptr , pd * pollDesc ) int32 {
117
117
key := packNetpollKey (netpollSourceReady , pd )
118
- if stdcall4 (_CreateIoCompletionPort , fd , iocphandle , key , 0 ) == 0 {
118
+ if stdcall (_CreateIoCompletionPort , fd , iocphandle , key , 0 ) == 0 {
119
119
return int32 (getlasterror ())
120
120
}
121
121
return 0
@@ -137,7 +137,7 @@ func netpollBreak() {
137
137
}
138
138
139
139
key := packNetpollKey (netpollSourceBreak , nil )
140
- if stdcall4 (_PostQueuedCompletionStatus , iocphandle , 0 , key , 0 ) == 0 {
140
+ if stdcall (_PostQueuedCompletionStatus , iocphandle , 0 , key , 0 ) == 0 {
141
141
println ("runtime: netpoll: PostQueuedCompletionStatus failed (errno=" , getlasterror (), ")" )
142
142
throw ("runtime: netpoll: PostQueuedCompletionStatus failed" )
143
143
}
@@ -197,7 +197,7 @@ func netpoll(delay int64) (gList, int32) {
197
197
if delay != 0 {
198
198
mp .blocked = true
199
199
}
200
- if stdcall6 (_GetQueuedCompletionStatusEx , iocphandle , uintptr (unsafe .Pointer (& entries [0 ])), uintptr (n ), uintptr (unsafe .Pointer (& n )), uintptr (wait ), 0 ) == 0 {
200
+ if stdcall (_GetQueuedCompletionStatusEx , iocphandle , uintptr (unsafe .Pointer (& entries [0 ])), uintptr (n ), uintptr (unsafe .Pointer (& n )), uintptr (wait ), 0 ) == 0 {
201
201
mp .blocked = false
202
202
errno := getlasterror ()
203
203
if errno == _WAIT_TIMEOUT {
@@ -256,20 +256,20 @@ func netpollQueueTimer(delay int64) (signaled bool) {
256
256
// such as a netpollBreak, so we can get to this point with a timer that hasn't
257
257
// expired yet. In this case, the completion packet can still be picked up by
258
258
// another thread, so defer the cancellation until it is really necessary.
259
- errno := stdcall2 (_NtCancelWaitCompletionPacket , mp .waitIocpHandle , 1 )
259
+ errno := stdcall (_NtCancelWaitCompletionPacket , mp .waitIocpHandle , 1 )
260
260
switch errno {
261
261
case STATUS_CANCELLED :
262
262
// STATUS_CANCELLED is returned when the associated timer has already expired,
263
263
// in which automatically cancels the wait completion packet.
264
264
fallthrough
265
265
case STATUS_SUCCESS :
266
266
dt := - delay / 100 // relative sleep (negative), 100ns units
267
- if stdcall6 (_SetWaitableTimer , mp .waitIocpTimer , uintptr (unsafe .Pointer (& dt )), 0 , 0 , 0 , 0 ) == 0 {
267
+ if stdcall (_SetWaitableTimer , mp .waitIocpTimer , uintptr (unsafe .Pointer (& dt )), 0 , 0 , 0 , 0 ) == 0 {
268
268
println ("runtime: SetWaitableTimer failed; errno=" , getlasterror ())
269
269
throw ("runtime: netpoll failed" )
270
270
}
271
271
key := packNetpollKey (netpollSourceTimer , nil )
272
- if errno := stdcall8 (_NtAssociateWaitCompletionPacket , mp .waitIocpHandle , iocphandle , mp .waitIocpTimer , key , 0 , 0 , 0 , uintptr (unsafe .Pointer (& signaled ))); errno != 0 {
272
+ if errno := stdcall (_NtAssociateWaitCompletionPacket , mp .waitIocpHandle , iocphandle , mp .waitIocpTimer , key , 0 , 0 , 0 , uintptr (unsafe .Pointer (& signaled ))); errno != 0 {
273
273
println ("runtime: NtAssociateWaitCompletionPacket failed; errno=" , errno )
274
274
throw ("runtime: netpoll failed" )
275
275
}
0 commit comments