- Merge some small changes from aicom-network-branch to fix potential memory corruption and remove unused code in oskittcp

- Add a hack to WSHSetSocketInformation so we don't fail with options that aren't implemented yet
 - Fixes bug #5131

svn path=/trunk/; revision=45356
This commit is contained in:
Cameron Gutman 2010-01-31 02:07:23 +00:00
parent 5a20627609
commit 95b2e7519e
4 changed files with 4 additions and 36 deletions

View file

@ -623,8 +623,10 @@ WSHSetSocketInformation(
/* FIXME: We only handle address file object here */
RealOptionName = GetAddressOption(Level, OptionName);
/* FIXME: Support all options */
if (!RealOptionName)
return WSAEINVAL;
return 0; /* return WSAEINVAL; */
Info = HeapAlloc(GetProcessHeap(), 0, sizeof(*Info) + OptionLength);
if (!Info)

View file

@ -57,13 +57,6 @@
#include <sys/malloc.h>
#endif
#ifndef OSKIT
#ifdef __REACTOS__
/* #define OSKIT */
#define LOCAL_OSKIT_DEFINED
#endif
#endif
/*
* Mbufs are of a single size, MSIZE (machine/machparam.h), which
* includes overhead. An mbuf may add a single "mbuf cluster" of size
@ -301,21 +294,6 @@ union mcluster {
} \
)
#ifdef __REACTOS__
#define MCLGET(m, how) { \
OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
(m)->m_ext.ext_buf = malloc(MCLBYTES,__FILE__,__LINE__); \
if ((m)->m_ext.ext_buf != NULL) { \
(m)->m_data = (m)->m_ext.ext_buf; \
(m)->m_flags |= M_EXT; \
(m)->m_ext.ext_size = MCLBYTES; \
} \
}
#define MCLFREE(p) { \
free( (p), 0 ); \
}
#else
#define MCLGET(m, how) \
{ MCLALLOC((m)->m_ext.ext_buf, (how)); \
OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
@ -335,7 +313,6 @@ union mcluster {
mbstat.m_clfree++; \
} \
)
#endif
#else
#define MCLGET(m, how) \
{ (m)->m_ext.ext_bufio = oskit_bufio_create(MCLBYTES); \
@ -557,9 +534,4 @@ int mbtypes[] = { /* XXX */
#endif
#endif
#ifdef LOCAL_OSKIT_DEFINED
#undef LOCAL_OSKIT_DEFINED
#undef OSKIT
#endif
#endif /* !_SYS_MBUF_H_ */

View file

@ -14,7 +14,7 @@ extern void oskittcp_die(const char *file, int line);
#define printf DbgPrint
#define vprintf DbgVPrint
#define ovbcopy(x,y,z) bcopy(x,y,z)
#define ovbcopy(src,dst,n) memmove(dst,src,n)
#define bzero(x,y) memset(x,0,y)
#define bcopy(src,dst,n) memcpy(dst,src,n)
#ifdef _MSC_VER

View file

@ -365,9 +365,7 @@ m_copym(m, off0, len, wait)
#ifdef OSKIT
oskit_bufio_addref(m->m_ext.ext_bufio);
#else
#ifndef __REACTOS__
mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
#endif
#endif /* OSKIT */
n->m_ext = m->m_ext;
n->m_flags |= M_EXT;
@ -729,11 +727,7 @@ m_devget(buf, totlen, off0, ifp, copy)
if (copy)
copy(cp, mtod(m, caddr_t), (unsigned)len);
else
#ifdef __REACTOS__
memcpy(mtod(m, caddr_t), cp, len);
#else
bcopy(cp, mtod(m, caddr_t), (unsigned)len);
#endif
cp += len;
*mp = m;
mp = &m->m_next;