Commit graph

60 commits

Author SHA1 Message Date
Art Yerkes 2c9bba03b5 tcpip: fix for udp socket close.
ws2_32: unstub WSAFDIsSet, small amount of work on select
msafd: select fixes
afd: major select overhaul
- 1 exit point for poll objects from the deviceext
- make sure to cancel the timer
- UpdatePollWithFCB now runs at DISPATCH_LEVEL in every case
- Added handle locks so we can signal and check handles properly

svn path=/trunk/; revision=11684
2004-11-17 05:17:22 +00:00
Casper Hornstrup 59f81f9539 2004-11-16 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/lib/ip/network/arp.c: Assert certain conditions.
	* drivers/lib/ip/network/loopback.c: Ditto.
	* drivers/lib/ip/network/neighbor.c: Ditto.
	* drivers/lib/ip/transport/tcp/tcp.c: Ditto.
	* drivers/net/tcpip/datalink/lan.c: Ditto.
	* drivers/net/tcpip/datalink/loopback.c: Ditto.
	* drivers/net/tcpip/include/debug.h (ASSERT_KM_POINTER): Define.
	* drivers/lib/ip/transport/tcp/if.c: Remove disabled code.
	* drivers/net/afd/afd/main.c (AfdDispatch): Print known unimplemented
	IOCTLs.
	* drivers/net/tcpip/include/precomp.h: Include roscfg.h.
	* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Pass the right
	connection object to TCPListen.
	* drivers/net/tcpip/tcpip/mocklock.c: Fix some assertions.

svn path=/trunk/; revision=11680
2004-11-16 18:07:58 +00:00
Art Yerkes 28bfa5fcdd Implemented non-blocking recv and recvfrom.
Fixed address pass-through in afd.
Fixed some address cruft in udp and datagram regarding incoming
datagrams.

svn path=/trunk/; revision=11671
2004-11-15 18:24:57 +00:00
Art Yerkes 323b7c4460 UDP working.
svn path=/trunk/; revision=11657
2004-11-14 19:45:16 +00:00
Art Yerkes 1eb22067d1 Small DBG related patches.
svn path=/trunk/; revision=11626
2004-11-12 09:27:02 +00:00
Art Yerkes dea7f87980 Prevent some deadlock scenarios by unlocking the FCB while calling into
tcpip.sys.

svn path=/trunk/; revision=11625
2004-11-12 07:34:56 +00:00
Gé van Geldorp 4221b60000 - Centralize definition of version resource
- Give DLLs a high version number, so installers won't overwrite them

svn path=/trunk/; revision=11297
2004-10-16 20:27:43 +00:00
Art Yerkes 8eb5ca6ffa Final propogation of TDI_CONNECTION_INFORMATION/TRANSPORT_ADDRESS changes.
svn path=/trunk/; revision=11175
2004-10-03 21:44:43 +00:00
Art Yerkes bab3b21d32 Propogating TDI address changes.
svn path=/trunk/; revision=11174
2004-10-03 21:16:31 +00:00
Art Yerkes a52618ca99 Fixed use of TA_ADDRESS in favor of TRANSPORT_ADDRESS. This still confuses
me.
write, read: Handle errors correctly.

svn path=/trunk/; revision=11170
2004-10-03 20:36:46 +00:00
Art Yerkes 2c75d67c33 Fix send function as well to properly deallocate the irp on failure on
MmProbeAndLockPages.

svn path=/trunk/; revision=11021
2004-09-24 00:51:31 +00:00
Art Yerkes e91d1416ab Write: print bytes returned so we can see it.
Read : notify ourselves that the buffer is empty and reset the pointers.
Tdi  : since the handler part is an inner function, don't return from it
       but instead set Status and return afterward.

svn path=/trunk/; revision=11015
2004-09-23 20:48:40 +00:00
Art Yerkes 51580f3182 Fixes: Lock does not need to acquire a spinlock in the non-passive-level
case because we can't contend with outselves in passive level.
Realized subtle bug in select.

