J
johndoe1
X-Noarchive: Yes
Friends,
I'm trying to get ReadDirectoryChangeW to pick file movement in a
directory.
I'm using the I/O completion port-based method and, the funny thing is,
I'm not getting any notifications whatsoever, no matter what I do in the
"watched" directory.
The port is fine: when I'm shutting down I'm queuing a special-purpose
packet to it and it picks it up just fine. I've played a bit with the SDK
sample "fwatch", which, after a bit of tweaking, I got to do what I need,
more or less.
Now, the only difference that I can see between my proggie and fwatch is
that in fwatch the thread that sets everything up (including iocp creation
and issuing the first RDCW call) and the thread that then waits on this
iocp are different, whereas in my case everything is done from the same
thread (my proggie is a service, so I already have my ServiceMain running
in an extra thread and don't really need yet another "worker" thread).
However, the shutdown packet that I've mentioned above is queued from a
_different_ thread (when run as service, from the ControlHandler; when run
as an app, from a SIGINT signal handler) -- and this part works just fine.
Is it possible that the waiting thread must be different from the one that
set everything up here? Any other ideas/suggestions?
Thanks.
Friends,
I'm trying to get ReadDirectoryChangeW to pick file movement in a
directory.
I'm using the I/O completion port-based method and, the funny thing is,
I'm not getting any notifications whatsoever, no matter what I do in the
"watched" directory.
The port is fine: when I'm shutting down I'm queuing a special-purpose
packet to it and it picks it up just fine. I've played a bit with the SDK
sample "fwatch", which, after a bit of tweaking, I got to do what I need,
more or less.
Now, the only difference that I can see between my proggie and fwatch is
that in fwatch the thread that sets everything up (including iocp creation
and issuing the first RDCW call) and the thread that then waits on this
iocp are different, whereas in my case everything is done from the same
thread (my proggie is a service, so I already have my ServiceMain running
in an extra thread and don't really need yet another "worker" thread).
However, the shutdown packet that I've mentioned above is queued from a
_different_ thread (when run as service, from the ControlHandler; when run
as an app, from a SIGINT signal handler) -- and this part works just fine.
Is it possible that the waiting thread must be different from the one that
set everything up here? Any other ideas/suggestions?
Thanks.