Author: tkreuzer
Date: Tue Sep 16 22:02:53 2014
New Revision: 64175
URL:
http://svn.reactos.org/svn/reactos?rev=64175&view=rev
Log:
[TCPIP]
- Implement InfoTdiQueryGetATInfo, which implements some special case for
InfoTdiQueryInformationEx. It's based on wild guesses, but it helps to make Windows
2003 lsass not fail.
- Silence VC warnings
Modified:
branches/kernel-fun/reactos/drivers/network/tcpip/include/tcpip.h
branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/info.c
branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/main.c
branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/proto.c
branches/kernel-fun/reactos/drivers/network/tcpip/tests/tests/tigetprotocolnumber.c
Modified: branches/kernel-fun/reactos/drivers/network/tcpip/include/tcpip.h
URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/drivers/netw…
==============================================================================
--- branches/kernel-fun/reactos/drivers/network/tcpip/include/tcpip.h [iso-8859-1]
(original)
+++ branches/kernel-fun/reactos/drivers/network/tcpip/include/tcpip.h [iso-8859-1] Tue Sep
16 22:02:53 2014
@@ -170,6 +170,6 @@
extern ULONG EntityMax;
extern NTSTATUS TiGetProtocolNumber( PUNICODE_STRING FileName,
- PULONG Protocol );
+ PUSHORT Protocol );
/* EOF */
Modified: branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/info.c
URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/drivers/netw…
==============================================================================
--- branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/info.c [iso-8859-1]
(original)
+++ branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/info.c [iso-8859-1] Tue Sep 16
22:02:53 2014
@@ -179,6 +179,38 @@
return TDI_SUCCESS;
}
+
+TDI_STATUS
+InfoTdiQueryGetATInfo(
+ TDIEntityID ID,
+ PIP_INTERFACE Interface,
+ PNDIS_BUFFER Buffer,
+ PUINT BufferSize)
+{
+ ULONG ATInfo[2];
+ TDI_STATUS Status;
+
+ TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
+
+ if (!Interface)
+ return TDI_INVALID_PARAMETER;
+
+ if (*BufferSize < 2 * sizeof(ULONG))
+ return STATUS_BUFFER_TOO_SMALL;
+
+ // Fixme: I have no idea what the first field should contain...
+ ATInfo[0] = 0;
+ ATInfo[1] = Interface->Index;
+
+ Status = InfoCopyOut( (PCHAR)ATInfo, sizeof(ATInfo),
+ Buffer, BufferSize );
+
+ TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
+
+ *BufferSize = 8;
+ return Status;
+}
+
TDI_STATUS InfoTdiQueryInformationEx(
PTDI_REQUEST Request,
@@ -246,21 +278,32 @@
return TDI_INVALID_PARAMETER;
if (ID->toi_entity.tei_entity == IF_ENTITY)
+ {
if ((EntityListContext = GetContext(ID->toi_entity)))
return InfoTdiQueryGetInterfaceMIB(ID->toi_entity,
EntityListContext, Buffer, BufferSize);
else
return TDI_INVALID_PARAMETER;
+ }
else if (ID->toi_entity.tei_entity == CL_NL_ENTITY ||
ID->toi_entity.tei_entity == CO_NL_ENTITY)
+ {
if ((EntityListContext = GetContext(ID->toi_entity)))
return InfoTdiQueryGetIPSnmpInfo(ID->toi_entity,
EntityListContext, Buffer, BufferSize);
else
return TDI_INVALID_PARAMETER;
+ }
+ else if (ID->toi_entity.tei_entity == AT_ENTITY)
+ {
+ if ((EntityListContext = GetContext(ID->toi_entity)))
+ return InfoTdiQueryGetATInfo(ID->toi_entity,
EntityListContext, Buffer, BufferSize);
+ else
+ return TDI_INVALID_PARAMETER;
+ }
else
return TDI_INVALID_PARAMETER;
case IP_MIB_ADDRTABLE_ENTRY_ID:
- if (ID->toi_entity.tei_entity != CL_NL_ENTITY &&
+ if (ID->toi_entity.tei_entity != CL_NL_ENTITY &&
ID->toi_entity.tei_entity != CO_NL_ENTITY)
return TDI_INVALID_PARAMETER;
Modified: branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/drivers/netw…
==============================================================================
--- branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1]
(original)
+++ branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Tue Sep 16
22:02:53 2014
@@ -116,7 +116,7 @@
TDI_REQUEST Request;
PVOID ClientContext;
NTSTATUS Status;
- ULONG Protocol;
+ USHORT Protocol;
BOOLEAN Shared;
TI_DbgPrint(DEBUG_IRP, ("Called. DeviceObject is at (0x%X), IRP is at
(0x%X).\n", DeviceObject, Irp));
Modified: branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/proto.c
URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/drivers/netw…
==============================================================================
--- branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/proto.c [iso-8859-1]
(original)
+++ branches/kernel-fun/reactos/drivers/network/tcpip/tcpip/proto.c [iso-8859-1] Tue Sep
16 22:02:53 2014
@@ -2,7 +2,7 @@
NTSTATUS TiGetProtocolNumber(
PUNICODE_STRING FileName,
- PULONG Protocol)
+ PUSHORT Protocol)
/*
* FUNCTION: Returns the protocol number from a file name
* ARGUMENTS:
@@ -33,7 +33,7 @@
if (!NT_SUCCESS(Status) || ((Value > 255)))
return STATUS_UNSUCCESSFUL;
- *Protocol = Value;
+ *Protocol = (USHORT)Value;
return STATUS_SUCCESS;
}
Modified:
branches/kernel-fun/reactos/drivers/network/tcpip/tests/tests/tigetprotocolnumber.c
URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/drivers/netw…
==============================================================================
---
branches/kernel-fun/reactos/drivers/network/tcpip/tests/tests/tigetprotocolnumber.c [iso-8859-1]
(original)
+++
branches/kernel-fun/reactos/drivers/network/tcpip/tests/tests/tigetprotocolnumber.c [iso-8859-1]
Tue Sep 16 22:02:53 2014
@@ -3,9 +3,9 @@
static void RunTest() {
UNICODE_STRING Str;
- int Proto;
+ USHORT Proto;
RtlInitUnicodeString( &Str, L"1" );
- TiGetProtocolNumber( &Str, (PULONG)&Proto );
+ TiGetProtocolNumber( &Str, &Proto );
_AssertEqualValue(1, Proto);
}