1

Topic: NtDeviceIoControlFile: in IoStatusBlock. Information garbage

that  requests in a kernel to \device\afd (do not ask what for D). That that of type if (IoControlCode == 0x12017/*recv*/) {st = Original_NtDeviceIoControlFile (FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength); if (st == STATUS_PENDING && Event! = NULL) {ZwWaitForSingleObject (Event, FALSE, NULL); st = IoStatusBlock-> Status;} if (NT_SUCCESS (st)) {Trace ("%p", IoStatusBlock-> Information);}} Actually, in IoStatusBlock-> Information garbage. However, in the user application (at once after a call) all is normal, an amount accepted byte. What do I do not so?

2

Re: NtDeviceIoControlFile: in IoStatusBlock. Information garbage

S> if (st == STATUS_PENDING && Event! = NULL) {S> ZwWaitForSingleObject (Event, FALSE, NULL); S> st = IoStatusBlock-> Status; S>} And  we will do if st == STATUS_PENDING && Event == NULL? And it can be - completion ports, apc. By the way that you get up with event' which were transferred to you by the user - too . After all it can be autoreset, and you veil application, breaking it the logic. Or this autoreset event can expect the user in an adjacent flow. As a result he it waits, and you - are not present. Result - . Council: ZwQueryInformationFile (... FileModeInformation.) And if there does not figure FILE_SYNCHRONOUS_IO_NONALERT|FILE_SYNCHRONOUS_IO_ALERT create the event, its vanity instead of . If  returned STATUS_PENDING - wait the  when  - signal  , if it not . Thus here it here too it is not necessary to do: st = IoStatusBlock-> Status; If  returned  another, and   not NULL: __ the  waiting with zero  if it is beeped - signal   . [UPD] I here still thought, and came to a conclusion that stablly working decision for the scenario with IOCP at you such way does not turn out Because parallely working  the flow can receive through GetQueuedCompletionStatus the notification message about end __ that as  your code waiting on event'. Receiving it, it in turn can destroy/rezjuzat leaking IoStatusBlock. I do not speak about such "trifles" as the fact of that that you effectively transform an asynchronous call into synchronous that breaks logic of application  even  simple event', instead of IOCP but which does wait on some events (and you - are not present).

3

Re: NtDeviceIoControlFile: in IoStatusBlock. Information garbage

Hello, smbdnew, you wrote: S> Actually, in IoStatusBlock-> Information garbage. , and the status what in this case? NT_SUCCESS it is too fuzzy.

4

Re: NtDeviceIoControlFile: in IoStatusBlock. Information garbage

Hello, mike_rs, you wrote: _> Hello, smbdnew, you wrote: S>> Actually, in IoStatusBlock-> Information garbage. _> , and the status what in this case? NT_SUCCESS it is too fuzzy. The status always STATUS_SUCCESS, for the same reason I not  with .