reorganized for NDIS_WDM support ( submitted by vizzini )

svn path=/trunk/; revision=5250
This commit is contained in:
Royce Mitchell III 2003-07-24 18:14:59 +00:00
parent 080c7a7f06
commit d47c833e21
50 changed files with 430 additions and 369 deletions

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.9 2002/09/08 10:22:02 chorns Exp $ # $Id: makefile,v 1.10 2003/07/24 18:14:58 royce Exp $
PATH_TO_TOP = ../../.. PATH_TO_TOP = ../../..
@ -8,6 +8,8 @@ TARGET_NAME = acpi
TARGET_CFLAGS = -I./include -I./ospm/include TARGET_CFLAGS = -I./include -I./ospm/include
TARGET_DDKLIBS = ntoskrnl.a
OBJECTS_PATH = objects OBJECTS_PATH = objects
TARGET_OBJECTS = $(OBJECTS_PATH)/$(TARGET_NAME).o TARGET_OBJECTS = $(OBJECTS_PATH)/$(TARGET_NAME).o

View file

@ -167,13 +167,13 @@ DriverEntry(
KeInitializeSpinLock(&DeviceExt->FCBListLock); KeInitializeSpinLock(&DeviceExt->FCBListLock);
InitializeListHead(&DeviceExt->FCBListHead); InitializeListHead(&DeviceExt->FCBListHead);
DriverObject->MajorFunction[IRP_MJ_CREATE] = AfdCreate; DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)AfdCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = AfdClose; DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)AfdClose;
DriverObject->MajorFunction[IRP_MJ_READ] = AfdRead; DriverObject->MajorFunction[IRP_MJ_READ] = (PDRIVER_DISPATCH)AfdRead;
DriverObject->MajorFunction[IRP_MJ_WRITE] = AfdWrite; DriverObject->MajorFunction[IRP_MJ_WRITE] = (PDRIVER_DISPATCH)AfdWrite;
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = AfdFileSystemControl; DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = (PDRIVER_DISPATCH)AfdFileSystemControl;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = AfdDispatch; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)AfdDispatch;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = AfdClose; DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (PDRIVER_DISPATCH)AfdClose;
DriverObject->DriverUnload = (PDRIVER_UNLOAD)AfdUnload; DriverObject->DriverUnload = (PDRIVER_UNLOAD)AfdUnload;

View file

@ -43,6 +43,8 @@ extern ULONG DebugTraceLevel;
#endif /* _MSC_VER */ #endif /* _MSC_VER */
/* Assert and kin are defined in rtl.h */
#if 0
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
#endif #endif
@ -52,7 +54,7 @@ extern ULONG DebugTraceLevel;
#else /* NASSERT */ #else /* NASSERT */
#define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); } #define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
#endif /* NASSERT */ #endif /* NASSERT */
#endif
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
#else /* DBG */ #else /* DBG */
@ -60,7 +62,7 @@ extern ULONG DebugTraceLevel;
#define NDIS_DbgPrint(_t_, _x_) #define NDIS_DbgPrint(_t_, _x_)
#define ASSERT_IRQL(x) #define ASSERT_IRQL(x)
#define ASSERT(x) /* #define ASSERT(x) */ /* rtl.h */
#endif /* DBG */ #endif /* DBG */

View file

@ -46,6 +46,8 @@ extern DWORD DebugTraceLevel;
#endif /* _MSC_VER */ #endif /* _MSC_VER */
/* ASSERT is in rtl.h */
#if 0
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
#endif #endif
@ -55,7 +57,7 @@ extern DWORD DebugTraceLevel;
#else /* NASSERT */ #else /* NASSERT */
#define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); } #define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
#endif /* NASSERT */ #endif /* NASSERT */
#endif
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
#else /* DBG */ #else /* DBG */
@ -63,7 +65,7 @@ extern DWORD DebugTraceLevel;
#define NDIS_DbgPrint(_t_, _x_) #define NDIS_DbgPrint(_t_, _x_)
#define ASSERT_IRQL(x) #define ASSERT_IRQL(x)
#define ASSERT(x) /*#define ASSERT(x)*/
#endif /* DBG */ #endif /* DBG */

View file