Select needs a referenced file object rather than a handle.  Will change
this when i get time.

svn path=/trunk/; revision=10993
2004-09-23 06:42:16 +00:00
Art Yerkes 703e2aa5f9 Fixes:
Socket destruction is correct.  When IRPs are left to cancel, the socket
will remain until all pending irps complete.  The DestroySocket function
does this.  It is always safe to call DestroySocket at any time after the
FsContext member of the FileObject has been nulled.

Fixed UDP data delivery in.  UDP send still has a problem but it seems to
be in tcpip.sys more than likely.  I've sliced another 6000 lines out of
tcpip.sys that i will debug as a userspace library and link to tcpip.

Fixed poll reeval (old reported bug fix I hadn't committed yet).

Miscellaneously better sanity in a few rough spots.

svn path=/trunk/; revision=10785
2004-09-05 04:26:30 +00:00
Art Yerkes c24ef8433f AFD: Fixed handling of cancelling in flight requests when closing the socket.
Closing a socket doesn't crash but still hangs.  Needs work.
oskittcp: corrected problem with send data, trying out slightly different
scheme of dealing with closed socket.
tcpip: added support for SEL_FIN in socket state callback and corrected
support for returning error in TCPReceiveData.

svn path=/trunk/; revision=10650
2004-08-22 18:42:42 +00:00
Art Yerkes 36d2e136c7 Fixed missing unlock in write.
svn path=/trunk/; revision=10649
2004-08-22 02:15:57 +00:00
Art Yerkes 5eef6d16e3 Removed ASSERT_KM macro. It's not used any longer.
svn path=/trunk/; revision=10619
2004-08-20 16:26:10 +00:00
Casper Hornstrup 7ffd28c060 2004-08-16 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/afd/include/.cvsignore: New file.
	* drivers/net/afd/include/tdiconn.h: Don't include <afd.h>.
	* drivers/net/afd/.cvsignore: Add *.d.
	* drivers/net/afd/makefile (TARGET_PCH): Set to include/afd.h.

svn path=/trunk/; revision=10567
2004-08-15 22:51:57 +00:00
Art Yerkes c14c59021f Accidentally missed one breakpoint from the previous debugging session.
svn path=/trunk/; revision=10306
2004-07-29 04:10:53 +00:00
Art Yerkes c0dd64494d Fixed memory overwrite due to too-small allocation.
svn path=/trunk/; revision=10305
2004-07-29 04:09:06 +00:00
Art Yerkes 6a793b2703 Fixed after prototype change.
svn path=/trunk/; revision=10212
2004-07-18 22:53:59 +00:00
Art Yerkes 0f1eb55991 First commit of afd and msafd onto head.
tcpip: Turned off debug info in CVS.

svn path=/trunk/; revision=10210
2004-07-18 22:49:18 +00:00
Filip Navara 8fab52126f - Fix errors during optimized build.
svn path=/trunk/; revision=9983
2004-07-03 17:40:27 +00:00
Art Yerkes 5fd39d97bb recv now works every time
- Standardized on recvfrom request and reply everywhere
- Added a continuous parameter to FillWSABuffers for stream sockets
- Added function TryToSatisfyRecvRequest
- Create MDLs for the WSABUFS.  These are needed because we aren't in our
  home process when tcpip calls back with data.
- Removed extraneous and potentially confusing lock ReadRequestQueueLock
  Now both ReadRequestQueue and ReceiveQueue rely on ReceiveQueueLock

svn path=/trunk/; revision=9669
2004-06-15 02:56:13 +00:00
Art Yerkes 0999a0ef81 Preliminary version of recv.
svn path=/trunk/; revision=9666
2004-06-14 03:22:27 +00:00
Gé van Geldorp 45ac874e11 Avoid warnings when using gcc 3.4
svn path=/trunk/; revision=9356
2004-05-11 20:52:10 +00:00
Filip Navara 1f2169eb29 2004-04-04 Filip Navara <xnavara@volny.cz>
* drivers/net/afd/afd/dispatch.c (AfdDispGetName): Implement.
	* drivers/net/afd/include/afd.h (TdiQueryInformation): Declare.
	* drivers/net/tcpip/tcpip/dispatch.c (DispTdiQueryInformation):
	Partially implement for TDI_QUERY_ADDRESS_INFO request.
	* drivers/net/tcpip/transport/tcp/tcp.c (TCPiBuildPacket):
	Don't use variable name NdisBuffer, because it causes conficts.

svn path=/trunk/; revision=8543
2004-03-05 00:48:11 +00:00
Casper Hornstrup 318a90741d 2004-03-04 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/tcpip/i386: New directory.
	* drivers/net/tcpip/tcpip/i386/checksum.S: New file.
	* drivers/net/tcpip/notes.txt: New file.
	* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): Signal ACCEPT
	network event.
	(AfdDispEventSelect): Reference event handle.
	* drivers/net/afd/afd/tdi.c (TdiListen): Remove unused event.
	Move Iosb and RequestConnectionInfo to AFD_LISTEN_REQUEST structure.
	* drivers/net/afd/include/afd.h (AFDFCB): Replace EventObjects with
	EventObject of type PKEVENT.
	* drivers/net/tcpip/makefile (ARCH_OBJECTS): New variable.
	(TARGET_OBJECTS): Add ARCH_OBJECTS.
	* drivers/net/tcpip/include/address.h (AddrCloneAddress): New prototype.
	* drivers/net/tcpip/include/checksum.h (ChecksumFold, csum_partial): New
	prototype.
	(TCPv4Checksum): New macro.
	(CorrectChecksum): Rename to IPv4CorrectChecksum.
	(TCPv4CorrectChecksum): New macro.
	* drivers/net/tcpip/include/ip.h (IPv4_DF_MASK): New constant.
	* drivers/net/tcpip/include/tcp.h (TCP_XXX): Correct constants.
	(TCPCreateSegment, TCPFreeSegment, TCPAddSegment): Prototype.
	* drivers/net/tcpip/include/titypes.h (TCP_SEND_REQUEST): Add SequenceNumber
	and AckNumber.
	(TCP_SEGMENT): New structure.
	(CONNECTION_ENDPOINT): Add ListenRequest and ReceivedSegments.
	* drivers/net/tcpip/network/transmit.c (SendFragments): Release memory
	for Data on failure.
	* drivers/net/tcpip/tcpip/address.c (AddrCloneAddress): New function.
	* drivers/net/tcpip/tcpip/checksum.c (ChecksumFold): Factor out folding
	from ChecksumCompute.
	* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Support asynchronous
	operation.
	* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't cast to
	PTDI_ADDRESS_IP.
	Initialize ReceivedSegments.
	* drivers/net/tcpip/tcpip/routines.c (DisplayIPHeader): New function.
	(DisplayIPPacket): Call DisplayIPHeader().
	(DisplayTCPHeader): Change format strings.
	* drivers/net/tcpip/transport/tcp/tcp.c (IPIdentification,
	TCPSegmentList): Add.
	(TCPCreateSegment, TCPFreeSegment, TCPAddSegment,
	TCPBuildAndTransmitSendRequest2, TCPiSelectISS, TCPiReceiveListen,
	TCPiReceiveSynSent, TCPiReceiveSynReceived, TCPiReceiveData): New
	function.
	(TCPiBuildPacket): Build segment.
	(TCPStartup): Initialize TCPSegmentList.
	(TCPShutdown): Cleanup TCPSegmentList.

