#include "ndisuio.h"
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
-PNDIS_MEDIUM SupportedMedia = {NdisMedium802_3};
-
VOID
NTAPI
NduOpenAdapterComplete(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;
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);
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 */
{
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)
/* 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,
&OpenErrorStatus,
&AdapterContext->BindingHandle,
&SelectedMedium,
- &SupportedMedia[0],
+ SupportedMedia,
1,
GlobalProtocolHandle,
AdapterContext,