@ -9,7 +9,9 @@
#define __PROTOCOL_H #define __PROTOCOL_H
#include <ndissys.h> #include <ndissys.h>
#include <miniport.h> #include <net/ndis.h>
#include "../include/miniport.h"
//#include <miniport.h>
typedef struct _PROTOCOL_BINDING { typedef struct _PROTOCOL_BINDING {

View file

@ -171,6 +171,7 @@ NdisInterlockedInsertTailList@12
NdisInterlockedPopEntrySList@8 NdisInterlockedPopEntrySList@8
NdisInterlockedPushEntrySList@12 NdisInterlockedPushEntrySList@12
NdisInterlockedRemoveHeadList@8 NdisInterlockedRemoveHeadList@8
NdisInitializeListHead@4
NdisMAllocateMapRegisters@20 NdisMAllocateMapRegisters@20
NdisMAllocateSharedMemory@20 NdisMAllocateSharedMemory@20
NdisMAllocateSharedMemoryAsync@16 NdisMAllocateSharedMemoryAsync@16

View file

@ -166,6 +166,7 @@ NdisInitUnicodeString=NdisInitUnicodeString@8
NdisInterlockedAddUlong=NdisInterlockedAddUlong@12 NdisInterlockedAddUlong=NdisInterlockedAddUlong@12
NdisInterlockedDecrement=NdisInterlockedDecrement@4 NdisInterlockedDecrement=NdisInterlockedDecrement@4
NdisInterlockedIncrement=NdisInterlockedIncrement@4 NdisInterlockedIncrement=NdisInterlockedIncrement@4
NdisInitializeListHead=NdisInitializeListHead@4
NdisInterlockedInsertHeadList=NdisInterlockedInsertHeadList@12 NdisInterlockedInsertHeadList=NdisInterlockedInsertHeadList@12
NdisInterlockedInsertTailList=NdisInterlockedInsertTailList@12 NdisInterlockedInsertTailList=NdisInterlockedInsertTailList@12
NdisInterlockedPopEntrySList=NdisInterlockedPopEntrySList@8 NdisInterlockedPopEntrySList=NdisInterlockedPopEntrySList@8

View file

@ -237,12 +237,10 @@ UINT CopyPacketToBufferChain(
NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize); NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1) if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1)
return 0; return 0;
/* Skip SrcOffset bytes in the source packet */ /* Skip SrcOffset bytes in the source packet */
NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total); NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total);
if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1) if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1)
return 0; return 0;
/* Copy the data */ /* Copy the data */
for (Total = 0;;) { for (Total = 0;;) {
/* Find out how many bytes we can copy at one time */ /* Find out how many bytes we can copy at one time */

View file

@ -20,15 +20,24 @@ NdisAllocateMemoryWithTag(
IN UINT Length, IN UINT Length,
IN ULONG Tag) IN ULONG Tag)
/* /*
* FUNCTION: * FUNCTION: Allocates a block of memory, with a 32-bit tag
* ARGUMENTS: * ARGUMENTS:
* VirtualAddress = a pointer to the returned memory block
* Length = the number of requested bytes
* Tag = 32-bit pool tag
* NOTES: * NOTES:
* NDIS 5.0 * NDIS 5.0
*/ */
{ {
UNIMPLEMENTED PVOID Block;
/* Plain nonpaged memory with tag */
Block = ExAllocatePoolWithTag(NonPagedPool, Length, Tag);
*VirtualAddress = Block;
if (!Block)
return NDIS_STATUS_FAILURE; return NDIS_STATUS_FAILURE;
return NDIS_STATUS_SUCCESS;
} }

View file

@ -17,7 +17,7 @@ NDIS_STATUS
EXPORT EXPORT
NdisAnsiStringToUnicodeString( NdisAnsiStringToUnicodeString(
IN OUT PNDIS_STRING DestinationString, IN OUT PNDIS_STRING DestinationString,
IN PNDIS_ANSI_STRING SourceString) IN PANSI_STRING SourceString)
/* /*
* FUNCTION: Converts an ANSI string to an NDIS (unicode) string * FUNCTION: Converts an ANSI string to an NDIS (unicode) string
* ARGUMENTS: * ARGUMENTS:
@ -61,7 +61,7 @@ NdisEqualString(
VOID VOID
EXPORT EXPORT
NdisInitAnsiString( NdisInitAnsiString(
IN OUT PNDIS_ANSI_STRING DestinationString, IN OUT PANSI_STRING DestinationString,
IN PCSTR SourceString) IN PCSTR SourceString)
/* /*
* FUNCTION: Initializes an ANSI string * FUNCTION: Initializes an ANSI string
@ -131,7 +131,7 @@ NdisInitUnicodeString(
NDIS_STATUS NDIS_STATUS
EXPORT EXPORT
NdisUnicodeStringToAnsiString( NdisUnicodeStringToAnsiString(
IN OUT PNDIS_ANSI_STRING DestinationString, IN OUT PANSI_STRING DestinationString,
IN PNDIS_STRING SourceString) IN PNDIS_STRING SourceString)
/* /*
* FUNCTION: Converts an NDIS (unicode) string to an ANSI string * FUNCTION: Converts an NDIS (unicode) string to an ANSI string

View file

@ -51,15 +51,12 @@ NdisCompleteUnbindAdapter(
} }
/*
* @unimplemented
*/
VOID VOID
EXPORT EXPORT
NdisInitializeListHead( NdisInitializeListHead(
IN PLIST_ENTRY ListHead) IN PLIST_ENTRY ListHead)
{ {
UNIMPLEMENTED InitializeListHead(ListHead);
} }

View file

@ -44,7 +44,7 @@ NdisCancelTimer(
VOID VOID
EXPORT EXPORT
NdisGetCurrentSystemTime ( NdisGetCurrentSystemTime (
IN OUT PLONGLONG pSystemTime) IN OUT PLARGE_INTEGER pSystemTime)
{ {
KeQuerySystemTime (pSystemTime); KeQuerySystemTime (pSystemTime);
} }
@ -62,7 +62,7 @@ NdisInitializeTimer(
{ {
KeInitializeTimer (&Timer->Timer); KeInitializeTimer (&Timer->Timer);
KeInitializeDpc (&Timer->Dpc, TimerFunction, FunctionContext); KeInitializeDpc (&Timer->Dpc, (PKDEFERRED_ROUTINE)TimerFunction, FunctionContext);
} }

View file

@ -249,3 +249,4 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
return TME_TRUE; return TME_TRUE;
} }
} }

View file

@ -41,3 +41,4 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref);
#endif #endif

View file

@ -28,8 +28,10 @@
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <net/ndis.h> #include <net/ndis.h>
//#define PsGetCurrentProcess() IoGetCurrentProcess() //#define PsGetCurrentProcess() IoGetCurrentProcess()
#ifndef PsGetCurrentThread
#define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread())) #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread()))
#endif #endif
#endif
#include "debug.h" #include "debug.h"
#include "packet.h" #include "packet.h"

View file

@ -65,3 +65,4 @@ exec_fcn exec_fcn_mapper(uint32 index);
#endif #endif
#endif #endif

View file

@ -43,3 +43,4 @@ uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
#define DUMMY_INSERT 1234 #define DUMMY_INSERT 1234
#endif #endif

View file

