Author: cgutman
Date: Sat Oct 31 08:34:27 2009
New Revision: 43867
URL: http://svn.reactos.org/svn/reactos?rev=43867&view=rev
Log:
- Add more cases to TCPTranslateError
- Fix a header typo
Modified:
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
trunk/reactos/lib/drivers/oskittcp/include/oskiterrno.h
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sat Oct 31 08:34:27 2009
@@ -563,8 +563,16 @@
case OSK_EAFNOSUPPORT: Status = STATUS_INVALID_CONNECTION; break;
case OSK_ECONNREFUSED:
case OSK_ECONNRESET: Status = STATUS_REMOTE_NOT_LISTENING; break;
- case OSK_EINPROGRESS:
- case OSK_EAGAIN: Status = STATUS_PENDING; break;
+ case OSK_EINPROGRESS: Status = STATUS_PENDING; break;
+ case OSK_EWOULDBLOCK: Status = STATUS_CANT_WAIT; break;
+ case OSK_EINVAL: Status = STATUS_INVALID_PARAMETER; break;
+ case OSK_ENOMEM:
+ case OSK_ENOBUFS: Status = STATUS_INSUFFICIENT_RESOURCES; break;
+ case OSK_ESHUTDOWN: Status = STATUS_FILE_CLOSED; break;
+ case OSK_EMSGSIZE: Status = STATUS_BUFFER_TOO_SMALL; break;
+ case OSK_ETIMEDOUT: Status = STATUS_TIMEOUT; break;
+ case OSK_ENETUNREACH: Status = STATUS_NETWORK_UNREACHABLE; break;
+ case OSK_EFAULT: Status = STATUS_ACCESS_VIOLATION; break;
default:
DbgPrint("OskitTCP returned unhandled error code: %d\n", OskitError);
Status = STATUS_INVALID_CONNECTION;
Modified: trunk/reactos/lib/drivers/oskittcp/include/oskiterrno.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/inclu…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/include/oskiterrno.h [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/oskittcp/include/oskiterrno.h [iso-8859-1] Sat Oct 31 08:34:27 2009
@@ -97,7 +97,7 @@
/* non-blocking and interrupt i/o */
#define OSK_EAGAIN 35 /* Resource temporarily unavailable */
#ifndef _POSIX_SOURCE
-#define OSK_EWOULDBLOCK EAGAIN /* Operation would block */
+#define OSK_EWOULDBLOCK OSK_EAGAIN /* Operation would block */
#define OSK_EINPROGRESS 36 /* Operation now in progress */
#define OSK_EALREADY 37 /* Operation already in progress */
Author: sginsberg
Date: Sat Oct 31 01:39:16 2009
New Revision: 43862
URL: http://svn.reactos.org/svn/reactos?rev=43862&view=rev
Log:
- Clarify a check and don't cast KPCR->GDT to PKIPCR (spotted by Timo).
Modified:
trunk/reactos/ntoskrnl/ke/i386/ldt.c
Modified: trunk/reactos/ntoskrnl/ke/i386/ldt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/ldt.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/ldt.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/ldt.c [iso-8859-1] Sat Oct 31 01:39:16 2009
@@ -27,10 +27,10 @@
IN ULONG Offset,
IN PKGDTENTRY Descriptor)
{
- /* Make sure the offset is inside the allowed range */
- if (!((Offset) < (KGDT_NUMBER * sizeof(KGDTENTRY))))
- {
- /* It isn't, fail */
+ /* Make sure the offset isn't outside the allowed range */
+ if (Offset >= (KGDT_NUMBER * sizeof(KGDTENTRY)))
+ {
+ /* It is, fail */
return STATUS_ACCESS_VIOLATION;
}
@@ -46,7 +46,7 @@
{
/* Get the descriptor entry from the GDT */
RtlCopyMemory(Descriptor,
- (PCHAR)((PKIPCR)KeGetPcr()->GDT) + Offset,
+ (PVOID)(((ULONG_PTR)KeGetPcr()->GDT) + Offset),
sizeof(KGDTENTRY));
/* Check if this is the TEB selector */