svn path=/trunk/; revision=8537
2004-03-04 20:45:39 +00:00
Filip Navara daaf2a72b8 - Build AFD, TCPIP and TDI with w32api headers.
- Removed the old TDI headers from include/net.

svn path=/trunk/; revision=8508
2004-03-02 18:18:15 +00:00
Art Yerkes 8c9fd64030 Edited includes for new tcp ioctl needed by iphlpapi.
tcpioctl.h: new
I resolved a conflict between iptypes, structs and nspapi regarding some
core structures.
afd.h: removed definitions needed by both user land and kernel land.
tdiinfo.h: added needed definitions.

svn path=/trunk/; revision=8173
2004-02-14 21:27:35 +00:00
Filip Navara 8ccf098ee6 reactos/drivers/net/afd/afd/afd.c (AfdDispatch): Correctly set
Irp->IoStatus.Information.
(AfdUnload): Make it STDCALL.
(DriverEntry): Don't cast function pointers.
reactos/drivers/net/afd/afd/dispatch.c (AfdDispGetName): New function, still
incomplete.
reactos/drivers/net/afd/include/afd.h (AfdDispGetName): Declare.
reactos/drivers/net/tcpip/tcpip/main.c (TiDispatchOpenClose):
Use STDCALL instead of STDCALL_FUNC.
(TiUnload): Make it STDCALL.
(DriverEntry): Don't cast function pointers.
reactos/drivers/net/tcpip/transport/tcp/tcp.c (TCPConnect):
Don't free the NDIS buffer, it's already done on another place and return
STATUS_PENDING to avoid completing the Irp two times.
reactos/lib/msafd/misc/stubs.c (WSPGetSockName, WSPGetPeerName):
Moved to ...
reactos/lib/msafd/misc/dllmain.c (WSPGetSockName, WSPGetPeerName):
... here, direct the calls to afd.sys.

