Moved comm.c into kernel32.

oldstable
Mike McCormack 2000-10-13 17:11:30 +00:00 committed by Alexandre Julliard
parent eec9cbbe25
commit 11776c1fcf
8 changed files with 55 additions and 70 deletions

View File

@ -7,6 +7,7 @@ SOVERSION = 1.0
ALTNAMES = comm kernel stress system toolhelp windebug win87em wprocs
C_SRCS = \
comm.c \
debugger.c \
format_msg.c \
kernel_main.c \

View File

@ -52,7 +52,6 @@
#include <unistd.h>
#include "windef.h"
#include "comm.h"
#ifdef HAVE_SYS_MODEM_H
# include <sys/modem.h>
#endif
@ -90,10 +89,31 @@ DEFAULT_DEBUG_CHANNEL(comm);
#define CMSPAR 0x40000000 /* stick parity */
#endif
struct DosDeviceStruct COM[MAX_PORTS];
struct DosDeviceStruct LPT[MAX_PORTS];
#define MAX_PORTS 9
struct DosDeviceStruct {
char *devicename; /* /dev/cua1 */
int fd;
int suspended;
int unget,xmit;
int baudrate;
int evtchar;
/* events */
int commerror, eventmask;
/* buffers */
char *inbuf,*outbuf;
unsigned ibuf_size,ibuf_head,ibuf_tail;
unsigned obuf_size,obuf_head,obuf_tail;
/* notifications */
int wnd, n_read, n_write;
HANDLE s_read, s_write;
};
static struct DosDeviceStruct COM[MAX_PORTS];
static struct DosDeviceStruct LPT[MAX_PORTS];
/* pointers to unknown(==undocumented) comm structure */
LPCVOID *unknown[MAX_PORTS];
static LPCVOID *unknown[MAX_PORTS];
/* save terminal states */
static struct termios m_stat[MAX_PORTS];
@ -2844,30 +2864,3 @@ BOOL WINAPI GetDefaultCommConfigW( LPCWSTR lpszName,LPCOMMCONFIG lpCC,
return ret;
}
/**************************************************************************
* COMM_CreatePort INTERNAL
*/
HANDLE COMM_CreatePort(LPCSTR name, DWORD access)
{
struct create_serial_request *req = get_req_buffer();
DWORD r;
char devname[40];
TRACE("%s %lx\n", name, access);
PROFILE_GetWineIniString("serialports",name,"",devname,sizeof devname);
if(!devname[0])
return 0;
TRACE("opening %s as %s\n", devname, name);
req->handle = 0;
req->access = access;
req->sharing = FILE_SHARE_READ|FILE_SHARE_WRITE;
lstrcpynA( req->name, devname, server_remaining(req->name) );
SetLastError(0);
r = server_call( REQ_CREATE_SERIAL );
TRACE("create_port_request return %08lX handle = %08X\n",r,req->handle);
return req->handle;
}

View File

@ -10,13 +10,13 @@
#include "neexe.h"
#include "module.h"
#include "task.h"
#include "comm.h"
#include "selectors.h"
#include "miscemu.h"
#include "global.h"
extern void CODEPAGE_Init(void);
extern BOOL THUNK_Init(void);
extern void COMM_Init(void);
/***********************************************************************

View File

@ -29,7 +29,6 @@
#include "winerror.h"
#include "drive.h"
#include "file.h"
#include "comm.h"
#include "heap.h"
#include "msdos.h"
#include "syslevel.h"
@ -694,6 +693,33 @@ const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile )
}
/**************************************************************************
* DOSFS_CreateCommPort
*/
static HANDLE DOSFS_CreateCommPort(LPCSTR name, DWORD access)
{
struct create_serial_request *req = get_req_buffer();
DWORD r;
char devname[40];
TRACE("%s %lx\n", name, access);
PROFILE_GetWineIniString("serialports",name,"",devname,sizeof devname);
if(!devname[0])
return 0;
TRACE("opening %s as %s\n", devname, name);
req->handle = 0;
req->access = access;
req->sharing = FILE_SHARE_READ|FILE_SHARE_WRITE;
lstrcpynA( req->name, devname, server_remaining(req->name) );
SetLastError(0);
r = server_call( REQ_CREATE_SERIAL );
TRACE("create_port_request return %08lX handle = %08X\n",r,req->handle);
return req->handle;
}
/***********************************************************************
* DOSFS_OpenDevice
*
@ -746,7 +772,7 @@ HFILE DOSFS_OpenDevice( const char *name, DWORD access )
return FILE_CreateDevice( i, access, NULL );
}
if( (handle=COMM_CreatePort(name,access)) )
if( (handle=DOSFS_CreateCommPort(name,access)) )
return handle;
FIXME("device open %s not supported (yet)\n",DOSFS_Devices[i].name);

View File

@ -1,30 +0,0 @@
#ifndef __WINE_COMM_H
#define __WINE_COMM_H
#include "windef.h"
#include "winbase.h"
#define MAX_PORTS 9
struct DosDeviceStruct {
char *devicename; /* /dev/cua1 */
int fd;
int suspended;
int unget,xmit;
int baudrate;
int evtchar;
/* events */
int commerror, eventmask;
/* buffers */
char *inbuf,*outbuf;
unsigned ibuf_size,ibuf_head,ibuf_tail;
unsigned obuf_size,obuf_head,obuf_tail;
/* notifications */
int wnd, n_read, n_write;
HANDLE s_read, s_write;
};
extern void COMM_Init(void);
extern HANDLE COMM_CreatePort(LPCSTR name, DWORD access);
#endif /* __WINE_COMM_H */

View File

@ -2,7 +2,6 @@
#define __WINE_MSDOS_H
#include "winnt.h"
#include "comm.h"
struct fcb {
BYTE drive;
@ -100,9 +99,6 @@ typedef struct _DOS_LISTOFLISTS
#define MAX_DOS_DRIVES 26
extern struct DosDeviceStruct COM[MAX_PORTS];
extern struct DosDeviceStruct LPT[MAX_PORTS];
#define setword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \
*((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\
} while(0)

View File

@ -8,7 +8,6 @@ MODULE = misc
C_SRCS = \
cdrom.c \
comm.c \
cpu.c \
debugstr.c \
error.c \

View File

@ -52,7 +52,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context )
if (DRIVE_IsValid(1)) diskdrives++;
if (diskdrives) diskdrives--;
for (x=0; x!=MAX_PORTS; x++)
for (x=0; x < 9; x++)
{
char temp[16],name[16];