or even better 2 absolute concrete question
1.)
let we call
LockFileEx(hFile, LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY, 0, *, *, lpOverlapped);
it return FALSE and GetLastError() return ERROR_LOCK_VIOLATION :
- will be IOCP notification in this case ?
- need call CancelThreadpoolIo ? (if i use new thread pool callback here)
- can we free lpOverlapped just ?
by documentation - must no be IOCP notification and need call CancelThreadpoolIo, but in practic this is wrong
or if native api closer to someone - let we call
ZwLockFile(_hFile, 0, 0, # , #, &ByteOffset, &Length, ‘key1’, TRUE, TRUE);
and it returned STATUS_LOCK_NOT_GRANTED :
- will be IOCP notification in this case ?
- need call CancelThreadpoolIo ? (if i use new thread pool callback here)
- can we free lpOverlapped/iosb just ?
2.)
we call
UnlockFileEx(_hFile, 0, 1, 0, lpOverlapped) (or ZwUnlockFile)
and it return TRUE ( or STATUS_SUCCESS).
- will be IOCP notification in this case ?
- need call CancelThreadpoolIo ? (if i use new thread pool callback here)
- can/must we free lpOverlapped just ? or when ?
by documentation - must me IOCP notification in this case, and we can not free lpOverlapped/iosb until this
but in real word - will be no more any notifications here