svn path=/trunk/; revision=8132
2004-02-10 17:12:42 +00:00
Art Yerkes 24fecbb518 Added afd/tdiconn.c with corrections by filip navara
afd/dispatch.c fixed ptr arith + bug fix by filip
afd/tdi.c removed functions dealing with TDI_CONNECTION_INFORMATION (tdiconn)
tcpip fixes by filip

svn path=/trunk/; revision=8072
2004-02-07 04:50:44 +00:00
Eric Kohl cdcb7ec378 Remove ntos.h and roskrnl.h from kernel-mode code.
svn path=/trunk/; revision=7900
2004-01-28 20:55:50 +00:00
Filip Navara 73b404c2ea - Removed some obsolete headers.
- Converted some of the (mostly network) stuff to compile with W32API.

svn path=/trunk/; revision=7573
2004-01-11 20:46:06 +00:00
Art Yerkes 5662831f38 Fixes for bugs previously posted in bugzilla.
svn path=/trunk/; revision=7469
2004-01-06 03:44:38 +00:00
KJK::Hyperion f935f66635 "Ancillary Function Driver" is about as descriptive as "Foo Thingy". Let's stop the insanity: from today, 25 December 2003, AFD will be known as "Socket Filesystem Driver". OK, so I'm bored
svn path=/trunk/; revision=7235
2003-12-25 18:35:20 +00:00
Casper Hornstrup 08ba5babf3 2003-12-25 Casper S. Hornstrup <chorns@users.sourceforge.net>
* apps/utils/net/roshttpd/error.cpp (ReportErrorStr): Cast to wchar_t*,
	not __wchar_t*.
	* apps/utils/net/roshttpd/makefile (TARGET_CPPFLAGS): Add -Wno-deprecated.
	(TARGET_GCCLIBS): Add stdc++.
	* apps/utils/net/roshttpd/common/socket.cpp: Include <string.h>.
	* apps/utils/net/roshttpd/common/thread.cpp (CThread::CThread): Fix
	warning.
	* drivers/net/afd/afd/afd.c (ListenRequestLookasideList): New variable.
	(DriverEntry): Initialize ListenRequestLookasideList.
	* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): New function.
	(AfdDispListen): Partial implement.
	* drivers/net/afd/afd/opnclose.c (AfdInitializeFCB): Initialize
	NewFCB->ListenRequestQueue.
	(AfdKillListenRequests): New function.
	(AfdClose): Call AfdKillListenRequests.
	* drivers/net/afd/afd/routines.c (DumpName): New function.
	* drivers/net/afd/afd/tdi.c (TdiAddressSizeFromType): New function.
	(TdiBuildConnectionInfo): Initialize ConnInfo->OptionsLength.
	(TdiBuildNullConnectionInfo): New function.
	(TdiOpenAddressFileIPv4, TdiOpenConnectionEndpointFile): EaName is
	0-terminated.
	(TdiListen): New function.
	* drivers/net/afd/include/afd.h (AFDFCB): Add ListenRequestQueue.
	(AFD_LISTEN_REQUEST): New structure.
	(ListenRequestLookasideList): Declare.
	(DumpName, TdiListen): Add prototypes.
	* drivers/net/tcpip/datalink/lan.c (BindAdapter): Initialize
	AnsiAddress.Length and AnsiAddress.MaximumLength.
	* drivers/net/tcpip/include/debug.h: Define DEBUG_TCP.
	* drivers/net/tcpip/include/routines.h (DisplayTCPPacket): Add
	prototype.
	(DISPLAY_TCP_PACKET): Define.
	* drivers/net/tcpip/include/tcp.h (TCPListen): Add prototype.
	* drivers/net/tcpip/include/titypes.h (ADDRESS_FILE): Add Connection.
	* drivers/net/tcpip/network/ip.c (IPLocateNTEOnInterface): Cleanup.
	* drivers/net/tcpip/tcpip/address.c (AddrSearchNext): Port is in
	network byte order.
	* drivers/net/tcpip/tcpip/dispatch.c (DispTdiAssociateAddress):
	Initialize AddrFile->Connection.
	(DispTdiListen): Implement.
	* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't
	initialize AddrFile->Connections.
	* drivers/net/tcpip/tcpip/routines.c: Include <tcp.h>.
	(DisplayIPPacket): Enable.
	(DisplayTCPHeader, DisplayTCPPacket): New functions.
	* drivers/net/tcpip/transport/tcp/tcp.c: Include <routines.h>.
	(TCPListen, TCPiReceive): New functions.
	(TCPReceive): Partial implement.
	* lib/msafd/misc/helpers.c (CreateHelperDLLDatabase): Add
	{SOCK_STREAM,IPPROTO_TCP,0} and {SOCK_DGRAM,IPPROTO_UDP,0} mappings.
	* lib/ntdll/ldr/utils.c (LdrLoadDll): Print name of DLL if not found.
	* lib/ws2_32/include/ws2_32.h (Initialized): Declare.
	(WINSOCK_THREAD_BLOCK): Remove Initialized member.
	* (WSAINITIALIZED, WSASETINITIALIZED): Update.
	* lib/ws2_32/misc/catalog.c (CreateCatalog): Add
	{SOCK_STREAM,IPPROTO_TCP,0} and {SOCK_DGRAM,IPPROTO_UDP,0} mappings.
	(Initialized): New variable.
	(DllMain): Don't initialize p->Initialized.
	* ntoskrnl/dbg/kdb.c: Include <ctype.h>.
	* subsys/win32k/ntuser/message.c (NtUserDispatchMessage): Kill noisy
	message.

