[ros-bugs] [Bug 1363] NdisWriteConfiguration has a bug when writing integers.

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Sun Apr 9 23:30:57 CEST 2006


http://www.reactos.org/bugzilla/show_bug.cgi?id=1363





------- Additional Comments From crashfourit at gmail.com  2006-04-09 23:30 CET -------
(From update of attachment 718)
Index: config.c
===================================================================
--- config.c	(revision 21533)
+++ config.c	(working copy)
@@ -66,6 +66,7 @@
     ULONG ParameterType = ParameterValue->ParameterType;
     ULONG DataSize;
     PVOID Data;
+    WCHAR Buff[20]; 

     if(ParameterType != NdisParameterInteger &&
	 ParameterType != NdisParameterHexInteger &&
@@ -81,14 +82,30 @@
     /* reset parameter type to standard reg types */
     switch(ParameterType)
     {
-	 /* TODO: figure out what do do with these; are they different? */
+	 /* TODO: figure out what do do with these; are they different? 
+	    Done.
+	 */
	 case NdisParameterHexInteger:
-	 case NdisParameterInteger:
-	     ParameterType = REG_SZ;
-	     Data = &ParameterValue->ParameterData.IntegerData;
-	     DataSize = sizeof(ULONG);
-	     break;
-
+	 case NdisParameterInteger:	
+	      { 		    
+		  UNICODE_STRING Str;
+		  
+		  Str.Buffer = (PWSTR) &Buff;
+		  Str.MaximumLength = (USHORT)sizeof(Buff);
+		  
+		  ParameterType = REG_SZ;
+		  if (RtlIntegerToUnicodeString(
+		       ParameterValue->ParameterData.IntegerData,
+		       (ParameterType == NdisParameterInteger) ? 10 : 16,
+		       &Str
+		     ) != NT_SUCCESS(Status)){
+		       *Status = NDIS_STATUS_FAILURE;
+		       return;
+		  }				 
+		  Data = Str.Buffer;
+		  DataSize = Str.Length;		    
+	      }
+	      break;			   
	 case NdisParameterString:
	 case NdisParameterMultiString:
	     ParameterType = REG_SZ;


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.


More information about the Ros-bugs mailing list