diff --git a/reactos/drivers/bus/acpi/makefile b/reactos/drivers/bus/acpi/makefile index 4fa295b3c04..9699a9587e0 100644 --- a/reactos/drivers/bus/acpi/makefile +++ b/reactos/drivers/bus/acpi/makefile @@ -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 = ../../.. @@ -8,6 +8,8 @@ TARGET_NAME = acpi TARGET_CFLAGS = -I./include -I./ospm/include +TARGET_DDKLIBS = ntoskrnl.a + OBJECTS_PATH = objects TARGET_OBJECTS = $(OBJECTS_PATH)/$(TARGET_NAME).o diff --git a/reactos/drivers/net/afd/afd/afd.c b/reactos/drivers/net/afd/afd/afd.c index 742d989b38f..a82fea24e7c 100644 --- a/reactos/drivers/net/afd/afd/afd.c +++ b/reactos/drivers/net/afd/afd/afd.c @@ -167,13 +167,13 @@ DriverEntry( KeInitializeSpinLock(&DeviceExt->FCBListLock); InitializeListHead(&DeviceExt->FCBListHead); - DriverObject->MajorFunction[IRP_MJ_CREATE] = AfdCreate; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = AfdClose; - DriverObject->MajorFunction[IRP_MJ_READ] = AfdRead; - DriverObject->MajorFunction[IRP_MJ_WRITE] = AfdWrite; - DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = AfdFileSystemControl; - DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = AfdDispatch; - DriverObject->MajorFunction[IRP_MJ_CLEANUP] = AfdClose; + DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)AfdCreate; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)AfdClose; + DriverObject->MajorFunction[IRP_MJ_READ] = (PDRIVER_DISPATCH)AfdRead; + DriverObject->MajorFunction[IRP_MJ_WRITE] = (PDRIVER_DISPATCH)AfdWrite; + DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = (PDRIVER_DISPATCH)AfdFileSystemControl; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)AfdDispatch; + DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (PDRIVER_DISPATCH)AfdClose; DriverObject->DriverUnload = (PDRIVER_UNLOAD)AfdUnload; diff --git a/reactos/drivers/net/dd/ne2000/include/debug.h b/reactos/drivers/net/dd/ne2000/include/debug.h index 5b96c6fb9cc..2b61a545e96 100644 --- a/reactos/drivers/net/dd/ne2000/include/debug.h +++ b/reactos/drivers/net/dd/ne2000/include/debug.h @@ -43,6 +43,8 @@ extern ULONG DebugTraceLevel; #endif /* _MSC_VER */ +/* Assert and kin are defined in rtl.h */ +#if 0 #ifdef ASSERT #undef ASSERT #endif @@ -52,7 +54,7 @@ extern ULONG DebugTraceLevel; #else /* NASSERT */ #define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); } #endif /* NASSERT */ - +#endif #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) #else /* DBG */ @@ -60,7 +62,7 @@ extern ULONG DebugTraceLevel; #define NDIS_DbgPrint(_t_, _x_) #define ASSERT_IRQL(x) -#define ASSERT(x) +/* #define ASSERT(x) */ /* rtl.h */ #endif /* DBG */ diff --git a/reactos/drivers/net/ndis/include/debug.h b/reactos/drivers/net/ndis/include/debug.h index fbe3f8865f9..c60e136ad93 100644 --- a/reactos/drivers/net/ndis/include/debug.h +++ b/reactos/drivers/net/ndis/include/debug.h @@ -46,6 +46,8 @@ extern DWORD DebugTraceLevel; #endif /* _MSC_VER */ +/* ASSERT is in rtl.h */ +#if 0 #ifdef ASSERT #undef ASSERT #endif @@ -55,7 +57,7 @@ extern DWORD DebugTraceLevel; #else /* NASSERT */ #define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); } #endif /* NASSERT */ - +#endif #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) #else /* DBG */ @@ -63,7 +65,7 @@ extern DWORD DebugTraceLevel; #define NDIS_DbgPrint(_t_, _x_) #define ASSERT_IRQL(x) -#define ASSERT(x) +/*#define ASSERT(x)*/ #endif /* DBG */ diff --git a/reactos/drivers/net/ndis/include/protocol.h b/reactos/drivers/net/ndis/include/protocol.h index 583d1860522..a7da53ea64b 100644 --- a/reactos/drivers/net/ndis/include/protocol.h +++ b/reactos/drivers/net/ndis/include/protocol.h @@ -9,7 +9,9 @@ #define __PROTOCOL_H #include -#include +#include +#include "../include/miniport.h" +//#include typedef struct _PROTOCOL_BINDING { diff --git a/reactos/drivers/net/ndis/ndis.def b/reactos/drivers/net/ndis/ndis.def index 28a6d4c9bf6..a8c3a223d23 100644 --- a/reactos/drivers/net/ndis/ndis.def +++ b/reactos/drivers/net/ndis/ndis.def @@ -171,6 +171,7 @@ NdisInterlockedInsertTailList@12 NdisInterlockedPopEntrySList@8 NdisInterlockedPushEntrySList@12 NdisInterlockedRemoveHeadList@8 +NdisInitializeListHead@4 NdisMAllocateMapRegisters@20 NdisMAllocateSharedMemory@20 NdisMAllocateSharedMemoryAsync@16 diff --git a/reactos/drivers/net/ndis/ndis.edf b/reactos/drivers/net/ndis/ndis.edf index d06915ccd1f..052e518a2ad 100644 --- a/reactos/drivers/net/ndis/ndis.edf +++ b/reactos/drivers/net/ndis/ndis.edf @@ -166,6 +166,7 @@ NdisInitUnicodeString=NdisInitUnicodeString@8 NdisInterlockedAddUlong=NdisInterlockedAddUlong@12 NdisInterlockedDecrement=NdisInterlockedDecrement@4 NdisInterlockedIncrement=NdisInterlockedIncrement@4 +NdisInitializeListHead=NdisInitializeListHead@4 NdisInterlockedInsertHeadList=NdisInterlockedInsertHeadList@12 NdisInterlockedInsertTailList=NdisInterlockedInsertTailList@12 NdisInterlockedPopEntrySList=NdisInterlockedPopEntrySList@8 diff --git a/reactos/drivers/net/ndis/ndis/buffer.c b/reactos/drivers/net/ndis/ndis/buffer.c index e2a0f7abda2..59f189c31e8 100644 --- a/reactos/drivers/net/ndis/ndis/buffer.c +++ b/reactos/drivers/net/ndis/ndis/buffer.c @@ -237,12 +237,10 @@ UINT CopyPacketToBufferChain( NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize); if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1) return 0; - /* Skip SrcOffset bytes in the source packet */ NdisGetFirstBufferFromPacket(SrcPacket, &SrcBuffer, (PVOID)&SrcData, &SrcSize, &Total); if (SkipToOffset(SrcBuffer, SrcOffset, &SrcData, &SrcSize) == -1) return 0; - /* Copy the data */ for (Total = 0;;) { /* Find out how many bytes we can copy at one time */ diff --git a/reactos/drivers/net/ndis/ndis/memory.c b/reactos/drivers/net/ndis/ndis/memory.c index 0b48f71387b..fce0d3745ec 100644 --- a/reactos/drivers/net/ndis/ndis/memory.c +++ b/reactos/drivers/net/ndis/ndis/memory.c @@ -20,15 +20,24 @@ NdisAllocateMemoryWithTag( IN UINT Length, IN ULONG Tag) /* - * FUNCTION: + * FUNCTION: Allocates a block of memory, with a 32-bit tag * ARGUMENTS: + * VirtualAddress = a pointer to the returned memory block + * Length = the number of requested bytes + * Tag = 32-bit pool tag * NOTES: * NDIS 5.0 */ { - UNIMPLEMENTED + PVOID Block; - return NDIS_STATUS_FAILURE; + /* Plain nonpaged memory with tag */ + Block = ExAllocatePoolWithTag(NonPagedPool, Length, Tag); + *VirtualAddress = Block; + if (!Block) + return NDIS_STATUS_FAILURE; + + return NDIS_STATUS_SUCCESS; } diff --git a/reactos/drivers/net/ndis/ndis/string.c b/reactos/drivers/net/ndis/ndis/string.c index 55ff25103fa..6689799a379 100644 --- a/reactos/drivers/net/ndis/ndis/string.c +++ b/reactos/drivers/net/ndis/ndis/string.c @@ -17,7 +17,7 @@ NDIS_STATUS EXPORT NdisAnsiStringToUnicodeString( IN OUT PNDIS_STRING DestinationString, - IN PNDIS_ANSI_STRING SourceString) + IN PANSI_STRING SourceString) /* * FUNCTION: Converts an ANSI string to an NDIS (unicode) string * ARGUMENTS: @@ -61,7 +61,7 @@ NdisEqualString( VOID EXPORT NdisInitAnsiString( - IN OUT PNDIS_ANSI_STRING DestinationString, + IN OUT PANSI_STRING DestinationString, IN PCSTR SourceString) /* * FUNCTION: Initializes an ANSI string @@ -131,7 +131,7 @@ NdisInitUnicodeString( NDIS_STATUS EXPORT NdisUnicodeStringToAnsiString( - IN OUT PNDIS_ANSI_STRING DestinationString, + IN OUT PANSI_STRING DestinationString, IN PNDIS_STRING SourceString) /* * FUNCTION: Converts an NDIS (unicode) string to an ANSI string diff --git a/reactos/drivers/net/ndis/ndis/stubs.c b/reactos/drivers/net/ndis/ndis/stubs.c index a5200e270b2..5e5f3744ca3 100644 --- a/reactos/drivers/net/ndis/ndis/stubs.c +++ b/reactos/drivers/net/ndis/ndis/stubs.c @@ -51,15 +51,12 @@ NdisCompleteUnbindAdapter( } -/* - * @unimplemented - */ VOID EXPORT NdisInitializeListHead( IN PLIST_ENTRY ListHead) { - UNIMPLEMENTED + InitializeListHead(ListHead); } diff --git a/reactos/drivers/net/ndis/ndis/time.c b/reactos/drivers/net/ndis/ndis/time.c index 2c96191ff51..18c5e7fc16f 100644 --- a/reactos/drivers/net/ndis/ndis/time.c +++ b/reactos/drivers/net/ndis/ndis/time.c @@ -44,7 +44,7 @@ NdisCancelTimer( VOID EXPORT NdisGetCurrentSystemTime ( - IN OUT PLONGLONG pSystemTime) + IN OUT PLARGE_INTEGER pSystemTime) { KeQuerySystemTime (pSystemTime); } @@ -62,7 +62,7 @@ NdisInitializeTimer( { KeInitializeTimer (&Timer->Timer); - KeInitializeDpc (&Timer->Dpc, TimerFunction, FunctionContext); + KeInitializeDpc (&Timer->Dpc, (PKDEFERRED_ROUTINE)TimerFunction, FunctionContext); } diff --git a/reactos/drivers/net/npf/bucket_lookup.c b/reactos/drivers/net/npf/bucket_lookup.c index e2c5fde7461..26717b6c294 100644 --- a/reactos/drivers/net/npf/bucket_lookup.c +++ b/reactos/drivers/net/npf/bucket_lookup.c @@ -248,4 +248,5 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct return TME_TRUE; } -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/npf/bucket_lookup.h b/reactos/drivers/net/npf/bucket_lookup.h index 512d6370c0e..e4caf2af44a 100644 --- a/reactos/drivers/net/npf/bucket_lookup.h +++ b/reactos/drivers/net/npf/bucket_lookup.h @@ -40,4 +40,5 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct #define BUCKET_LOOKUP 0x00000010 uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/npf/dump.c b/reactos/drivers/net/npf/dump.c index 1f1b7545a5f..a567c831149 100644 --- a/reactos/drivers/net/npf/dump.c +++ b/reactos/drivers/net/npf/dump.c @@ -28,8 +28,10 @@ #include #include //#define PsGetCurrentProcess() IoGetCurrentProcess() +#ifndef PsGetCurrentThread #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread())) #endif +#endif #include "debug.h" #include "packet.h" diff --git a/reactos/drivers/net/npf/functions.h b/reactos/drivers/net/npf/functions.h index d25c6799939..0ba2bfa6ac8 100644 --- a/reactos/drivers/net/npf/functions.h +++ b/reactos/drivers/net/npf/functions.h @@ -64,4 +64,5 @@ exec_fcn exec_fcn_mapper(uint32 index); #include #endif -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/npf/normal_lookup.h b/reactos/drivers/net/npf/normal_lookup.h index 69e21ce036e..c89194feb25 100644 --- a/reactos/drivers/net/npf/normal_lookup.h +++ b/reactos/drivers/net/npf/normal_lookup.h @@ -42,4 +42,5 @@ uint32 normal_lut_w_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); #define DUMMY_INSERT 1234 -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/npf/packet.c b/reactos/drivers/net/npf/packet.c index 17acc0b798a..815ae7185fe 100644 --- a/reactos/drivers/net/npf/packet.c +++ b/reactos/drivers/net/npf/packet.c @@ -96,7 +96,7 @@ DriverEntry( UNICODE_STRING UnicodeDeviceName; PDEVICE_OBJECT DeviceObject = NULL; PDEVICE_EXTENSION DeviceExtension = NULL; - NTSTATUS Status = STATUS_SUCCESS; + NDIS_STATUS Status = NDIS_STATUS_SUCCESS; NTSTATUS ErrorCode = STATUS_SUCCESS; NDIS_STRING ProtoName = NDIS_STRING_CONST("PacketDriver"); ULONG DevicesCreated=0; @@ -173,11 +173,11 @@ DriverEntry( NdisAllocateSpinLock(&Opened_Instances_Lock); // Set up the device driver entry points. - DriverObject->MajorFunction[IRP_MJ_CREATE] = NPF_Open; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = NPF_Close; - DriverObject->MajorFunction[IRP_MJ_READ] = NPF_Read; - DriverObject->MajorFunction[IRP_MJ_WRITE] = NPF_Write; - DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NPF_IoControl; + DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)NPF_Open; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)NPF_Close; + DriverObject->MajorFunction[IRP_MJ_READ] = (PDRIVER_DISPATCH)NPF_Read; + DriverObject->MajorFunction[IRP_MJ_WRITE] = (PDRIVER_DISPATCH)NPF_Write; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)NPF_IoControl; DriverObject->DriverUnload = NPF_Unload; /* diff --git a/reactos/drivers/net/npf/tcp_session.c b/reactos/drivers/net/npf/tcp_session.c index 4eb6410d7ae..37420644143 100644 --- a/reactos/drivers/net/npf/tcp_session.c +++ b/reactos/drivers/net/npf/tcp_session.c @@ -280,4 +280,5 @@ uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ session->timestamp_block=session->last_timestamp; return TME_SUCCESS; -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/npf/tcp_session.h b/reactos/drivers/net/npf/tcp_session.h index 6262e79a1fb..4faf7b71f12 100644 --- a/reactos/drivers/net/npf/tcp_session.h +++ b/reactos/drivers/net/npf/tcp_session.h @@ -82,4 +82,5 @@ typedef struct __tcp_data #define TCP_SESSION 0x00000800 uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/npf/tme.c b/reactos/drivers/net/npf/tme.c index 87ed7dcad5a..1bb5e8e92f8 100644 --- a/reactos/drivers/net/npf/tme.c +++ b/reactos/drivers/net/npf/tme.c @@ -375,4 +375,5 @@ uint32 set_autodeletion(TME_DATA *data, uint32 value) data->enable_deletion=TRUE; return TME_SUCCESS; -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/npf/tme.h b/reactos/drivers/net/npf/tme.h index 4140f9ff9d2..a9c3645d13e 100644 --- a/reactos/drivers/net/npf/tme.h +++ b/reactos/drivers/net/npf/tme.h @@ -179,4 +179,5 @@ uint32 set_autodeletion(TME_DATA *data, uint32 value); lut_fcn lut_fcn_mapper(uint32 index); exec_fcn exec_fcn_mapper(uint32 index); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/npf/win_bpf_filter.c b/reactos/drivers/net/npf/win_bpf_filter.c index 76dee6ee88b..39b108d0dd9 100644 --- a/reactos/drivers/net/npf/win_bpf_filter.c +++ b/reactos/drivers/net/npf/win_bpf_filter.c @@ -958,4 +958,5 @@ bpf_validate(f, len,mem_ex_size) return 0; } return BPF_CLASS(f[len - 1].code) == BPF_RET; -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/npf/win_bpf_filter_init.h b/reactos/drivers/net/npf/win_bpf_filter_init.h index 8b06af7a9ee..24561c72117 100644 --- a/reactos/drivers/net/npf/win_bpf_filter_init.h +++ b/reactos/drivers/net/npf/win_bpf_filter_init.h @@ -28,4 +28,5 @@ uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/packet/bucket_lookup.c b/reactos/drivers/net/packet/bucket_lookup.c index e2c5fde7461..26717b6c294 100644 --- a/reactos/drivers/net/packet/bucket_lookup.c +++ b/reactos/drivers/net/packet/bucket_lookup.c @@ -248,4 +248,5 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct return TME_TRUE; } -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/packet/bucket_lookup.h b/reactos/drivers/net/packet/bucket_lookup.h index 512d6370c0e..e4caf2af44a 100644 --- a/reactos/drivers/net/packet/bucket_lookup.h +++ b/reactos/drivers/net/packet/bucket_lookup.h @@ -40,4 +40,5 @@ uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct #define BUCKET_LOOKUP 0x00000010 uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/packet/dump.c b/reactos/drivers/net/packet/dump.c index 99f916b3d82..988f56191db 100644 --- a/reactos/drivers/net/packet/dump.c +++ b/reactos/drivers/net/packet/dump.c @@ -28,8 +28,10 @@ #include #include //#define PsGetCurrentProcess() IoGetCurrentProcess() +#ifndef PsGetCurrentThread #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread())) #endif +#endif #include "debug.h" #include "packet.h" @@ -248,7 +250,7 @@ NPF_StartDump(POPEN_INSTANCE Open) THREAD_ALL_ACCESS, NULL, KernelMode, - &Open->DumpThreadObject, + (VOID **)&Open->DumpThreadObject, 0); if ( !NT_SUCCESS( ntStatus ) ) { diff --git a/reactos/drivers/net/packet/functions.c b/reactos/drivers/net/packet/functions.c index 04c7e4b7586..b6d4aa3ddd3 100644 --- a/reactos/drivers/net/packet/functions.c +++ b/reactos/drivers/net/packet/functions.c @@ -80,3 +80,4 @@ exec_fcn exec_fcn_mapper(uint32 index) return NULL; } + diff --git a/reactos/drivers/net/packet/functions.h b/reactos/drivers/net/packet/functions.h index d25c6799939..0ba2bfa6ac8 100644 --- a/reactos/drivers/net/packet/functions.h +++ b/reactos/drivers/net/packet/functions.h @@ -64,4 +64,5 @@ exec_fcn exec_fcn_mapper(uint32 index); #include #endif -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/packet/normal_lookup.c b/reactos/drivers/net/packet/normal_lookup.c index ea6442f91fe..4b5ecf6dc3c 100644 --- a/reactos/drivers/net/packet/normal_lookup.c +++ b/reactos/drivers/net/packet/normal_lookup.c @@ -189,3 +189,4 @@ uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct return TME_FALSE; } + diff --git a/reactos/drivers/net/packet/normal_lookup.h b/reactos/drivers/net/packet/normal_lookup.h index 69e21ce036e..c89194feb25 100644 --- a/reactos/drivers/net/packet/normal_lookup.h +++ b/reactos/drivers/net/packet/normal_lookup.h @@ -42,4 +42,5 @@ uint32 normal_lut_w_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); #define DUMMY_INSERT 1234 -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/packet/packet.c b/reactos/drivers/net/packet/packet.c index dc063f58e41..29b03653079 100644 --- a/reactos/drivers/net/packet/packet.c +++ b/reactos/drivers/net/packet/packet.c @@ -96,7 +96,7 @@ DriverEntry( UNICODE_STRING UnicodeDeviceName; PDEVICE_OBJECT DeviceObject = NULL; PDEVICE_EXTENSION DeviceExtension = NULL; - NTSTATUS Status = STATUS_SUCCESS; + NDIS_STATUS Status = NDIS_STATUS_SUCCESS; NTSTATUS ErrorCode = STATUS_SUCCESS; NDIS_STRING ProtoName = NDIS_STRING_CONST("PacketDriver"); ULONG DevicesCreated=0; @@ -594,6 +594,7 @@ BOOLEAN createDevice(IN OUT PDRIVER_OBJECT adriverObjectP, //------------------------------------------------------------------- VOID +STDCALL_FUNC NPF_Unload(IN PDRIVER_OBJECT DriverObject) { PDEVICE_OBJECT DeviceObject; diff --git a/reactos/drivers/net/packet/packet.h b/reactos/drivers/net/packet/packet.h index a3582cca826..10e484f2f77 100644 --- a/reactos/drivers/net/packet/packet.h +++ b/reactos/drivers/net/packet/packet.h @@ -120,14 +120,14 @@ 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 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 @@ -713,6 +713,7 @@ NPF_StatusComplete(IN NDIS_HANDLE ProtocolBindingContext); service (from control panel or with a console 'net stop npf'). */ VOID +STDCALL_FUNC NPF_Unload(IN PDRIVER_OBJECT DriverObject); diff --git a/reactos/drivers/net/packet/tcp_session.c b/reactos/drivers/net/packet/tcp_session.c index 4eb6410d7ae..37420644143 100644 --- a/reactos/drivers/net/packet/tcp_session.c +++ b/reactos/drivers/net/packet/tcp_session.c @@ -280,4 +280,5 @@ uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ session->timestamp_block=session->last_timestamp; return TME_SUCCESS; -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/packet/tcp_session.h b/reactos/drivers/net/packet/tcp_session.h index 6262e79a1fb..4faf7b71f12 100644 --- a/reactos/drivers/net/packet/tcp_session.h +++ b/reactos/drivers/net/packet/tcp_session.h @@ -82,4 +82,5 @@ typedef struct __tcp_data #define TCP_SESSION 0x00000800 uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/packet/tme.h b/reactos/drivers/net/packet/tme.h index 4140f9ff9d2..a9c3645d13e 100644 --- a/reactos/drivers/net/packet/tme.h +++ b/reactos/drivers/net/packet/tme.h @@ -179,4 +179,5 @@ uint32 set_autodeletion(TME_DATA *data, uint32 value); lut_fcn lut_fcn_mapper(uint32 index); exec_fcn exec_fcn_mapper(uint32 index); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/packet/win_bpf_filter.c b/reactos/drivers/net/packet/win_bpf_filter.c index 76dee6ee88b..39b108d0dd9 100644 --- a/reactos/drivers/net/packet/win_bpf_filter.c +++ b/reactos/drivers/net/packet/win_bpf_filter.c @@ -958,4 +958,5 @@ bpf_validate(f, len,mem_ex_size) return 0; } return BPF_CLASS(f[len - 1].code) == BPF_RET; -} \ No newline at end of file +} + diff --git a/reactos/drivers/net/packet/win_bpf_filter_init.h b/reactos/drivers/net/packet/win_bpf_filter_init.h index 8b06af7a9ee..24561c72117 100644 --- a/reactos/drivers/net/packet/win_bpf_filter_init.h +++ b/reactos/drivers/net/packet/win_bpf_filter_init.h @@ -28,4 +28,5 @@ uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref); -#endif \ No newline at end of file +#endif + diff --git a/reactos/drivers/net/tcpip/tcpip/main.c b/reactos/drivers/net/tcpip/tcpip/main.c index dde71b9adcc..fb11c743337 100644 --- a/reactos/drivers/net/tcpip/tcpip/main.c +++ b/reactos/drivers/net/tcpip/tcpip/main.c @@ -400,12 +400,12 @@ NTSTATUS TiCleanupFileObject( NTSTATUS -#ifndef _MSC_VER -STDCALL -#endif +//#ifndef _MSC_VER +STDCALL_FUNC +//#endif TiDispatchOpenClose( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) /* * FUNCTION: Main dispath routine * ARGUMENTS: @@ -872,11 +872,11 @@ DriverEntry( TCPDeviceObject->Flags |= DO_DIRECT_IO; /* Initialize the driver object with this driver's entry points */ - DriverObject->MajorFunction[IRP_MJ_CREATE] = TiDispatchOpenClose; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = TiDispatchOpenClose; - DriverObject->MajorFunction[IRP_MJ_CLEANUP] = TiDispatchOpenClose; - DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = TiDispatchInternal; - DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = TiDispatch; + DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)TiDispatchOpenClose; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)TiDispatchOpenClose; + DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (PDRIVER_DISPATCH)TiDispatchOpenClose; + DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = (PDRIVER_DISPATCH)TiDispatchInternal; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)TiDispatch; DriverObject->DriverUnload = (PDRIVER_UNLOAD)TiUnload; diff --git a/reactos/drivers/net/tcpip/tcpip/routines.c b/reactos/drivers/net/tcpip/tcpip/routines.c index edbb2971453..f49daf7ff7f 100644 --- a/reactos/drivers/net/tcpip/tcpip/routines.c +++ b/reactos/drivers/net/tcpip/tcpip/routines.c @@ -137,7 +137,7 @@ __inline INT SkipToOffset( if (!Buffer) return -1; - NdisQueryBuffer(Buffer, Data, Size); + NdisQueryBuffer(Buffer, (PVOID)Data, Size); if (Offset < *Size) { ((ULONG_PTR)*Data) += Offset; @@ -203,7 +203,7 @@ UINT CopyBufferToBufferChain( if (!DstBuffer) break; - NdisQueryBuffer(DstBuffer, &DstData, &DstSize); + NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize); } } @@ -262,7 +262,7 @@ UINT CopyBufferChainToBuffer( if (!SrcBuffer) 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)); /* Skip DstOffset bytes in the destination buffer chain */ - NdisQueryBuffer(DstBuffer, &DstData, &DstSize); + NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize); if (SkipToOffset(DstBuffer, DstOffset, &DstData, &DstSize) == -1) return 0; /* 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) return 0; @@ -369,7 +369,7 @@ UINT CopyPacketToBufferChain( if (!DstBuffer) break; - NdisQueryBuffer(DstBuffer, &DstData, &DstSize); + NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize); } SrcSize -= Count; @@ -380,7 +380,7 @@ UINT CopyPacketToBufferChain( if (!SrcBuffer) break; - NdisQueryBuffer(SrcBuffer, &SrcData, &SrcSize); + NdisQueryBuffer(SrcBuffer, (PVOID)&SrcData, &SrcSize); } } diff --git a/reactos/drivers/net/tcpip/transport/tcp/tcp_output.c b/reactos/drivers/net/tcpip/transport/tcp/tcp_output.c index c20b019e1cd..c85c2aca940 100755 --- a/reactos/drivers/net/tcpip/transport/tcp/tcp_output.c +++ b/reactos/drivers/net/tcpip/transport/tcp/tcp_output.c @@ -15,7 +15,7 @@ * * 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, * Fred N. van Kempen, @@ -1418,7 +1418,7 @@ void tcp_send_ack(struct sock *sk) tcp_transmit_skb(sk, buff); } #else - return 0; + return; #endif } diff --git a/reactos/drivers/net/tditest/include/debug.h b/reactos/drivers/net/tditest/include/debug.h index ee80cc3bc14..067baef4cc0 100644 --- a/reactos/drivers/net/tditest/include/debug.h +++ b/reactos/drivers/net/tditest/include/debug.h @@ -41,6 +41,8 @@ extern DWORD DebugTraceLevel; #endif /* _MSC_VER */ +/* in rtl.h now */ +#if 0 #ifdef ASSERT #undef ASSERT #endif @@ -50,7 +52,7 @@ extern DWORD DebugTraceLevel; #else /* NASSERT */ #define ASSERT(x) if (!(x)) { TDI_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); } #endif /* NASSERT */ - +#endif #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) #else /* DBG */ diff --git a/reactos/drivers/net/wshtcpip/debug.h b/reactos/drivers/net/wshtcpip/debug.h index ec9e995b2b0..c4f80df9006 100644 --- a/reactos/drivers/net/wshtcpip/debug.h +++ b/reactos/drivers/net/wshtcpip/debug.h @@ -28,6 +28,8 @@ extern DWORD DebugTraceLevel; DbgPrint _x_; \ } +/* this belongs in rtl */ +#if 0 #ifdef ASSERT #undef ASSERT #endif @@ -37,12 +39,13 @@ extern DWORD DebugTraceLevel; #else /* NASSERT */ #define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); } #endif /* NASSERT */ +#endif #else /* DBG */ #define WSH_DbgPrint(_t_, _x_) -#define ASSERT(x) +/*#define ASSERT(x)*/ #endif /* DBG */ diff --git a/reactos/include/ddk/psfuncs.h b/reactos/include/ddk/psfuncs.h index 51b362174f7..52e6a5c2a85 100644 --- a/reactos/include/ddk/psfuncs.h +++ b/reactos/include/ddk/psfuncs.h @@ -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 #define _INCLUDE_DDK_PSFUNCS_H @@ -31,7 +31,7 @@ NTSTATUS STDCALL PsCreateSystemThread(PHANDLE ThreadHandle, HANDLE ProcessHandle, PCLIENT_ID ClientId, PKSTART_ROUTINE StartRoutine, - PVOID StartContext); + void *StartContext); NTSTATUS STDCALL PsTerminateSystemThread(NTSTATUS ExitStatus); NTSTATUS STDCALL PsCreateSystemProcess(PHANDLE ProcessHandle, diff --git a/reactos/include/net/miniport.h b/reactos/include/net/miniport.h index 533a8ff710b..68622921ba6 100644 --- a/reactos/include/net/miniport.h +++ b/reactos/include/net/miniport.h @@ -4,6 +4,7 @@ * FILE: include/net/miniport.h * PURPOSE: Type definitions available only to NDIS miniport drivers */ +#if 0 #ifndef __MINIPORT_H #define __MINIPORT_H @@ -847,3 +848,4 @@ WRITE_REGISTER_USHORT( #endif /* __MINIPORT_H */ /* EOF */ +#endif diff --git a/reactos/include/net/ndis.h b/reactos/include/net/ndis.h index b88a48a82dc..6dd62be49b8 100644 --- a/reactos/include/net/ndis.h +++ b/reactos/include/net/ndis.h @@ -6,11 +6,24 @@ * DEFINES: i386 - Target platform is i386 * NDIS_WRAPPER - Define only for NDIS wrapper library * 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 * 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 #define __NDIS_H @@ -24,16 +37,6 @@ extern "C" #define NDIS40 #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 #define UNALIGNED #endif @@ -42,13 +45,13 @@ extern "C" #define FASTCALL __attribute__((fastcall)) #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 _MSC_VER #define EXPIMP __declspec(dllexport) #else -#define EXPIMP STDCALL +#define EXPIMP STDCALL /* MS ndis.h is 100% stdcall due to compiler flag /Gz */ #endif #else /* NDIS_WRAPPER */ @@ -61,23 +64,39 @@ extern "C" #endif /* NDIS_WRAPPER */ - - -#ifdef NDIS_MINIPORT_DRIVER - -#include "miniport.h" - -#else /* NDIS_MINIPORT_DRIVER */ - -#ifdef _MSC_VER +/* support NDIS_WDM and MAC drivers */ +#if defined (NDIS_WDM) +#include +#else #include +#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 */ -#include +#define ASSERT( exp ) if (!(exp)) RtlAssert( #exp, __FILE__, __LINE__, NULL ) +#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 { @@ -182,34 +201,35 @@ typedef struct _CM_EISA_FUNCTION_INFORMATION UCHAR InitializationData[60]; } 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 "ndisoid.h" #include "ntddndis.h" -#if defined(NDIS_MINIPORT_DRIVER) || !defined(_MSC_VER) - +#if !defined(_MSC_VER) #ifndef _GUID_DEFINED #define _GUID_DEFINED - typedef struct _GUID { ULONG Data1; USHORT Data2; USHORT Data3; UCHAR Data4[8]; } GUID; - #endif /* _GUID_DEFINED */ - -#endif /* NDIS_MINIPORT_DRIVER || _MSC_VER */ +#endif /* _MSC_VER */ /* NDIS base types */ @@ -230,8 +250,6 @@ typedef int NDIS_STATUS, *PNDIS_STATUS; typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING; -typedef PCSTR NDIS_ANSI_STRING, *PNDIS_ANSI_STRING; - typedef MDL NDIS_BUFFER, *PNDIS_BUFFER; /* NDIS_STATUS constants */ @@ -338,11 +356,12 @@ typedef MDL NDIS_BUFFER, *PNDIS_BUFFER; #define NDIS_MEMORY_NONCACHED 0x00000002 /* NIC attribute flags. Used by NdisMSetAttributes(Ex) */ -#define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001 +#define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001 #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010 +#define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020 @@ -395,6 +414,18 @@ typedef struct _NDIS_TIMER KDPC Dpc; } 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 */ @@ -615,6 +646,14 @@ typedef struct _NDIS_REQUEST { UINT BytesNeeded; } SET_INFORMATION; } DATA; +#ifdef NDIS50 + UCHAR NdisReserved[36]; + union { + UCHAR CallMgrReserved[8]; + UCHAR ProtocolReserved[8]; + }; + UCHAR MiniportReserved[8]; +#endif } NDIS_REQUEST, *PNDIS_REQUEST; @@ -739,8 +778,6 @@ typedef enum _NDIS_PNP_DEVICE_STATE #endif /* NDIS_WRAPPER */ -#ifdef NDIS50 - typedef struct _ATM_ADDRESS ATM_ADDRESS, *PATM_ADDRESS; @@ -1174,8 +1211,6 @@ typedef struct _NDIS_CLIENT_CHARACTERISTICS CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler; } NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS; -#endif /* NDIS50 */ - /* NDIS protocol structures */ @@ -1565,100 +1600,31 @@ NdisUnchainBufferAtFront( IN OUT PNDIS_PACKET Packet, OUT PNDIS_BUFFER *Buffer); -#if BINARY_COMPATIBLE - -VOID -EXPIMP -NdisAdjustBufferLength( - IN PNDIS_BUFFER Buffer, - IN UINT Length); - -ULONG -EXPIMP -NDIS_BUFFER_TO_SPAN_PAGES( - IN PNDIS_BUFFER Buffer); - -VOID -EXPIMP -NdisFreeBuffer( - IN PNDIS_BUFFER Buffer); - -VOID -EXPIMP -NdisGetBufferPhysicalArraySize( - IN PNDIS_BUFFER Buffer, - OUT PUINT ArraySize); - -VOID -EXPIMP -NdisGetFirstBufferFromPacket( - IN PNDIS_PACKET _Packet, - OUT PNDIS_BUFFER *_FirstBuffer, - OUT PVOID *_FirstBufferVA, - OUT PUINT _FirstBufferLength, - OUT PUINT _TotalBufferLength); - -VOID -EXPIMP -NdisQueryBuffer( - IN PNDIS_BUFFER Buffer, - OUT PVOID *VirtualAddress OPTIONAL, - OUT PUINT Length); - -VOID -EXPIMP -NdisQueryBufferOffset( - IN PNDIS_BUFFER Buffer, - OUT PUINT Offset, - OUT PUINT Length); - -#else /* BINARY_COMPATIBLE */ - /* * PVOID NdisAdjustBufferLength( * IN PNDIS_BUFFER Buffer, * IN UINT Length); */ -#define NdisAdjustBufferLength(Buffer, \ - Length) \ -{ \ - (Buffer)->ByteCount = (Length); \ -} - +VOID +EXPIMP +NdisAdjustBufferLength( + IN PNDIS_BUFFER Buffer, + IN UINT 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 +ULONG +EXPIMP +NDIS_BUFFER_TO_SPAN_PAGES( + IN PNDIS_BUFFER Buffer); VOID EXPIMP NdisFreeBuffer( IN PNDIS_BUFFER Buffer); -#endif /* @@ -1666,11 +1632,11 @@ NdisFreeBuffer( * IN PNDIS_BUFFER Buffer, * OUT PUINT ArraySize); */ -#define NdisGetBufferPhysicalArraySize(Buffer, \ - ArraySize) \ -{ \ -} - +VOID +EXPIMP +NdisGetBufferPhysicalArraySize( + IN PNDIS_BUFFER Buffer, + OUT PUINT ArraySize); /* * VOID NdisGetFirstBufferFromPacket( @@ -1680,62 +1646,28 @@ NdisFreeBuffer( * 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 +EXPIMP +NdisGetFirstBufferFromPacket( + IN PNDIS_PACKET _Packet, + OUT PNDIS_BUFFER * _FirstBuffer, + OUT PVOID * _FirstBufferVA, + OUT PUINT _FirstBufferLength, + OUT PUINT _TotalBufferLength); -/* - * 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 */ +VOID +EXPIMP +NdisQueryBuffer( + IN PNDIS_BUFFER Buffer, + OUT PVOID *VirtualAddress OPTIONAL, + OUT PUINT Length); +VOID +EXPIMP +NdisQueryBufferOffset( + IN PNDIS_BUFFER Buffer, + OUT PUINT Offset, + OUT PUINT Length); /* * PVOID NDIS_BUFFER_LINKAGE( @@ -1805,7 +1737,6 @@ NdisFreeBuffer( *(NextBuffer) = (CurrentBuffer)->Next; \ } - /* * UINT NdisGetPacketFlags( * IN PNDIS_PACKET Packet); @@ -2321,49 +2252,16 @@ NdisImmediateWritePciSlotInformation( /* 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( * IN OUT PNDIS_STRING DestinationString, * IN PNDIS_ANSI_STRING SourceString); */ -#define NdisAnsiStringToUnicodeString(DestinationString, \ - SourceString) \ - RtlAnsiStringToUnicodeString((DestinationString), (SourceString), FALSE) +NDIS_STATUS +EXPIMP +NdisAnsiStringToUnicodeString( + IN OUT PNDIS_STRING DestinationString, + IN PANSI_STRING SourceString); /* * BOOLEAN NdisEqualString( @@ -2371,39 +2269,45 @@ NdisUnicodeStringToAnsiString( * IN PNDIS_STRING String2, * IN BOOLEAN CaseInsensitive) */ -#define NdisEqualString(String1, \ - String2, \ - CaseInsensitive) \ - RtlEqualUnicodeString((String1), (String2), (CaseInsensitive)) +BOOLEAN +EXPIMP +NdisEqualString( + IN PNDIS_STRING String1, + IN PNDIS_STRING String2, + IN BOOLEAN CaseInsensitive); /* * VOID NdisInitAnsiString( * IN OUT PNDIS_ANSI_STRING DestinationString, * IN PCSTR SourceString) */ -#define NdisInitAnsiString(DestinationString, \ - SourceString) \ - RtlInitString((DestinationString), (SourceString)) +VOID +EXPIMP +NdisInitAnsiString( + IN OUT PANSI_STRING DestinationString, + IN PCSTR SourceString); /* * VOID NdisInitUnicodeString( * IN OUT PNDIS_STRING DestinationString, * IN PCWSTR SourceString) */ -#define NdisInitUnicodeString(DestinationString, \ - SourceString) \ - RtlInitUnicodeString((DestinationString), (SourceString)) +VOID +EXPIMP +NdisInitUnicodeString( + IN OUT PNDIS_STRING DestinationString, + IN PCWSTR SourceString); /* * NDIS_STATUS NdisUnicodeStringToAnsiString( * IN OUT PNDIS_ANSI_STRING DestinationString, * IN PNDIS_STRING SourceString) */ -#define NdisUnicodeStringToAnsiString(DestinationString, \ - SourceString) \ - RtlUnicodeStringToAnsiString((DestinationString), (SourceString), FALSE) - -#endif /* BINARY_COMPATIBLE */ +NDIS_STATUS +EXPIMP +NdisUnicodeStringToAnsiString( + IN OUT PANSI_STRING DestinationString, + IN PNDIS_STRING SourceString); #define NdisFreeString(_s) NdisFreeMemory((s).Buffer, (s).MaximumLength, 0) #define NdisPrintString(_s) DbgPrint("%ls", (s).Buffer) @@ -2833,14 +2737,10 @@ NdisDprReleaseSpinLock( VOID EXPIMP NdisGetCurrentSystemTime( - PLONGLONG pSystemTime + PLARGE_INTEGER pSystemTime ); -/* NDIS 5.0 extensions */ - -#ifdef NDIS50 - VOID EXPIMP NdisAcquireReadWriteLock( @@ -3446,7 +3346,7 @@ NdisIMInitializeDeviceInstanceEx( IN PNDIS_STRING DriverInstance, IN NDIS_HANDLE DeviceContext OPTIONAL); -#endif /* NDIS50 */ +//#endif /* NDIS50 */ @@ -5433,8 +5333,6 @@ NdisUpdateSharedMemory( /* Routines for NDIS protocol drivers */ -#if BINARY_COMPATIBLE - VOID EXPIMP NdisRequest( @@ -5465,47 +5363,14 @@ NdisSendPackets( VOID EXPIMP NdisTransferData( - OUT PNDIS_STATUS Status, - IN NDIS_HANDLE NdisBindingHandle, - IN NDIS_HANDLE MacReceiveContext, - IN UINT ByteOffset, - IN UINT BytesToTransfer, - IN OUT PNDIS_PACKET Packet, - 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)); \ -} - + OUT PNDIS_STATUS Status, + IN NDIS_HANDLE NdisBindingHandle, + IN NDIS_HANDLE MacReceiveContext, + IN UINT ByteOffset, + IN UINT BytesToTransfer, + IN OUT PNDIS_PACKET Packet, + OUT PUINT BytesTransferred); +/* #define NdisTransferData(Status, \ NdisBindingHandle, \ MacReceiveContext, \ @@ -5522,8 +5387,7 @@ NdisTransferData( (Packet), \ (BytesTransferred)); \ } - -#endif /* BINARY_COMPATIBLE */ +*/ VOID @@ -5605,3 +5469,127 @@ NdisReturnPackets( #endif /* __NDIS_H */ /* 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 diff --git a/reactos/include/net/ndisoid.h b/reactos/include/net/ndisoid.h index 121475c4574..6166b2544a1 100644 --- a/reactos/include/net/ndisoid.h +++ b/reactos/include/net/ndisoid.h @@ -407,4 +407,14 @@ typedef struct _NET_PNP_TRANSLATE_LIST #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 */ diff --git a/reactos/lib/iphlpapi/debug.h b/reactos/lib/iphlpapi/debug.h index 13a623f8fb3..457916728a5 100644 --- a/reactos/lib/iphlpapi/debug.h +++ b/reactos/lib/iphlpapi/debug.h @@ -28,6 +28,7 @@ extern DWORD DebugTraceLevel; DbgPrint _x_; \ } +#if 0 #ifdef ASSERT #undef ASSERT #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); } #endif /* NASSERT */ +#endif + #else /* DBG */ #define WSH_DbgPrint(_t_, _x_) -#define ASSERT(x) +/*#define ASSERT(x)*/ #endif /* DBG */ diff --git a/reactos/ntoskrnl/dbg/profile.c b/reactos/ntoskrnl/dbg/profile.c index c0c5674d222..d431adacbab 100755 --- a/reactos/ntoskrnl/dbg/profile.c +++ b/reactos/ntoskrnl/dbg/profile.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * 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 * FILE: ntoskrnl/dbg/profile.c @@ -364,7 +364,7 @@ KdbProfilerAnalyzeSamples() return STATUS_SUCCESS; } -NTSTATUS STDCALL +VOID STDCALL_FUNC KdbProfilerThreadMain(PVOID Context) { for (;;) diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index 303edf0bb32..086f88f648c 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -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 * @@ -880,6 +880,8 @@ InitSessionManager(HANDLE Children[]) return(Status); } + PrintString("SM: loading well-known DLLs\n"); + /* Load the well known DLLs */ Status = SmLoadKnownDlls(); if (!NT_SUCCESS(Status)) @@ -888,6 +890,8 @@ InitSessionManager(HANDLE Children[]) /* Don't crash ReactOS if DLLs cannot be loaded */ } + PrintString("SM: creating system paging files\n"); + /* Create paging files */ Status = SmCreatePagingFiles(); if (!NT_SUCCESS(Status)) @@ -896,6 +900,8 @@ InitSessionManager(HANDLE Children[]) return(Status); } + PrintString("SM: initializing registry\n"); + /* Load remaining registry hives */ NtInitializeRegistry(FALSE); @@ -909,6 +915,8 @@ InitSessionManager(HANDLE Children[]) } #endif + PrintString("SM: loading subsystems\n"); + /* Load the subsystems */ Status = SmLoadSubsystems(); if (!NT_SUCCESS(Status)) @@ -917,6 +925,8 @@ InitSessionManager(HANDLE Children[]) return(Status); } + PrintString("SM: initializing csrss\n"); + /* Run csrss.exe */ RtlInitUnicodeStringFromLiteral(&UnicodeString, L"\\CsrssInitDone"); @@ -986,6 +996,8 @@ InitSessionManager(HANDLE Children[]) * Start the logon process (winlogon.exe) */ + PrintString("SM: starting winlogon\n"); + /* initialize executable path */ wcscpy(UnicodeBuffer, L"\\??\\"); wcscat(UnicodeBuffer, SharedUserData->NtSystemRoot);