@ -96,7 +96,7 @@ DriverEntry(
UNICODE_STRING UnicodeDeviceName; UNICODE_STRING UnicodeDeviceName;
PDEVICE_OBJECT DeviceObject = NULL; PDEVICE_OBJECT DeviceObject = NULL;
PDEVICE_EXTENSION DeviceExtension = NULL; PDEVICE_EXTENSION DeviceExtension = NULL;
NTSTATUS Status = STATUS_SUCCESS; NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
NTSTATUS ErrorCode = STATUS_SUCCESS; NTSTATUS ErrorCode = STATUS_SUCCESS;
NDIS_STRING ProtoName = NDIS_STRING_CONST("PacketDriver"); NDIS_STRING ProtoName = NDIS_STRING_CONST("PacketDriver");
ULONG DevicesCreated=0; ULONG DevicesCreated=0;
@ -173,11 +173,11 @@ DriverEntry(
NdisAllocateSpinLock(&Opened_Instances_Lock); NdisAllocateSpinLock(&Opened_Instances_Lock);
// Set up the device driver entry points. // Set up the device driver entry points.
DriverObject->MajorFunction[IRP_MJ_CREATE] = NPF_Open; DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)NPF_Open;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = NPF_Close; DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)NPF_Close;
DriverObject->MajorFunction[IRP_MJ_READ] = NPF_Read; DriverObject->MajorFunction[IRP_MJ_READ] = (PDRIVER_DISPATCH)NPF_Read;
DriverObject->MajorFunction[IRP_MJ_WRITE] = NPF_Write; DriverObject->MajorFunction[IRP_MJ_WRITE] = (PDRIVER_DISPATCH)NPF_Write;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NPF_IoControl; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)NPF_IoControl;
DriverObject->DriverUnload = NPF_Unload; DriverObject->DriverUnload = NPF_Unload;
/* /*

View file

@ -281,3 +281,4 @@ uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_
return TME_SUCCESS; return TME_SUCCESS;
} }

View file

@ -83,3 +83,4 @@ typedef struct __tcp_data
uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data); uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data);
#endif #endif

View file

@ -376,3 +376,4 @@ uint32 set_autodeletion(TME_DATA *data, uint32 value)
return TME_SUCCESS; return TME_SUCCESS;
} }

View file

@ -180,3 +180,4 @@ lut_fcn lut_fcn_mapper(uint32 index);
exec_fcn exec_fcn_mapper(uint32 index); exec_fcn exec_fcn_mapper(uint32 index);
#endif #endif

View file

@ -959,3 +959,4 @@ bpf_validate(f, len,mem_ex_size)
} }
return BPF_CLASS(f[len - 1].code) == BPF_RET; return BPF_CLASS(f[len - 1].code) == BPF_RET;
} }

View file

@ -29,3 +29,4 @@
uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref); uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref);
#endif #endif

View file

@ -249,3 +249,4 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
return TME_TRUE; return TME_TRUE;
} }
} }

View file

@ -41,3 +41,4 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref);
#endif #endif

View file

@ -28,8 +28,10 @@
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <net/ndis.h> #include <net/ndis.h>
//#define PsGetCurrentProcess() IoGetCurrentProcess() //#define PsGetCurrentProcess() IoGetCurrentProcess()
#ifndef PsGetCurrentThread
#define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread())) #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread()))
#endif #endif
#endif
#include "debug.h" #include "debug.h"
#include "packet.h" #include "packet.h"
@ -248,7 +250,7 @@ NPF_StartDump(POPEN_INSTANCE Open)
THREAD_ALL_ACCESS, THREAD_ALL_ACCESS,
NULL, NULL,
KernelMode, KernelMode,
&Open->DumpThreadObject, (VOID **)&Open->DumpThreadObject,
0); 0);
if ( !NT_SUCCESS( ntStatus ) ) if ( !NT_SUCCESS( ntStatus ) )
{ {

View file

@ -80,3 +80,4 @@ exec_fcn exec_fcn_mapper(uint32 index)
return NULL; return NULL;
} }

View file

@ -65,3 +65,4 @@ exec_fcn exec_fcn_mapper(uint32 index);
#endif #endif
#endif #endif

View file

@ -189,3 +189,4 @@ uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
return TME_FALSE; return TME_FALSE;
} }

View file

@ -43,3 +43,4 @@ uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct
#define DUMMY_INSERT 1234 #define DUMMY_INSERT 1234
#endif #endif

View file

@ -96,7 +96,7 @@ DriverEntry(
UNICODE_STRING UnicodeDeviceName; UNICODE_STRING UnicodeDeviceName;
PDEVICE_OBJECT DeviceObject = NULL; PDEVICE_OBJECT DeviceObject = NULL;
PDEVICE_EXTENSION DeviceExtension = NULL; PDEVICE_EXTENSION DeviceExtension = NULL;
NTSTATUS Status = STATUS_SUCCESS; NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
NTSTATUS ErrorCode = STATUS_SUCCESS; NTSTATUS ErrorCode = STATUS_SUCCESS;
NDIS_STRING ProtoName = NDIS_STRING_CONST("PacketDriver"); NDIS_STRING ProtoName = NDIS_STRING_CONST("PacketDriver");
ULONG DevicesCreated=0; ULONG DevicesCreated=0;
@ -594,6 +594,7 @@ BOOLEAN createDevice(IN OUT PDRIVER_OBJECT adriverObjectP,
//------------------------------------------------------------------- //-------------------------------------------------------------------
VOID VOID
STDCALL_FUNC
NPF_Unload(IN PDRIVER_OBJECT DriverObject) NPF_Unload(IN PDRIVER_OBJECT DriverObject)
{ {
PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT DeviceObject;

View file

@ -120,14 +120,14 @@
This IOCTL is used to perform an OID set operation on the NIC driver. This IOCTL is used to perform an OID set operation on the NIC driver.
*/ */
#define BIOCSETOID 2147483648 #define BIOCSETOID 2147483648U
/*! /*!
\brief IOCTL code: get an OID value \brief IOCTL code: get an OID value
This IOCTL is used to perform an OID get operation on the NIC driver. This IOCTL is used to perform an OID get operation on the NIC driver.
*/ */
#define BIOCQUERYOID 2147483652 #define BIOCQUERYOID 2147483652U
/*! /*!
\brief IOCTL code: set the name of a the file used by kernel dump mode \brief IOCTL code: set the name of a the file used by kernel dump mode
@ -713,6 +713,7 @@ NPF_StatusComplete(IN NDIS_HANDLE ProtocolBindingContext);
service (from control panel or with a console 'net stop npf'). service (from control panel or with a console 'net stop npf').
*/ */
VOID VOID
STDCALL_FUNC
NPF_Unload(IN PDRIVER_OBJECT DriverObject); NPF_Unload(IN PDRIVER_OBJECT DriverObject);

View file

@ -281,3 +281,4 @@ uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_
return TME_SUCCESS; return TME_SUCCESS;
} }

View file

@ -83,3 +83,4 @@ typedef struct __tcp_data
uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data); uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data);
#endif #endif

View file

@ -180,3 +180,4 @@ lut_fcn lut_fcn_mapper(uint32 index);
exec_fcn exec_fcn_mapper(uint32 index); exec_fcn exec_fcn_mapper(uint32 index);
#endif #endif

View file

@ -959,3 +959,4 @@ bpf_validate(f, len,mem_ex_size)
} }
return BPF_CLASS(f[len - 1].code) == BPF_RET; return BPF_CLASS(f[len - 1].code) == BPF_RET;
} }

View file

@ -29,3 +29,4 @@
uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref); uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref);
#endif #endif

View file

@ -400,12 +400,12 @@ NTSTATUS TiCleanupFileObject(
NTSTATUS NTSTATUS
#ifndef _MSC_VER //#ifndef _MSC_VER
STDCALL STDCALL_FUNC
#endif //#endif
TiDispatchOpenClose( TiDispatchOpenClose(
PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
PIRP Irp) IN PIRP Irp)
/* /*
* FUNCTION: Main dispath routine * FUNCTION: Main dispath routine
* ARGUMENTS: * ARGUMENTS:
@ -872,11 +872,11 @@ DriverEntry(
TCPDeviceObject->Flags |= DO_DIRECT_IO; TCPDeviceObject->Flags |= DO_DIRECT_IO;
/* Initialize the driver object with this driver's entry points */ /* Initialize the driver object with this driver's entry points */
DriverObject->MajorFunction[IRP_MJ_CREATE] = TiDispatchOpenClose; DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)TiDispatchOpenClose;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = TiDispatchOpenClose; DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)TiDispatchOpenClose;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = TiDispatchOpenClose; DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (PDRIVER_DISPATCH)TiDispatchOpenClose;
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = TiDispatchInternal; DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = (PDRIVER_DISPATCH)TiDispatchInternal;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = TiDispatch; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)TiDispatch;
DriverObject->DriverUnload = (PDRIVER_UNLOAD)TiUnload; DriverObject->DriverUnload = (PDRIVER_UNLOAD)TiUnload;

View file