svn path=/trunk/; revision=7232
2003-12-25 14:06:15 +00:00
Vizzini 8a095f86fc TDI stuff I forgot to commit
svn path=/trunk/; revision=6730
2003-11-20 17:55:10 +00:00
KJK::Hyperion 40e2bff3e7 Moved and renamed some ReactOS specific macros
svn path=/trunk/; revision=6672
2003-11-17 02:12:52 +00:00
Thomas Bluemel 1c3867a641 Patch by Jonathon Wilson:
fix most of ReactOS to build with -Wall -Werror by default

svn path=/trunk/; revision=6645
2003-11-14 17:13:36 +00:00
Royce Mitchell III d47c833e21 reorganized for NDIS_WDM support ( submitted by vizzini )
svn path=/trunk/; revision=5250
2003-07-24 18:14:59 +00:00
guido 0eb42760a8 another day of janitor stuff
svn path=/trunk/; revision=4991
2003-06-29 21:05:54 +00:00
Casper Hornstrup 922b9fdf46 2003-06-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api

	* include/ddk/cctypes.h (PREACTOS_COMMON_FCB_HEADER): Remove.
	(FSRTL_COMMON_FCB_HEADER): Add.
	* include/ddk/iotypes.h (FILE_OBJECT): Rename field
	SectionObjectPointers to SectionObjectPointer.
	* ntoskrnl/cc/copy.c, ntoskrnl/cc/misc.c, ntoskrnl/cc/pin.c,
	ntoskrnl/cc/view.c, ntoskrnl/io/rawfs.c, ntoskrnl/mm/section.c,
	drivers/fs/cdfs/cleanup.c, drivers/fs/cdfs/fcb.c,
	drivers/fs/cdfs/fsctl.c, drivers/fs/ntfs/fcb.c, drivers/fs/ntfs/fsctl.c,
	drivers/fs/vfat/close.c, drivers/fs/vfat/create.c,
	drivers/fs/vfat/finfo.c, drivers/fs/vfat/fcb.c, drivers/fs/vfat/fsctl.c:
	Use new	FILE_OBJECT structure.
	* drivers/fs/cdfs/cdfs.h, drivers/fs/ntfs/ntfs.h, drivers/fs/vfat/vfat.h:
	Use new FSRTL_COMMON_FCB_HEADER structure.
	* drivers/net/afd/include/afd.h (FSRTL_COMMON_FCB_HEADER): Remove.
	* include/ddk/ketypes.h (KQUEUE): Match w32api structure.
	* ntoskrnl/ke/queue.c, ntoskrnl/ke/wait.c: Use new structure.
	* ntoskrnl/ke/spinlock.c (KeAcquireSpinLockAtDpcLevel,
	KeReleaseSpinLockFromDpcLevel): Undefine before declaring.

