182 | 182 |
procDuplicateHandle = modkernel32.NewProc("DuplicateHandle")
|
183 | 183 |
procExitProcess = modkernel32.NewProc("ExitProcess")
|
184 | 184 |
procFindClose = modkernel32.NewProc("FindClose")
|
|
185 |
procFindCloseChangeNotification = modkernel32.NewProc("FindCloseChangeNotification")
|
|
186 |
procFindFirstChangeNotificationW = modkernel32.NewProc("FindFirstChangeNotificationW")
|
185 | 187 |
procFindFirstFileW = modkernel32.NewProc("FindFirstFileW")
|
186 | 188 |
procFindFirstVolumeMountPointW = modkernel32.NewProc("FindFirstVolumeMountPointW")
|
187 | 189 |
procFindFirstVolumeW = modkernel32.NewProc("FindFirstVolumeW")
|
|
190 |
procFindNextChangeNotification = modkernel32.NewProc("FindNextChangeNotification")
|
188 | 191 |
procFindNextFileW = modkernel32.NewProc("FindNextFileW")
|
189 | 192 |
procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW")
|
190 | 193 |
procFindNextVolumeW = modkernel32.NewProc("FindNextVolumeW")
|
|
1524 | 1527 |
return
|
1525 | 1528 |
}
|
1526 | 1529 |
|
|
1530 |
func FindCloseChangeNotification(handle Handle) (err error) {
|
|
1531 |
r1, _, e1 := syscall.Syscall(procFindCloseChangeNotification.Addr(), 1, uintptr(handle), 0, 0)
|
|
1532 |
if r1 == 0 {
|
|
1533 |
err = errnoErr(e1)
|
|
1534 |
}
|
|
1535 |
return
|
|
1536 |
}
|
|
1537 |
|
|
1538 |
func FindFirstChangeNotification(path string, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) {
|
|
1539 |
var _p0 *uint16
|
|
1540 |
_p0, err = syscall.UTF16PtrFromString(path)
|
|
1541 |
if err != nil {
|
|
1542 |
return
|
|
1543 |
}
|
|
1544 |
return _FindFirstChangeNotification(_p0, watchSubtree, notifyFilter)
|
|
1545 |
}
|
|
1546 |
|
|
1547 |
func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) {
|
|
1548 |
var _p1 uint32
|
|
1549 |
if watchSubtree {
|
|
1550 |
_p1 = 1
|
|
1551 |
}
|
|
1552 |
r0, _, e1 := syscall.Syscall(procFindFirstChangeNotificationW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter))
|
|
1553 |
handle = Handle(r0)
|
|
1554 |
if handle == InvalidHandle {
|
|
1555 |
err = errnoErr(e1)
|
|
1556 |
}
|
|
1557 |
return
|
|
1558 |
}
|
|
1559 |
|
1527 | 1560 |
func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) {
|
1528 | 1561 |
r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
|
1529 | 1562 |
handle = Handle(r0)
|
|
1546 | 1579 |
r0, _, e1 := syscall.Syscall(procFindFirstVolumeW.Addr(), 2, uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength), 0)
|
1547 | 1580 |
handle = Handle(r0)
|
1548 | 1581 |
if handle == InvalidHandle {
|
|
1582 |
err = errnoErr(e1)
|
|
1583 |
}
|
|
1584 |
return
|
|
1585 |
}
|
|
1586 |
|
|
1587 |
func FindNextChangeNotification(handle Handle) (err error) {
|
|
1588 |
r1, _, e1 := syscall.Syscall(procFindNextChangeNotification.Addr(), 1, uintptr(handle), 0, 0)
|
|
1589 |
if r1 == 0 {
|
1549 | 1590 |
err = errnoErr(e1)
|
1550 | 1591 |
}
|
1551 | 1592 |
return
|