[ros-dev] [ros-diffs] [cgutman] 41783: - Fix return value of tdiGetMibForIfEntity so it doesn't return a failure status on success

Ged gedmurphy at gmail.com
Mon Jul 6 22:55:29 CEST 2009


Yeah, I should have stated this more clearly.

 

My point was DeviceIoControl returns TRUE, you then print this to the log as
an NTSTATUS value which now holds the value '1' which in NTSTATUS terms is
STATUS_WAIT_0 + 1

After this you then return STATUS_SUCCESS which is 0.

 

As I said, it's rather hackish.  J

 

Ged.

 

From: ros-dev-bounces at reactos.org [mailto:ros-dev-bounces at reactos.org] On
Behalf Of Timo Kreuzer
Sent: 06 July 2009 21:40
To: ReactOS Development List
Subject: Re: [ros-dev] [ros-diffs] [cgutman] 41783: - Fix return value of
tdiGetMibForIfEntity so it doesn't return a failure status on success

 

The hack is storing a BOOL value in an NTSTATUS variable.


Cameron Gutman schrieb: 

It's not a hack. We know we have succeded if we reach that  code  
because we check for failure earlier. The problem is that status was  
the return value of DeviceIoControl which returns nonzero for success  
but zero is success in ntstatus.
 
On Jul 6, 2009, at 4:44 AM, "Ged"  <mailto:gedmurphy at gmail.com>
<gedmurphy at gmail.com> wrote:
 
  

This looks hackish
It also breaks the log as you're potentially returning something  
different from what the log states
 
-----Original Message-----
From: ros-diffs-bounces at reactos.org [mailto:ros-diffs- 
bounces at reactos.org] On Behalf Of cgutman at svn.reactos.org
Sent: 06 July 2009 08:54
To: ros-diffs at reactos.org
Subject: [ros-diffs] [cgutman] 41783: - Fix return value of  
tdiGetMibForIfEntity so it doesn't return a failure status on success
 
Author: cgutman
Date: Mon Jul  6 11:54:28 2009
New Revision: 41783
 
URL: http://svn.reactos.org/svn/reactos?rev=41783
<http://svn.reactos.org/svn/reactos?rev=41783&view=rev> &view=rev
Log:
- Fix return value of tdiGetMibForIfEntity so it doesn't return a  
failure status on success
 
Modified:
   trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c
 
Modified: trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/ifenum_r
eactos.c?rev=41783
<http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/ifenum_
reactos.c?rev=41783&r1=41782&r2=41783&view=diff>
&r1=41782&r2=41783&view=diff
=== 
=== 
=== 
=====================================================================
--- trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c [iso-8859-1]  
(original)
+++ trunk/reactos/dll/win32/iphlpapi/ifenum_reactos.c [iso-8859-1]  
Mon Jul  6 11:54:28 2009
@@ -280,7 +280,7 @@
           entry->ent.if_descr);
    TRACE("} status %08x\n",status);
 
-    return status;
+    return STATUS_SUCCESS;
}
 
NTSTATUS tdiGetEntityIDSet( HANDLE tcpFile,
 
 
_______________________________________________
Ros-dev mailing list
Ros-dev at reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
    

_______________________________________________
Ros-dev mailing list
Ros-dev at reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
 
  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-dev/attachments/20090706/76f2ed48/attachment-0001.html 


More information about the Ros-dev mailing list