Re: Is IoStatus.Status reliable?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



My typo, NT_SUCCESS covers SUCCESS and INFORMATION, it was early morning!


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"David F." <70751.3507@xxxxxxxxxxxxxxxx> wrote in message
news:uR$%234XAvFHA.2396@xxxxxxxxxxxxxxxxxxxxxxx
> That opens a question since the docs read:
> When testing a return value, you should use one of the following
> system-supplied macros (defined in ntdef.h):
>
> NT_SUCCESS(Status)
> Evaluates to TRUE if the return value specified by Status is a success
> type or an informational type (0 ? 0x3FFFFFFF).
> NT_INFORMATION(Status)
> Evaluates to TRUE if the return value specified by Status is an
> informational type (0x40000000 ? 0x7FFFFFFF).
> NT_WARNING(Status)
> Evaluates to TRUE if the return value specified by Status is a warning
> type (0x80000000 ? 0xBFFFFFFF).
> NT_ERROR(Status)
> Evaluates to TRUE if the return value specified by Status is an error
> type (0xC0000000 - 0xFFFFFFFF).
> I take it you were thinking of informational type messages not warning?
>
> "Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
> news:eYy7pL3uFHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
>> Well it should have a status that indicates this, but two things to
>> remember:
>>
>> 1. The status is what the lower driver provided (I'm assuming drivers
>> with the macros you mention), so if they decide to pass STATUS_SUCCESS
>> but only give you half the data, well so be it.
>>
>> 2. NT_SUCCSS returns true for either SUCCESS or WARNING class messages,
>> you need to use:
>>
>> if ( NT_SUCCESS(IoStatus.Status) && !NT_WARNING(IoStatus.Status) )
>> ...
>>
>> to test for SUCCESS only.
>>
>>
>>
>> --
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Remove StopSpam from the email to reply
>>
>>
>> "David F." <70751.3507@xxxxxxxxxxxxxxxx> wrote in message
>> news:%23jqT8l2uFHA.252@xxxxxxxxxxxxxxxxxxxxxxx
>>> Can IoStatus.Status be used to determine result in a CR without a need
>>> to check IoStatus.Information (for say IRP_MJ_READ)?
>>> (In other words, it's not going to be NT_SUCCESS(IoStatus.Status) while
>>> IoStatus.Information reports that it only read half of what it was
>>> supposed to. I mean, I would hope that would only come back NT_WARNING
>>> or NT_ERROR)
>>>
>>> TIA!!
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Unsized Arrays in Structures, and user space
    ... get a notification yet you have a lot of memory reservered. ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... >> Don Burn (MVP, Windows DDK) ... >> Remove StopSpam from the email to reply ...
    (microsoft.public.development.device.drivers)
  • Re: about driver architecture.
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... Remove StopSpam to reply ... but I gonna have a try to go KMDF. ...
    (microsoft.public.development.device.drivers)
  • Re: newbie questions about pageable code
    ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... >> Don Burn (MVP, Windows DDK) ... >> Remove StopSpam from the email to reply ...
    (microsoft.public.win32.programmer.kernel)
  • Re: File System Hook
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... Remove StopSpam to reply ... You maybe need a SSDT hook driver. ...
    (microsoft.public.development.device.drivers)
  • Re: Any way to get RTL_USER_PROCESS_PARAMETERS at NtCreateSection entry
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... Remove StopSpam from the email to reply ... Except that hooking does not work on 64-bit systems (unless you really ...
    (microsoft.public.win32.programmer.kernel)