@ -137,7 +137,7 @@ __inline INT SkipToOffset(
if (!Buffer) if (!Buffer)
return -1; return -1;
NdisQueryBuffer(Buffer, Data, Size); NdisQueryBuffer(Buffer, (PVOID)Data, Size);
if (Offset < *Size) { if (Offset < *Size) {
((ULONG_PTR)*Data) += Offset; ((ULONG_PTR)*Data) += Offset;
@ -203,7 +203,7 @@ UINT CopyBufferToBufferChain(
if (!DstBuffer) if (!DstBuffer)
break; break;
NdisQueryBuffer(DstBuffer, &DstData, &DstSize); NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
} }
} }
@ -262,7 +262,7 @@ UINT CopyBufferChainToBuffer(
if (!SrcBuffer) if (!SrcBuffer)
break; break;
NdisQueryBuffer(SrcBuffer, &SrcData, &SrcSize); NdisQueryBuffer(SrcBuffer, (PVOID)&SrcData, &SrcSize);
} }
} }
@ -335,12 +335,12 @@ UINT CopyPacketToBufferChain(
TI_DbgPrint(DEBUG_BUFFER, ("DstBuffer (0x%X) DstOffset (0x%X) SrcPacket (0x%X) SrcOffset (0x%X) Length (%d)\n", DstBuffer, DstOffset, SrcPacket, SrcOffset, Length)); TI_DbgPrint(DEBUG_BUFFER, ("DstBuffer (0x%X) DstOffset (0x%X) SrcPacket (0x%X) SrcOffset (0x%X) Length (%d)\n", DstBuffer, DstOffset, SrcPacket, SrcOffset, Length));
/* Skip DstOffset bytes in the destination buffer chain */ /* Skip DstOffset bytes in the destination buffer chain */
NdisQueryBuffer(DstBuffer, &DstData, &DstSize); NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1) if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1)
return 0; return 0;
/* Skip SrcOffset bytes in the source packet */ /* Skip SrcOffset bytes in the source packet */
NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, &SrcData, &SrcSize, &Total); NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total);
if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1) if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1)
return 0; return 0;
@ -369,7 +369,7 @@ UINT CopyPacketToBufferChain(
if (!DstBuffer) if (!DstBuffer)
break; break;
NdisQueryBuffer(DstBuffer, &DstData, &DstSize); NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
} }
SrcSize -= Count; SrcSize -= Count;
@ -380,7 +380,7 @@ UINT CopyPacketToBufferChain(
if (!SrcBuffer) if (!SrcBuffer)
break; break;
NdisQueryBuffer(SrcBuffer, &SrcData, &SrcSize); NdisQueryBuffer(SrcBuffer, (PVOID)&SrcData, &SrcSize);
} }
} }

View file

@ -15,7 +15,7 @@
* *
* Implementation of the Transmission Control Protocol(TCP). * Implementation of the Transmission Control Protocol(TCP).
* *
* Version: $Id: tcp_output.c,v 1.1 2003/01/15 21:57:31 chorns Exp $ * Version: $Id: tcp_output.c,v 1.2 2003/07/24 18:14:59 royce Exp $
* *
* Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@ -1418,7 +1418,7 @@ void tcp_send_ack(struct sock *sk)
tcp_transmit_skb(sk, buff); tcp_transmit_skb(sk, buff);
} }
#else #else
return 0; return;
#endif #endif
} }

View file

@ -41,6 +41,8 @@ extern DWORD DebugTraceLevel;
#endif /* _MSC_VER */ #endif /* _MSC_VER */
/* in rtl.h now */
#if 0
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
#endif #endif
@ -50,7 +52,7 @@ extern DWORD DebugTraceLevel;
#else /* NASSERT */ #else /* NASSERT */
#define ASSERT(x) if (!(x)) { TDI_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); } #define ASSERT(x) if (!(x)) { TDI_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
#endif /* NASSERT */ #endif /* NASSERT */
#endif
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
#else /* DBG */ #else /* DBG */

View file

@ -28,6 +28,8 @@ extern DWORD DebugTraceLevel;
DbgPrint _x_; \ DbgPrint _x_; \
} }
/* this belongs in rtl */
#if 0
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
#endif #endif
@ -37,12 +39,13 @@ extern DWORD DebugTraceLevel;
#else /* NASSERT */ #else /* NASSERT */
#define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); } #define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
#endif /* NASSERT */ #endif /* NASSERT */
#endif
#else /* DBG */ #else /* DBG */
#define WSH_DbgPrint(_t_, _x_) #define WSH_DbgPrint(_t_, _x_)
#define ASSERT(x) /*#define ASSERT(x)*/
#endif /* DBG */ #endif /* DBG */

View file

