Commit 11776c1f authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Moved comm.c into kernel32.

parent eec9cbbe
...@@ -7,6 +7,7 @@ SOVERSION = 1.0 ...@@ -7,6 +7,7 @@ SOVERSION = 1.0
ALTNAMES = comm kernel stress system toolhelp windebug win87em wprocs ALTNAMES = comm kernel stress system toolhelp windebug win87em wprocs
C_SRCS = \ C_SRCS = \
comm.c \
debugger.c \ debugger.c \
format_msg.c \ format_msg.c \
kernel_main.c \ kernel_main.c \
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include <unistd.h> #include <unistd.h>
#include "windef.h" #include "windef.h"
#include "comm.h"
#ifdef HAVE_SYS_MODEM_H #ifdef HAVE_SYS_MODEM_H
# include <sys/modem.h> # include <sys/modem.h>
#endif #endif
...@@ -90,10 +89,31 @@ DEFAULT_DEBUG_CHANNEL(comm); ...@@ -90,10 +89,31 @@ DEFAULT_DEBUG_CHANNEL(comm);
#define CMSPAR 0x40000000 /* stick parity */ #define CMSPAR 0x40000000 /* stick parity */
#endif #endif
struct DosDeviceStruct COM[MAX_PORTS]; #define MAX_PORTS 9
struct DosDeviceStruct LPT[MAX_PORTS];
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 */ /* pointers to unknown(==undocumented) comm structure */
LPCVOID *unknown[MAX_PORTS]; static LPCVOID *unknown[MAX_PORTS];
/* save terminal states */ /* save terminal states */
static struct termios m_stat[MAX_PORTS]; static struct termios m_stat[MAX_PORTS];
...@@ -2844,30 +2864,3 @@ BOOL WINAPI GetDefaultCommConfigW( LPCWSTR lpszName,LPCOMMCONFIG lpCC, ...@@ -2844,30 +2864,3 @@ BOOL WINAPI GetDefaultCommConfigW( LPCWSTR lpszName,LPCOMMCONFIG lpCC,
return ret; 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;
}
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
#include "neexe.h" #include "neexe.h"
#include "module.h" #include "module.h"
#include "task.h" #include "task.h"
#include "comm.h"
#include "selectors.h" #include "selectors.h"
#include "miscemu.h" #include "miscemu.h"
#include "global.h" #include "global.h"
extern void CODEPAGE_Init(void); extern void CODEPAGE_Init(void);
extern BOOL THUNK_Init(void); extern BOOL THUNK_Init(void);
extern void COMM_Init(void);
/*********************************************************************** /***********************************************************************
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "winerror.h" #include "winerror.h"
#include "drive.h" #include "drive.h"
#include "file.h" #include "file.h"
#include "comm.h"
#include "heap.h" #include "heap.h"
#include "msdos.h" #include "msdos.h"
#include "syslevel.h" #include "syslevel.h"
...@@ -694,6 +693,33 @@ const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile ) ...@@ -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 * DOSFS_OpenDevice
* *
...@@ -746,7 +772,7 @@ HFILE DOSFS_OpenDevice( const char *name, DWORD access ) ...@@ -746,7 +772,7 @@ HFILE DOSFS_OpenDevice( const char *name, DWORD access )
return FILE_CreateDevice( i, access, NULL ); return FILE_CreateDevice( i, access, NULL );
} }
if( (handle=COMM_CreatePort(name,access)) ) if( (handle=DOSFS_CreateCommPort(name,access)) )
return handle; return handle;
FIXME("device open %s not supported (yet)\n",DOSFS_Devices[i].name); FIXME("device open %s not supported (yet)\n",DOSFS_Devices[i].name);
......
#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 */
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define __WINE_MSDOS_H #define __WINE_MSDOS_H
#include "winnt.h" #include "winnt.h"
#include "comm.h"
struct fcb { struct fcb {
BYTE drive; BYTE drive;
...@@ -100,9 +99,6 @@ typedef struct _DOS_LISTOFLISTS ...@@ -100,9 +99,6 @@ typedef struct _DOS_LISTOFLISTS
#define MAX_DOS_DRIVES 26 #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; \ #define setword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \
*((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\ *((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\
} while(0) } while(0)
......
...@@ -8,7 +8,6 @@ MODULE = misc ...@@ -8,7 +8,6 @@ MODULE = misc
C_SRCS = \ C_SRCS = \
cdrom.c \ cdrom.c \
comm.c \
cpu.c \ cpu.c \
debugstr.c \ debugstr.c \
error.c \ error.c \
......
...@@ -52,7 +52,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context ) ...@@ -52,7 +52,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context )
if (DRIVE_IsValid(1)) diskdrives++; if (DRIVE_IsValid(1)) diskdrives++;
if (diskdrives) diskdrives--; if (diskdrives) diskdrives--;
for (x=0; x!=MAX_PORTS; x++) for (x=0; x < 9; x++)
{ {
char temp[16],name[16]; char temp[16],name[16];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment