Wednesday, 15 May 2013

c++ - GetQueuedCompletionStatusEx(), ReadDirectoryChangesW() -



c++ - GetQueuedCompletionStatusEx(), ReadDirectoryChangesW() -

i using getqueuedcompletionstatusex() , readdirectorychangesw() seek receive notifications of changes multiple filesystem hierarchies.

i noticed receive completion packets error 0x10c when there lot of changes @ once. error code wasn't anywhere in header files i'd included , wasn't in documentation ( http://msdn.microsoft.com/en-us/library/windows/desktop/aa365465(v=vs.85).aspx ). little digging later, find out it's status_notify_enum_dir defined in ntstatus.h. neither status_notify_enum_dir mentioned in documentation nor necessity of including ntstatus.h. msdn indicates should have been error_notify_enum_dir. wondering, bug in documentation or perhaps doing wrong?

error_notify_enum_dir defined in winerror.h:

// // messageid: error_notify_enum_dir // // messagetext: // // notify alter request beingness completed , info not beingness returned in caller's buffer. caller needs enumerate files find changes. // #define error_notify_enum_dir 1022l

however, 1022 0x3fe. 0x10c 268 instead, not error code readdirectorychangesw() supposed return. if readdirectorychangesw() straight returning status_notify_enum_dir instead of translating error_notify_enum_dir, bug within of readdirectorychangesw() itself, unless typo in winerror.h instead.

status_notify_enum_dir used lower-level systems, nt_transact_notify_change , ntnotifychangedirectoryfile(), indicate notification info larger output buffer can hold. error_notify_enum_dir means in readdirectorychangesw(), stated in own documentation.

some homecoming values of other functions, waitfor...() family of functions, , overlappedio/iocp functions, map straight status_... codes internally, not documented such because private implementation detail. example, if in winbase.h, there couple of dozen mutual homecoming codes, wait_object_0, wait_io_completion, still_active, , various exception_..., map straight status_... values.

that not appear case in situation, though. according msdn, status_notify_enum_diris indeed supposed map error_notify_enum_dir, appear bug:

when kernel-mode driver called because of input/output (i/o) request win32 subsystem, status code returned kernel- mode driver translated status code's corresponding win32 error code. next table shows mapping windows nt status codes win32 error codes.

windows nt status code win32 error code ------------------------------------------------------------------ ... status_notify_enum_dir error_notify_enum_dir ...

c++ winapi iocp readdirectorychangesw

No comments:

Post a Comment