@ -1,4 +1,4 @@
/* $Id: psfuncs.h,v 1.24 2003/06/20 16:19:33 ekohl Exp $ /* $Id: psfuncs.h,v 1.25 2003/07/24 18:14:59 royce Exp $
*/ */
#ifndef _INCLUDE_DDK_PSFUNCS_H #ifndef _INCLUDE_DDK_PSFUNCS_H
#define _INCLUDE_DDK_PSFUNCS_H #define _INCLUDE_DDK_PSFUNCS_H
@ -31,7 +31,7 @@ NTSTATUS STDCALL PsCreateSystemThread(PHANDLE ThreadHandle,
HANDLE ProcessHandle, HANDLE ProcessHandle,
PCLIENT_ID ClientId, PCLIENT_ID ClientId,
PKSTART_ROUTINE StartRoutine, PKSTART_ROUTINE StartRoutine,
PVOID StartContext); void *StartContext);
NTSTATUS STDCALL PsTerminateSystemThread(NTSTATUS ExitStatus); NTSTATUS STDCALL PsTerminateSystemThread(NTSTATUS ExitStatus);
NTSTATUS STDCALL PsCreateSystemProcess(PHANDLE ProcessHandle, NTSTATUS STDCALL PsCreateSystemProcess(PHANDLE ProcessHandle,

View file

@ -4,6 +4,7 @@
* FILE: include/net/miniport.h * FILE: include/net/miniport.h
* PURPOSE: Type definitions available only to NDIS miniport drivers * PURPOSE: Type definitions available only to NDIS miniport drivers
*/ */
#if 0
#ifndef __MINIPORT_H #ifndef __MINIPORT_H
#define __MINIPORT_H #define __MINIPORT_H
@ -847,3 +848,4 @@ WRITE_REGISTER_USHORT(
#endif /* __MINIPORT_H */ #endif /* __MINIPORT_H */
/* EOF */ /* EOF */
#endif

View file

@ -6,11 +6,24 @@
* DEFINES: i386 - Target platform is i386 * DEFINES: i386 - Target platform is i386
* NDIS_WRAPPER - Define only for NDIS wrapper library * NDIS_WRAPPER - Define only for NDIS wrapper library
* NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers * NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers
* BINARY_COMPATIBLE - 0 = Use macros for some features
* - 1 = Use imports for features not available
* NDIS40 - Use NDIS 4.0 structures by default * NDIS40 - Use NDIS 4.0 structures by default
* NDIS50 - Use NDIS 5.0 structures by default * NDIS50 - Use NDIS 5.0 structures by default
* NDIS_WDM - Include wdm.h (currently just pulls in ntddk.h)
*
* NOTES: If NDIS_WDM is not defined, ntddk.h is included instead
*
* I have removed the following standard flag, used for building binary-compatible
* drivers for windows 98 and windows me:
*
* BINARY_COMPATIBLE - 0 = Use macros for some features
* - 1 = Use imports for features not available
*
* rationale: you're never going to use *this* ndis.h to build a driver for win9x. You'll
* use the MS ddk. This assumption drammatically simplifies ndis.h.
*/ */
// TODO: finish sanitizing NDIS40 and NDIS50; think about NDIS51
#ifndef __NDIS_H #ifndef __NDIS_H
#define __NDIS_H #define __NDIS_H
@ -24,16 +37,6 @@ extern "C"
#define NDIS40 #define NDIS40
#endif #endif
/* Windows 9x compatibillity for miniports on x86 platform */
#ifndef BINARY_COMPATIBLE
#if defined(NDIS_MINIPORT_DRIVER) && defined(i386)
#define BINARY_COMPATIBLE 1
#else
#define BINARY_COMPATIBLE 0
#endif
#endif
#ifndef UNALIGNED #ifndef UNALIGNED
#define UNALIGNED #define UNALIGNED
#endif #endif
@ -42,13 +45,13 @@ extern "C"
#define FASTCALL __attribute__((fastcall)) #define FASTCALL __attribute__((fastcall))
#endif #endif
/* The NDIS library export functions. NDIS miniport drivers import functions */ /* The NDIS library exports functions. NDIS miniport drivers import functions */
#ifdef NDIS_WRAPPER #ifdef NDIS_WRAPPER
#ifdef _MSC_VER #ifdef _MSC_VER
#define EXPIMP __declspec(dllexport) #define EXPIMP __declspec(dllexport)
#else #else
#define EXPIMP STDCALL #define EXPIMP STDCALL /* MS ndis.h is 100% stdcall due to compiler flag /Gz */
#endif #endif
#else /* NDIS_WRAPPER */ #else /* NDIS_WRAPPER */
@ -61,23 +64,39 @@ extern "C"
#endif /* NDIS_WRAPPER */ #endif /* NDIS_WRAPPER */
/* support NDIS_WDM and MAC drivers */
#if defined (NDIS_WDM)
#ifdef NDIS_MINIPORT_DRIVER #include <wdm.h>
#else
#include "miniport.h"
#else /* NDIS_MINIPORT_DRIVER */
#ifdef _MSC_VER
#include <ntddk.h> #include <ntddk.h>
#endif
typedef ULONG ULONG_PTR, *PULONG_PTR; /* Assert stuff */
#ifdef DBG
VOID
STDCALL
RtlAssert (
PVOID FailedAssertion,
PVOID FileName,
ULONG LineNumber,
PCHAR Message
);
#else /* _MSC_VER */ #define ASSERT( exp ) if (!(exp)) RtlAssert( #exp, __FILE__, __LINE__, NULL )
#include <ddk/ntddk.h> #define ASSERTMSG( msg, exp ) if (!(exp)) RtlAssert( #exp, __FILE__, __LINE__, msg )
/* FIXME: Missed some definitions in there */ #else
#define ASSERT( exp )
#define ASSERTMSG( msg, exp )
#endif /* DBG */
/* Base types */
#define IN
#define OUT
#define OPTIONAL
typedef CONST CHAR *PCSTR;
typedef struct _DMA_CONFIGURATION_BYTE0 typedef struct _DMA_CONFIGURATION_BYTE0
{ {
@ -182,34 +201,35 @@ typedef struct _CM_EISA_FUNCTION_INFORMATION
UCHAR InitializationData[60]; UCHAR InitializationData[60];
} CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION; } CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION;
#endif /* _MSC_VER */ ULONG CDECL DbgPrint(
PCH Format,
...);
/* FIXME: Missed some definitions in there */
typedef CONST CHAR *PCSTR; /* Core kernel functions */
VOID
STDCALL
KeStallExecutionProcessor(
ULONG MicroSeconds);
#endif /* NDIS_MINIPORT_DRIVER */
#include "netevent.h" #include "netevent.h"
#include "ndisoid.h" #include "ndisoid.h"
#include "ntddndis.h" #include "ntddndis.h"
#if defined(NDIS_MINIPORT_DRIVER) || !defined(_MSC_VER) #if !defined(_MSC_VER)
#ifndef _GUID_DEFINED #ifndef _GUID_DEFINED
#define _GUID_DEFINED #define _GUID_DEFINED
typedef struct _GUID { typedef struct _GUID {
ULONG Data1; ULONG Data1;
USHORT Data2; USHORT Data2;
USHORT Data3; USHORT Data3;
UCHAR Data4[8]; UCHAR Data4[8];
} GUID; } GUID;
#endif /* _GUID_DEFINED */ #endif /* _GUID_DEFINED */
#endif /* _MSC_VER */
#endif /* NDIS_MINIPORT_DRIVER || _MSC_VER */
/* NDIS base types */ /* NDIS base types */
@ -230,8 +250,6 @@ typedef int NDIS_STATUS, *PNDIS_STATUS;
typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING; typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING;
typedef PCSTR NDIS_ANSI_STRING, *PNDIS_ANSI_STRING;
typedef MDL NDIS_BUFFER, *PNDIS_BUFFER; typedef MDL NDIS_BUFFER, *PNDIS_BUFFER;
/* NDIS_STATUS constants */ /* NDIS_STATUS constants */
@ -343,6 +361,7 @@ typedef MDL NDIS_BUFFER, *PNDIS_BUFFER;
#define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
#define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
#define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
#define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020
@ -395,6 +414,18 @@ typedef struct _NDIS_TIMER
KDPC Dpc; KDPC Dpc;
} NDIS_TIMER, *PNDIS_TIMER; } NDIS_TIMER, *PNDIS_TIMER;
VOID
EXPIMP
NdisInitializeTimer(
IN OUT PNDIS_TIMER Timer,
IN PNDIS_TIMER_FUNCTION TimerFunction,
IN PVOID FunctionContext);
VOID
EXPIMP
NdisSetTimer(
IN PNDIS_TIMER Timer,
IN UINT MillisecondsToDelay);
/* Hardware */ /* Hardware */
@ -615,6 +646,14 @@ typedef struct _NDIS_REQUEST {
UINT BytesNeeded; UINT BytesNeeded;
} SET_INFORMATION; } SET_INFORMATION;
} DATA; } DATA;
#ifdef NDIS50
UCHAR NdisReserved[36];
union {
UCHAR CallMgrReserved[8];
UCHAR ProtocolReserved[8];
};
UCHAR MiniportReserved[8];
#endif
} NDIS_REQUEST, *PNDIS_REQUEST; } NDIS_REQUEST, *PNDIS_REQUEST;
@ -739,8 +778,6 @@ typedef enum _NDIS_PNP_DEVICE_STATE
#endif /* NDIS_WRAPPER */ #endif /* NDIS_WRAPPER */
#ifdef NDIS50
typedef struct _ATM_ADDRESS ATM_ADDRESS, *PATM_ADDRESS; typedef struct _ATM_ADDRESS ATM_ADDRESS, *PATM_ADDRESS;
@ -1174,8 +1211,6 @@ typedef struct _NDIS_CLIENT_CHARACTERISTICS
CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler; CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler;
} NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS; } NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS;
#endif /* NDIS50 */
/* NDIS protocol structures */ /* NDIS protocol structures */
@ -1565,14 +1600,21 @@ NdisUnchainBufferAtFront(
IN OUT PNDIS_PACKET Packet, IN OUT PNDIS_PACKET Packet,
OUT PNDIS_BUFFER *Buffer); OUT PNDIS_BUFFER *Buffer);
#if BINARY_COMPATIBLE /*
* PVOID NdisAdjustBufferLength(
* IN PNDIS_BUFFER Buffer,
* IN UINT Length);
*/
VOID VOID
EXPIMP EXPIMP
NdisAdjustBufferLength( NdisAdjustBufferLength(
IN PNDIS_BUFFER Buffer, IN PNDIS_BUFFER Buffer,
IN UINT Length); IN UINT Length);
/*
* ULONG NDIS_BUFFER_TO_SPAN_PAGES(
* IN PNDIS_BUFFER Buffer);
*/
ULONG ULONG
EXPIMP EXPIMP
NDIS_BUFFER_TO_SPAN_PAGES( NDIS_BUFFER_TO_SPAN_PAGES(
@ -1583,18 +1625,33 @@ EXPIMP
NdisFreeBuffer( NdisFreeBuffer(
IN PNDIS_BUFFER Buffer); IN PNDIS_BUFFER Buffer);
/*
* VOID NdisGetBufferPhysicalArraySize(
* IN PNDIS_BUFFER Buffer,
* OUT PUINT ArraySize);
*/
VOID VOID
EXPIMP EXPIMP
NdisGetBufferPhysicalArraySize( NdisGetBufferPhysicalArraySize(
IN PNDIS_BUFFER Buffer, IN PNDIS_BUFFER Buffer,
OUT PUINT ArraySize); OUT PUINT ArraySize);
/*
* VOID NdisGetFirstBufferFromPacket(
* IN PNDIS_PACKET _Packet,
* OUT PNDIS_BUFFER * _FirstBuffer,
* OUT PVOID * _FirstBufferVA,
* OUT PUINT _FirstBufferLength,
* OUT PUINT _TotalBufferLength)
*/
VOID VOID
EXPIMP EXPIMP
NdisGetFirstBufferFromPacket( NdisGetFirstBufferFromPacket(
IN PNDIS_PACKET _Packet, IN PNDIS_PACKET _Packet,
OUT PNDIS_BUFFER *_FirstBuffer, OUT PNDIS_BUFFER * _FirstBuffer,
OUT PVOID *_FirstBufferVA, OUT PVOID * _FirstBufferVA,
OUT PUINT _FirstBufferLength, OUT PUINT _FirstBufferLength,
OUT PUINT _TotalBufferLength); OUT PUINT _TotalBufferLength);
@ -1612,131 +1669,6 @@ NdisQueryBufferOffset(
OUT PUINT Offset, OUT PUINT Offset,
OUT PUINT Length); OUT PUINT Length);
#else /* BINARY_COMPATIBLE */
/*
* PVOID NdisAdjustBufferLength(
* IN PNDIS_BUFFER Buffer,
* IN UINT Length);
*/
#define NdisAdjustBufferLength(Buffer, \
Length) \
{ \
(Buffer)->ByteCount = (Length); \
}
/*
* ULONG NDIS_BUFFER_TO_SPAN_PAGES(
* IN PNDIS_BUFFER Buffer);
*/
#define NDIS_BUFFER_TO_SPAN_PAGES(Buffer) \
( \
MmGetMdlByteCount(Buffer) == 0 ? \
1 : \
ADDRESS_AND_SIZE_TO_SPAN_PAGES( \
MmGetMdlVirtualAddress(Buffer), \
MmGetMdlByteCount(Buffer)) \
)
#if 0
/*
* VOID NdisFreeBuffer(
* IN PNDIS_BUFFER Buffer);
*/
#define NdisFreeBuffer(Buffer) \
{ \
IoFreeMdl(Buffer) /* ??? */ \
}
#else
VOID
EXPIMP
NdisFreeBuffer(
IN PNDIS_BUFFER Buffer);
#endif
/*
* VOID NdisGetBufferPhysicalArraySize(
* IN PNDIS_BUFFER Buffer,
* OUT PUINT ArraySize);
*/
#define NdisGetBufferPhysicalArraySize(Buffer, \
ArraySize) \
{ \
}
/*
* VOID NdisGetFirstBufferFromPacket(
* IN PNDIS_PACKET _Packet,
* OUT PNDIS_BUFFER * _FirstBuffer,
* OUT PVOID * _FirstBufferVA,
* OUT PUINT _FirstBufferLength,
* OUT PUINT _TotalBufferLength)
*/
#define NdisGetFirstBufferFromPacket(Packet, \
FirstBuffer, \
FirstBufferVA, \
FirstBufferLength, \
TotalBufferLength) \
{ \
PNDIS_BUFFER _Buffer; \
\
_Buffer = (Packet)->Private.Head; \
*(FirstBuffer) = _Buffer; \
*(FirstBufferVA) = MmGetMdlVirtualAddress(_Buffer); \
if (_Buffer != NULL) { \
*(FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
_Buffer = _Buffer->Next; \
} else \
*(FirstBufferLength) = 0; \
*(TotalBufferLength) = *(FirstBufferLength); \
while (_Buffer != NULL) { \
*(TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
_Buffer = _Buffer->Next; \
} \
}
/*
* VOID NdisQueryBuffer(
* IN PNDIS_BUFFER Buffer,
* OUT PVOID *VirtualAddress OPTIONAL,
* OUT PUINT Length)
*/
#define NdisQueryBuffer(Buffer, \
VirtualAddress, \
Length) \
{ \
if (VirtualAddress) \
*((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \
\
*((PUINT)Length) = MmGetMdlByteCount(Buffer); \
}
/*
* VOID NdisQueryBufferOffset(
* IN PNDIS_BUFFER Buffer,
* OUT PUINT Offset,
* OUT PUINT Length);
*/
#define NdisQueryBufferOffset(Buffer, \
Offset, \
Length) \
{ \
*((PUINT)Offset) = MmGetMdlByteOffset(Buffer); \
*((PUINT)Length) = MmGetMdlByteCount(Buffer); \
}
#endif /* BINARY_COMPATIBLE */
/* /*
* PVOID NDIS_BUFFER_LINKAGE( * PVOID NDIS_BUFFER_LINKAGE(
* IN PNDIS_BUFFER Buffer); * IN PNDIS_BUFFER Buffer);
@ -1805,7 +1737,6 @@ NdisFreeBuffer(
*(NextBuffer) = (CurrentBuffer)->Next; \ *(NextBuffer) = (CurrentBuffer)->Next; \
} }
/* /*
* UINT NdisGetPacketFlags( * UINT NdisGetPacketFlags(
* IN PNDIS_PACKET Packet); * IN PNDIS_PACKET Packet);
@ -2321,49 +2252,16 @@ NdisImmediateWritePciSlotInformation(
/* String management routines */ /* String management routines */
#if BINARY_COMPATIBLE
NDIS_STATUS
EXPIMP
NdisAnsiStringToUnicodeString(
IN OUT PNDIS_STRING DestinationString,
IN PNDIS_ANSI_STRING SourceString);
BOOLEAN
EXPIMP
NdisEqualString(
IN PNDIS_STRING String1,
IN PNDIS_STRING String2,
IN BOOLEAN CaseInsensitive);
VOID
EXPIMP
NdisInitAnsiString(
IN OUT PNDIS_ANSI_STRING DestinationString,
IN PCSTR SourceString);
VOID
EXPIMP
NdisInitUnicodeString(
IN OUT PNDIS_STRING DestinationString,
IN PCWSTR SourceString);
NDIS_STATUS
EXPIMP
NdisUnicodeStringToAnsiString(
IN OUT PNDIS_ANSI_STRING DestinationString,
IN PNDIS_STRING SourceString);
#else /* BINARY_COMPATIBLE */
/* /*
* NDIS_STATUS NdisAnsiStringToUnicodeString( * NDIS_STATUS NdisAnsiStringToUnicodeString(
* IN OUT PNDIS_STRING DestinationString, * IN OUT PNDIS_STRING DestinationString,
* IN PNDIS_ANSI_STRING SourceString); * IN PNDIS_ANSI_STRING SourceString);
*/ */
#define NdisAnsiStringToUnicodeString(DestinationString, \ NDIS_STATUS
SourceString) \ EXPIMP
RtlAnsiStringToUnicodeString((DestinationString), (SourceString), FALSE) NdisAnsiStringToUnicodeString(
IN OUT PNDIS_STRING DestinationString,
IN PANSI_STRING SourceString);
/* /*
* BOOLEAN NdisEqualString( * BOOLEAN NdisEqualString(
@ -2371,39 +2269,45 @@ NdisUnicodeStringToAnsiString(
* IN PNDIS_STRING String2, * IN PNDIS_STRING String2,
* IN BOOLEAN CaseInsensitive) * IN BOOLEAN CaseInsensitive)
*/ */
#define NdisEqualString(String1, \ BOOLEAN
String2, \ EXPIMP
CaseInsensitive) \ NdisEqualString(
RtlEqualUnicodeString((String1), (String2), (CaseInsensitive)) IN PNDIS_STRING String1,
IN PNDIS_STRING String2,
IN BOOLEAN CaseInsensitive);
/* /*
* VOID NdisInitAnsiString( * VOID NdisInitAnsiString(
* IN OUT PNDIS_ANSI_STRING DestinationString, * IN OUT PNDIS_ANSI_STRING DestinationString,
* IN PCSTR SourceString) * IN PCSTR SourceString)
*/ */
#define NdisInitAnsiString(DestinationString, \ VOID
SourceString) \ EXPIMP
RtlInitString((DestinationString), (SourceString)) NdisInitAnsiString(
IN OUT PANSI_STRING DestinationString,
IN PCSTR SourceString);
/* /*
* VOID NdisInitUnicodeString( * VOID NdisInitUnicodeString(
* IN OUT PNDIS_STRING DestinationString, * IN OUT PNDIS_STRING DestinationString,
* IN PCWSTR SourceString) * IN PCWSTR SourceString)
*/ */
#define NdisInitUnicodeString(DestinationString, \ VOID
SourceString) \ EXPIMP
RtlInitUnicodeString((DestinationString), (SourceString)) NdisInitUnicodeString(
IN OUT PNDIS_STRING DestinationString,
IN PCWSTR SourceString);
/* /*
* NDIS_STATUS NdisUnicodeStringToAnsiString( * NDIS_STATUS NdisUnicodeStringToAnsiString(
* IN OUT PNDIS_ANSI_STRING DestinationString, * IN OUT PNDIS_ANSI_STRING DestinationString,
* IN PNDIS_STRING SourceString) * IN PNDIS_STRING SourceString)
*/ */
#define NdisUnicodeStringToAnsiString(DestinationString, \ NDIS_STATUS
SourceString) \ EXPIMP
RtlUnicodeStringToAnsiString((DestinationString), (SourceString), FALSE) NdisUnicodeStringToAnsiString(
IN OUT PANSI_STRING DestinationString,
#endif /* BINARY_COMPATIBLE */ IN PNDIS_STRING SourceString);
#define NdisFreeString(_s) NdisFreeMemory((s).Buffer, (s).MaximumLength, 0) #define NdisFreeString(_s) NdisFreeMemory((s).Buffer, (s).MaximumLength, 0)
#define NdisPrintString(_s) DbgPrint("%ls", (s).Buffer) #define NdisPrintString(_s) DbgPrint("%ls", (s).Buffer)
@ -2833,14 +2737,10 @@ NdisDprReleaseSpinLock(
VOID VOID
EXPIMP EXPIMP
NdisGetCurrentSystemTime( NdisGetCurrentSystemTime(
PLONGLONG pSystemTime PLARGE_INTEGER pSystemTime
); );
/* NDIS 5.0 extensions */
#ifdef NDIS50
VOID VOID
EXPIMP EXPIMP
NdisAcquireReadWriteLock( NdisAcquireReadWriteLock(
@ -3446,7 +3346,7 @@ NdisIMInitializeDeviceInstanceEx(
IN PNDIS_STRING DriverInstance, IN PNDIS_STRING DriverInstance,
IN NDIS_HANDLE DeviceContext OPTIONAL); IN NDIS_HANDLE DeviceContext OPTIONAL);
#endif /* NDIS50 */ //#endif /* NDIS50 */
@ -5433,8 +5333,6 @@ NdisUpdateSharedMemory(
/* Routines for NDIS protocol drivers */ /* Routines for NDIS protocol drivers */
#if BINARY_COMPATIBLE
VOID VOID
EXPIMP EXPIMP
NdisRequest( NdisRequest(
@ -5472,40 +5370,7 @@ NdisTransferData(
IN UINT BytesToTransfer, IN UINT BytesToTransfer,
IN OUT PNDIS_PACKET Packet, IN OUT PNDIS_PACKET Packet,
OUT PUINT BytesTransferred); OUT PUINT BytesTransferred);
/*
#else /* BINARY_COMPATIBLE */
#define NdisRequest(Status, \
NdisBindingHandle, \
NdisRequest) \
{ \
*(Status) = (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->RequestHandler)( \
((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->MacBindingHandle, (NdisRequest)); \
}
#define NdisReset(Status, \
NdisBindingHandle) \
{ \
*(Status) = (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->ResetHandler)( \
((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->MacBindingHandle); \
}
#define NdisSend(Status, \
NdisBindingHandle, \
Packet) \
{ \
*(Status) = (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->u1.SendHandler)( \
((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->MacBindingHandle, (Packet)); \
}
#define NdisSendPackets(NdisBindingHandle, \
PacketArray, \
NumberOfPackets) \
{ \
(((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->SendPacketsHandler)( \
(PNDIS_OPEN_BLOCK)(NdisBindingHandle), (PacketArray), (NumberOfPackets)); \
}
#define NdisTransferData(Status, \ #define NdisTransferData(Status, \
NdisBindingHandle, \ NdisBindingHandle, \
MacReceiveContext, \ MacReceiveContext, \
@ -5522,8 +5387,7 @@ NdisTransferData(
(Packet), \ (Packet), \
(BytesTransferred)); \ (BytesTransferred)); \
} }
*/
#endif /* BINARY_COMPATIBLE */
VOID VOID
@ -5605,3 +5469,127 @@ NdisReturnPackets(
#endif /* __NDIS_H */ #endif /* __NDIS_H */
/* EOF */ /* EOF */
/*
* XXX - these macros are disabled for the momentdue to the fact that there are definitions for them elsewhere.
* We will have to decide which to keep; we don't need both (no BINARY_COMPATIBLE)
*/
#if 0
#define NdisAdjustBufferLength(Buffer, \
Length) \
{ \
(Buffer)->ByteCount = (Length); \
}
#define NDIS_BUFFER_TO_SPAN_PAGES(Buffer) \
( \
MmGetMdlByteCount(Buffer) == 0 ? \
1 : \
ADDRESS_AND_SIZE_TO_SPAN_PAGES( \
MmGetMdlVirtualAddress(Buffer), \
MmGetMdlByteCount(Buffer)) \
)
#define NdisFreeBuffer(Buffer) \
{ \
IoFreeMdl(Buffer) /* ??? */ \
}
#define NdisGetBufferPhysicalArraySize(Buffer, \
ArraySize) \
{ \
}
#define NdisGetFirstBufferFromPacket(Packet, \
FirstBuffer, \
FirstBufferVA, \
FirstBufferLength, \
TotalBufferLength) \
{ \
PNDIS_BUFFER _Buffer; \
\
_Buffer = (Packet)->Private.Head; \
*(FirstBuffer) = _Buffer; \
*(FirstBufferVA) = MmGetMdlVirtualAddress(_Buffer); \
if (_Buffer != NULL) { \
*(FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
_Buffer = _Buffer->Next; \
} else \
*(FirstBufferLength) = 0; \
*(TotalBufferLength) = *(FirstBufferLength); \
while (_Buffer != NULL) { \
*(TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
_Buffer = _Buffer->Next; \
} \
}
#define NdisQueryBuffer(Buffer, \
VirtualAddress, \
Length) \
{ \
if (VirtualAddress) \
*((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \
\
*((PUINT)Length) = MmGetMdlByteCount(Buffer); \
}
#define NdisQueryBufferOffset(Buffer, \
Offset, \
Length) \
{ \
*((PUINT)Offset) = MmGetMdlByteOffset(Buffer); \
*((PUINT)Length) = MmGetMdlByteCount(Buffer); \
}
#define NdisAnsiStringToUnicodeString(DestinationString, \
SourceString) \
RtlAnsiStringToUnicodeString((DestinationString), (SourceString), FALSE)
#define NdisEqualString(String1, \
String2, \
CaseInsensitive) \
RtlEqualUnicodeString((String1), (String2), (CaseInsensitive))
#define NdisInitAnsiString(DestinationString, \
SourceString) \
RtlInitString((DestinationString), (SourceString))
#define NdisInitUnicodeString(DestinationString, \
SourceString) \
RtlInitUnicodeString((DestinationString), (SourceString))
#define NdisUnicodeStringToAnsiString(DestinationString, \
SourceString) \
RtlUnicodeStringToAnsiString((DestinationString), (SourceString), FALSE)
#define NdisRequest(Status, \
NdisBindingHandle, \
NdisRequest) \
{ \
*(Status) = (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->RequestHandler)( \
((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->MacBindingHandle, (NdisRequest)); \
}
#define NdisReset(Status, \
NdisBindingHandle) \
{ \
*(Status) = (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->ResetHandler)( \
((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->MacBindingHandle); \
}
#define NdisSend(Status, \
NdisBindingHandle, \
Packet) \
{ \
*(Status) = (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->u1.SendHandler)( \
((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->MacBindingHandle, (Packet)); \
}
#define NdisSendPackets(NdisBindingHandle, \
PacketArray, \
NumberOfPackets) \
{ \
(((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->SendPacketsHandler)( \
(PNDIS_OPEN_BLOCK)(NdisBindingHandle), (PacketArray), (NumberOfPackets)); \
}
#endif

View file

@ -407,4 +407,14 @@ typedef struct _NET_PNP_TRANSLATE_LIST
#endif /* __NDISOID_H */ #endif /* __NDISOID_H */
/* PNP OIDs */
#define OID_PNP_CAPABILITIES 0xFD010100
#define OID_PNP_SET_POWER 0xFD010101
#define OID_PNP_QUERY_POWER 0xFD010102
#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103
#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104
#define OID_PNP_WAKE_UP_PATTERN_LIST 0xFD010105
#define OID_PNP_ENABLE_WAKE_UP 0xFD010106
/* EOF */ /* EOF */

View file

@ -28,6 +28,7 @@ extern DWORD DebugTraceLevel;
DbgPrint _x_; \ DbgPrint _x_; \
} }
#if 0
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
#endif #endif
@ -38,11 +39,13 @@ extern DWORD DebugTraceLevel;
#define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); } #define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
#endif /* NASSERT */ #endif /* NASSERT */
#endif
#else /* DBG */ #else /* DBG */
#define WSH_DbgPrint(_t_, _x_) #define WSH_DbgPrint(_t_, _x_)
#define ASSERT(x) /*#define ASSERT(x)*/
#endif /* DBG */ #endif /* DBG */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: profile.c,v 1.4 2003/07/21 21:53:51 royce Exp $ /* $Id: profile.c,v 1.5 2003/07/24 18:14:59 royce Exp $
* *
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/dbg/profile.c * FILE: ntoskrnl/dbg/profile.c
@ -364,7 +364,7 @@ KdbProfilerAnalyzeSamples()
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS STDCALL VOID STDCALL_FUNC
KdbProfilerThreadMain(PVOID Context) KdbProfilerThreadMain(PVOID Context)
{ {
for (;;) for (;;)

View file

@ -1,4 +1,4 @@
/* $Id: init.c,v 1.48 2003/06/09 13:45:22 ekohl Exp $ /* $Id: init.c,v 1.49 2003/07/24 18:14:59 royce Exp $
* *
* init.c - Session Manager initialization * init.c - Session Manager initialization
* *
@ -880,6 +880,8 @@ InitSessionManager(HANDLE Children[])
return(Status); return(Status);
} }
PrintString("SM: loading well-known DLLs\n");
/* Load the well known DLLs */ /* Load the well known DLLs */
Status = SmLoadKnownDlls(); Status = SmLoadKnownDlls();
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -888,6 +890,8 @@ InitSessionManager(HANDLE Children[])
/* Don't crash ReactOS if DLLs cannot be loaded */ /* Don't crash ReactOS if DLLs cannot be loaded */
} }
PrintString("SM: creating system paging files\n");
/* Create paging files */ /* Create paging files */
Status = SmCreatePagingFiles(); Status = SmCreatePagingFiles();
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -896,6 +900,8 @@ InitSessionManager(HANDLE Children[])
return(Status); return(Status);
} }
PrintString("SM: initializing registry\n");
/* Load remaining registry hives */ /* Load remaining registry hives */
NtInitializeRegistry(FALSE); NtInitializeRegistry(FALSE);
@ -909,6 +915,8 @@ InitSessionManager(HANDLE Children[])
} }
#endif #endif
PrintString("SM: loading subsystems\n");
/* Load the subsystems */ /* Load the subsystems */
Status = SmLoadSubsystems(); Status = SmLoadSubsystems();
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -917,6 +925,8 @@ InitSessionManager(HANDLE Children[])
return(Status); return(Status);
} }
PrintString("SM: initializing csrss\n");
/* Run csrss.exe */ /* Run csrss.exe */
RtlInitUnicodeStringFromLiteral(&UnicodeString, RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\CsrssInitDone"); L"\\CsrssInitDone");
@ -986,6 +996,8 @@ InitSessionManager(HANDLE Children[])
* Start the logon process (winlogon.exe) * Start the logon process (winlogon.exe)
*/ */
PrintString("SM: starting winlogon\n");
/* initialize executable path */ /* initialize executable path */
wcscpy(UnicodeBuffer, L"\\??\\"); wcscpy(UnicodeBuffer, L"\\??\\");
wcscat(UnicodeBuffer, SharedUserData->NtSystemRoot); wcscat(UnicodeBuffer, SharedUserData->NtSystemRoot);