[HIVESYS]

- Add an entry for ndisuio (temporary until INF install works)
- Autostart WZC service
[NDISUIO]
- Fix crash during binding and receive
- Add more debugging

svn path=/branches/wlan-bringup/; revision=54857
This commit is contained in:
Cameron Gutman 2012-01-07 05:54:14 +00:00
parent d665699bee
commit 3f96d1516b
5 changed files with 36 additions and 19 deletions

View file

@ -1399,6 +1399,13 @@ HKLM,"SYSTEM\CurrentControlSet\Services\NMIDebug","ImagePath",0x00020000,"system
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
HKLM,"SYSTEM\CurrentControlSet\Services\Packet","Group",0x00000000,"PNP_TDI"
@ -1629,7 +1636,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\WlanSvc","ErrorControl",0x00010001,0x000
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

View file

@ -8,7 +8,7 @@
#include "ndisuio.h"
#define NDEBUG
//#define NDEBUG
#include <debug.h>
NTSTATUS
@ -19,6 +19,8 @@ NduDispatchCreate(PDEVICE_OBJECT DeviceObject,
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 @@ NduDispatchClose(PDEVICE_OBJECT DeviceObject,
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);

View file

@ -8,7 +8,7 @@
#include "ndisuio.h"
#define NDEBUG
//#define NDEBUG
#include <debug.h>
static
@ -57,6 +57,7 @@ QueryBinding(PIRP Irp, PIO_STACK_LOCATION IrpSp)
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;
@ -156,6 +157,8 @@ SetAdapterOid(PIRP Irp, PIO_STACK_LOCATION IrpSp)
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,
AdapterContext->BindingHandle,
@ -210,6 +213,8 @@ QueryAdapterOid(PIRP Irp, PIO_STACK_LOCATION IrpSp)
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,
AdapterContext->BindingHandle,
@ -264,6 +269,8 @@ OpenDeviceReadWrite(PIRP Irp, PIO_STACK_LOCATION IrpSp)
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)

View file

@ -8,7 +8,7 @@
#include "ndisuio.h"
#define NDEBUG
//#define NDEBUG
#include <debug.h>
PDEVICE_OBJECT GlobalDeviceObject;
@ -20,7 +20,7 @@ NDIS_STRING ProtocolName = RTL_CONSTANT_STRING(L"NDISUIO");
VOID NTAPI NduUnload(PDRIVER_OBJECT DriverObject)
{
DPRINT1("NDISUIO: Unloaded\n");
DPRINT("NDISUIO: Unloaded\n");
}
NTSTATUS
@ -98,7 +98,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
return Status;
}
DPRINT1("NDISUIO: Loaded\n");
DPRINT("NDISUIO: Loaded\n");
return STATUS_SUCCESS;
}

View file

@ -8,11 +8,9 @@
#include "ndisuio.h"
//#define NDEBUG
#define NDEBUG
#include <debug.h>
PNDIS_MEDIUM SupportedMedia = {NdisMedium802_3};
VOID
NTAPI
NduOpenAdapterComplete(NDIS_HANDLE ProtocolBindingContext,
@ -118,9 +116,7 @@ NduReceive(NDIS_HANDLE ProtocolBindingContext,
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 @@ NduReceive(NDIS_HANDLE ProtocolBindingContext,
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 @@ NduReceive(NDIS_HANDLE ProtocolBindingContext,
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 @@ BindAdapterByName(PNDIS_STRING DeviceName)
{
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 @@ BindAdapterByName(PNDIS_STRING DeviceName)
/* 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 @@ BindAdapterByName(PNDIS_STRING DeviceName)
&OpenErrorStatus,
&AdapterContext->BindingHandle,
&SelectedMedium,
&SupportedMedia[0],
SupportedMedia,
1,
GlobalProtocolHandle,
AdapterContext,