svn path=/trunk/; revision=4865
2003-06-07 11:34:36 +00:00
Gunnar Dalsnes e76a3a5ab0 -Fixed FileObject/Event dereferencing at IRP completion problem
-Reworked IRP completion rotuines
-io/irp.c: Reworked IoIsOperationSynchronous
-afd/opnclose.c: Fixed bug where CCB was freed twice
-io/create.c: changed Lock event in FileObject from NotificationEvent to SynchronizationEvent

svn path=/trunk/; revision=4739
2003-05-22 00:47:04 +00:00
Robert Dickenson a8e38f8c30 housekeeping files...
svn path=/trunk/; revision=3945
2003-01-05 19:32:32 +00:00
Robert Dickenson bc87211c3f housekeeping files...
svn path=/trunk/; revision=3938
2003-01-05 17:54:20 +00:00
Robert Dickenson 4ca5b5aa15 changed the default trace level to MID_TRACE for when DBG is defined.
svn path=/trunk/; revision=3730
2002-11-10 13:53:34 +00:00
Casper Hornstrup 17c0b5798e Reverted latest changes.
svn path=/trunk/; revision=3473
2002-09-08 10:23:54 +00:00
Casper Hornstrup 387d432884 Use free Windows DDK and compile with latest MinGW releases.
svn path=/trunk/; revision=3466
2002-09-07 15:13:13 +00:00
KJK::Hyperion d8bd5ccb4a New macros InitializeUnicodeString(), RtlInitUnicodeStringFromLiteral() and UNICODE_STRING_INITIALIZATOR(), for fast, compile-time initialization of UNICODE_STRING variables
svn path=/trunk/; revision=3371
2002-08-20 20:37:19 +00:00