Author: cgutman
Date: Mon Jun 22 05:10:58 2009
New Revision: 41522
URL:
http://svn.reactos.org/svn/reactos?rev=41522&view=rev
Log:
- Fix a bug that caused translations of NdisParameterInteger values into unicode strings
to produce bad results
- Fix a bug that caused NdisParameterMultiString values to be written to the registry
incorrectly
Modified:
trunk/reactos/drivers/network/ndis/ndis/config.c
Modified: trunk/reactos/drivers/network/ndis/ndis/config.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] Mon Jun 22 05:10:58
2009
@@ -63,7 +63,7 @@
* I don't know why tho so i free everything before return. comments welcome.
*/
{
- ULONG ParameterType = ParameterValue->ParameterType;
+ ULONG ParameterType;
ULONG DataSize;
PVOID Data;
WCHAR Buff[25];
@@ -71,7 +71,7 @@
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
/* reset parameter type to standard reg types */
- switch(ParameterType)
+ switch(ParameterValue->ParameterType)
{
case NdisParameterHexInteger:
case NdisParameterInteger:
@@ -85,7 +85,7 @@
ParameterType = REG_SZ;
if (!NT_SUCCESS(RtlIntegerToUnicodeString(
ParameterValue->ParameterData.IntegerData,
- (ParameterType == NdisParameterInteger) ? 10 : 16, &Str)))
+ (ParameterValue->ParameterType == NdisParameterInteger) ? 10 :
16, &Str)))
{
*Status = NDIS_STATUS_FAILURE;
return;
@@ -96,7 +96,7 @@
break;
case NdisParameterString:
case NdisParameterMultiString:
- ParameterType = REG_SZ;
+ ParameterType = (ParameterValue->ParameterType == NdisParameterString) ?
REG_SZ : REG_MULTI_SZ;
Data = ParameterValue->ParameterData.StringData.Buffer;
DataSize = ParameterValue->ParameterData.StringData.Length;
break;