Author: cgutman
Date: Sat Jan 7 05:54:14 2012
New Revision: 54857
URL:
http://svn.reactos.org/svn/reactos?rev=54857&view=rev
Log:
[HIVESYS]
- Add an entry for ndisuio (temporary until INF install works)
- Autostart WZC service
[NDISUIO]
- Fix crash during binding and receive
- Add more debugging
Modified:
branches/wlan-bringup/boot/bootdata/hivesys_i386.inf
branches/wlan-bringup/drivers/network/ndisuio/createclose.c
branches/wlan-bringup/drivers/network/ndisuio/ioctl.c
branches/wlan-bringup/drivers/network/ndisuio/main.c
branches/wlan-bringup/drivers/network/ndisuio/protocol.c
Modified: branches/wlan-bringup/boot/bootdata/hivesys_i386.inf
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/boot/bootdata/hive…
==============================================================================
--- branches/wlan-bringup/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original)
+++ branches/wlan-bringup/boot/bootdata/hivesys_i386.inf [iso-8859-1] Sat Jan 7 05:54:14
2012
@@ -1398,6 +1398,13 @@
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","ImagePath",0x00020000,"system32\drivers\nmidebug.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","Type",0x00010001,0x00000001
+
+; NDIS User I/O driver (FIXME: Should be installed via INF and started on demand)
+HKLM,"SYSTEM\CurrentControlSet\Services\Ndisuio","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\Ndisuio","Group",0x00000000,"NDIS"
+HKLM,"SYSTEM\CurrentControlSet\Services\Ndisuio","ImagePath",0x00020000,"system32\drivers\ndisuio.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\Ndisuio","Start",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\Ndisuio","Type",0x00010001,0x00000001
; Packet driver
HKLM,"SYSTEM\CurrentControlSet\Services\Packet","ErrorControl",0x00010001,0x00000001
@@ -1629,7 +1636,7 @@
HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Group",0x00000000,"TDI"
HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","ImagePath",0x00020000,"%SystemRoot%\system32\wlansvc.exe"
HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","ObjectName",0x00000000,"LocalSystem"
-HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Start",0x00010001,0x00000003
+HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Start",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","Type",0x00010001,0x00000110
; Simple TCP services
Modified: branches/wlan-bringup/drivers/network/ndisuio/createclose.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
==============================================================================
--- branches/wlan-bringup/drivers/network/ndisuio/createclose.c [iso-8859-1] (original)
+++ branches/wlan-bringup/drivers/network/ndisuio/createclose.c [iso-8859-1] Sat Jan 7
05:54:14 2012
@@ -8,7 +8,7 @@
#include "ndisuio.h"
-#define NDEBUG
+//#define NDEBUG
#include <debug.h>
NTSTATUS
@@ -19,6 +19,8 @@
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
ASSERT(DeviceObject == GlobalDeviceObject);
+
+ DPRINT("Created file object 0x%x\n", IrpSp->FileObject);
/* This is associated with an adapter during IOCTL_NDISUIO_OPEN_(WRITE_)DEVICE */
IrpSp->FileObject->FsContext = NULL;
@@ -43,11 +45,15 @@
PNDISUIO_OPEN_ENTRY OpenEntry = IrpSp->FileObject->FsContext2;
ASSERT(DeviceObject == GlobalDeviceObject);
+
+ DPRINT("Closing file object 0x%x\n", IrpSp->FileObject);
/* Check if this handle was ever associated with an adapter */
if (AdapterContext != NULL)
{
ASSERT(OpenEntry != NULL);
+
+ DPRINT("Removing binding to adapter %wZ\n",
&AdapterContext->DeviceName);
/* Call the our helper */
DereferenceAdapterContextWithOpenEntry(AdapterContext, OpenEntry);
Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
==============================================================================
--- branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] (original)
+++ branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] Sat Jan 7 05:54:14
2012
@@ -8,7 +8,7 @@
#include "ndisuio.h"
-#define NDEBUG
+//#define NDEBUG
#include <debug.h>
static
@@ -57,6 +57,7 @@
if (i == QueryBinding->BindingIndex)
{
AdapterContext = CONTAINING_RECORD(CurrentEntry, NDISUIO_ADAPTER_CONTEXT,
ListEntry);
+ DPRINT("Query binding for index %d is adapter %wZ\n", i,
&AdapterContext->DeviceName);
if (AdapterContext->DeviceName.Length <=
QueryBinding->DeviceNameLength)
{
BytesCopied += AdapterContext->DeviceName.Length;
@@ -155,6 +156,8 @@
Request.DATA.SET_INFORMATION.Oid = SetOidRequest->Oid;
Request.DATA.SET_INFORMATION.InformationBuffer = SetOidRequest->Data;
Request.DATA.SET_INFORMATION.InformationBufferLength = RequestLength -
sizeof(NDIS_OID);
+
+ DPRINT("Setting OID 0x%x on adapter %wZ\n", SetOidRequest->Oid,
&AdapterContext->DeviceName);
/* Dispatch the request */
NdisRequest(&Status,
@@ -209,6 +212,8 @@
Request.DATA.QUERY_INFORMATION.Oid = QueryOidRequest->Oid;
Request.DATA.QUERY_INFORMATION.InformationBuffer = QueryOidRequest->Data;
Request.DATA.QUERY_INFORMATION.InformationBufferLength = RequestLength -
sizeof(NDIS_OID);
+
+ DPRINT("Querying OID 0x%x on adapter %wZ\n", QueryOidRequest->Oid,
&AdapterContext->DeviceName);
/* Dispatch the request */
NdisRequest(&Status,
@@ -264,6 +269,8 @@
AdapterContext = FindAdapterContextByName(&DeviceName);
if (AdapterContext != NULL)
{
+ DPRINT("Binding file object 0x%x to device %wZ\n", FileObject,
&AdapterContext->DeviceName);
+
/* Reference the adapter context */
KeAcquireSpinLock(&AdapterContext->Spinlock, &OldIrql);
if (AdapterContext->OpenCount != 0)
Modified: branches/wlan-bringup/drivers/network/ndisuio/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
==============================================================================
--- branches/wlan-bringup/drivers/network/ndisuio/main.c [iso-8859-1] (original)
+++ branches/wlan-bringup/drivers/network/ndisuio/main.c [iso-8859-1] Sat Jan 7 05:54:14
2012
@@ -8,7 +8,7 @@
#include "ndisuio.h"
-#define NDEBUG
+//#define NDEBUG
#include <debug.h>
PDEVICE_OBJECT GlobalDeviceObject;
@@ -20,7 +20,7 @@
VOID NTAPI NduUnload(PDRIVER_OBJECT DriverObject)
{
- DPRINT1("NDISUIO: Unloaded\n");
+ DPRINT("NDISUIO: Unloaded\n");
}
NTSTATUS
@@ -98,7 +98,7 @@
return Status;
}
- DPRINT1("NDISUIO: Loaded\n");
+ DPRINT("NDISUIO: Loaded\n");
return STATUS_SUCCESS;
}
Modified: branches/wlan-bringup/drivers/network/ndisuio/protocol.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
==============================================================================
--- branches/wlan-bringup/drivers/network/ndisuio/protocol.c [iso-8859-1] (original)
+++ branches/wlan-bringup/drivers/network/ndisuio/protocol.c [iso-8859-1] Sat Jan 7
05:54:14 2012
@@ -8,10 +8,8 @@
#include "ndisuio.h"
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
-
-PNDIS_MEDIUM SupportedMedia = {NdisMedium802_3};
VOID
NTAPI
@@ -118,9 +116,7 @@
PNDIS_PACKET Packet;
NDIS_STATUS Status;
UINT BytesTransferred;
-
- DPRINT("Received a %d byte packet on %wZ\n", PacketSize + HeaderBufferSize,
&AdapterContext->DeviceName);
-
+
/* Discard if nobody is waiting for it */
if (AdapterContext->OpenCount == 0)
return NDIS_STATUS_NOT_ACCEPTED;
@@ -171,8 +167,8 @@
but not the pool because we still need it */
CleanupAndFreePacket(Packet, FALSE);
- /* Allocate a packet entry from paged pool */
- PacketEntry = ExAllocatePool(PagedPool, sizeof(NDISUIO_PACKET_ENTRY) +
BytesTransferred + HeaderBufferSize - 1);
+ /* Allocate a packet entry from pool */
+ PacketEntry = ExAllocatePool(NonPagedPool, sizeof(NDISUIO_PACKET_ENTRY) +
BytesTransferred + HeaderBufferSize - 1);
if (!PacketEntry)
{
ExFreePool(PacketBuffer);
@@ -183,7 +179,7 @@
PacketEntry->PacketLength = BytesTransferred + HeaderBufferSize;
RtlCopyMemory(&PacketEntry->PacketData[0], PacketBuffer,
PacketEntry->PacketLength);
- /* Free the old non-paged buffer */
+ /* Free the old buffer */
ExFreePool(PacketBuffer);
/* Insert the packet on the adapter's packet list */
@@ -313,11 +309,10 @@
{
NDIS_STATUS OpenErrorStatus;
PNDISUIO_ADAPTER_CONTEXT AdapterContext;
+ NDIS_MEDIUM SupportedMedia[1] = {NdisMedium802_3};
UINT SelectedMedium;
NDIS_STATUS Status;
-
- DPRINT("Binding adapter %wZ\n", &AdapterContext->DeviceName);
-
+
/* Allocate the adapter context */
AdapterContext = ExAllocatePool(NonPagedPool, sizeof(*AdapterContext));
if (!AdapterContext)
@@ -345,6 +340,8 @@
/* Copy the device name into the adapter context */
RtlCopyMemory(AdapterContext->DeviceName.Buffer, DeviceName->Buffer,
DeviceName->Length);
+
+ DPRINT("Binding adapter %wZ\n", &AdapterContext->DeviceName);
/* Create the buffer pool */
NdisAllocateBufferPool(&Status,
@@ -377,7 +374,7 @@
&OpenErrorStatus,
&AdapterContext->BindingHandle,
&SelectedMedium,
- &SupportedMedia[0],
+ SupportedMedia,
1,
GlobalProtocolHandle,
AdapterContext,