mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
283 lines
9.3 KiB
283 lines
9.3 KiB
//---------------------------------------------------------------------------
|
|
//
|
|
// Copyright (c) Microsoft Corporation 1993-1995
|
|
//
|
|
// File: modemp.h
|
|
//
|
|
// This files contains the private modem structures and defines shared
|
|
// between Unimodem components.
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#ifndef __MODEMP_H__
|
|
#define __MODEMP_H__
|
|
|
|
#ifndef WIN32
|
|
//------------------------------------------------------------------------
|
|
// These structures are the Win32 versions, defined in WINBASE.H and MCX.H,
|
|
// but we cannot include them because we are 16-bit. So here they are...
|
|
//------------------------------------------------------------------------
|
|
|
|
#pragma pack(4) // make this align every 32-bits
|
|
|
|
//
|
|
// Serial provider type.
|
|
//
|
|
|
|
#define SP_SERIALCOMM ((DWORD)0x00000001)
|
|
|
|
//
|
|
// Provider SubTypes
|
|
//
|
|
|
|
#define PST_UNSPECIFIED ((DWORD)0x00000000)
|
|
#define PST_RS232 ((DWORD)0x00000001)
|
|
#define PST_PARALLELPORT ((DWORD)0x00000002)
|
|
#define PST_RS422 ((DWORD)0x00000003)
|
|
#define PST_RS423 ((DWORD)0x00000004)
|
|
#define PST_RS449 ((DWORD)0x00000005)
|
|
#define PST_MODEM ((DWORD)0x00000006)
|
|
#define PST_FAX ((DWORD)0x00000021)
|
|
#define PST_SCANNER ((DWORD)0x00000022)
|
|
#define PST_NETWORK_BRIDGE ((DWORD)0x00000100)
|
|
#define PST_LAT ((DWORD)0x00000101)
|
|
#define PST_TCPIP_TELNET ((DWORD)0x00000102)
|
|
#define PST_X25 ((DWORD)0x00000103)
|
|
|
|
|
|
//
|
|
// Provider capabilities flags.
|
|
//
|
|
|
|
#define PCF_DTRDSR ((DWORD)0x0001)
|
|
#define PCF_RTSCTS ((DWORD)0x0002)
|
|
#define PCF_RLSD ((DWORD)0x0004)
|
|
#define PCF_PARITY_CHECK ((DWORD)0x0008)
|
|
#define PCF_XONXOFF ((DWORD)0x0010)
|
|
#define PCF_SETXCHAR ((DWORD)0x0020)
|
|
#define PCF_TOTALTIMEOUTS ((DWORD)0x0040)
|
|
#define PCF_INTTIMEOUTS ((DWORD)0x0080)
|
|
#define PCF_SPECIALCHARS ((DWORD)0x0100)
|
|
#define PCF_16BITMODE ((DWORD)0x0200)
|
|
|
|
//
|
|
// Comm provider settable parameters.
|
|
//
|
|
|
|
#define SP_PARITY ((DWORD)0x0001)
|
|
#define SP_BAUD ((DWORD)0x0002)
|
|
#define SP_DATABITS ((DWORD)0x0004)
|
|
#define SP_STOPBITS ((DWORD)0x0008)
|
|
#define SP_HANDSHAKING ((DWORD)0x0010)
|
|
#define SP_PARITY_CHECK ((DWORD)0x0020)
|
|
#define SP_RLSD ((DWORD)0x0040)
|
|
|
|
//
|
|
// Settable baud rates in the provider.
|
|
//
|
|
|
|
#define BAUD_075 ((DWORD)0x00000001)
|
|
#define BAUD_110 ((DWORD)0x00000002)
|
|
#define BAUD_134_5 ((DWORD)0x00000004)
|
|
#define BAUD_150 ((DWORD)0x00000008)
|
|
#define BAUD_300 ((DWORD)0x00000010)
|
|
#define BAUD_600 ((DWORD)0x00000020)
|
|
#define BAUD_1200 ((DWORD)0x00000040)
|
|
#define BAUD_1800 ((DWORD)0x00000080)
|
|
#define BAUD_2400 ((DWORD)0x00000100)
|
|
#define BAUD_4800 ((DWORD)0x00000200)
|
|
#define BAUD_7200 ((DWORD)0x00000400)
|
|
#define BAUD_9600 ((DWORD)0x00000800)
|
|
#define BAUD_14400 ((DWORD)0x00001000)
|
|
#define BAUD_19200 ((DWORD)0x00002000)
|
|
#define BAUD_38400 ((DWORD)0x00004000)
|
|
#define BAUD_56K ((DWORD)0x00008000)
|
|
#define BAUD_128K ((DWORD)0x00010000)
|
|
#define BAUD_115200 ((DWORD)0x00020000)
|
|
#define BAUD_57600 ((DWORD)0x00040000)
|
|
#define BAUD_USER ((DWORD)0x10000000)
|
|
|
|
//
|
|
// Settable Data Bits
|
|
//
|
|
|
|
#define DATABITS_5 ((WORD)0x0001)
|
|
#define DATABITS_6 ((WORD)0x0002)
|
|
#define DATABITS_7 ((WORD)0x0004)
|
|
#define DATABITS_8 ((WORD)0x0008)
|
|
#define DATABITS_16 ((WORD)0x0010)
|
|
#define DATABITS_16X ((WORD)0x0020)
|
|
|
|
//
|
|
// Settable Stop and Parity bits.
|
|
//
|
|
|
|
#define STOPBITS_10 ((WORD)0x0001)
|
|
#define STOPBITS_15 ((WORD)0x0002)
|
|
#define STOPBITS_20 ((WORD)0x0004)
|
|
#define PARITY_NONE ((WORD)0x0100)
|
|
#define PARITY_ODD ((WORD)0x0200)
|
|
#define PARITY_EVEN ((WORD)0x0400)
|
|
#define PARITY_MARK ((WORD)0x0800)
|
|
#define PARITY_SPACE ((WORD)0x1000)
|
|
|
|
//
|
|
// DTR Control Flow Values.
|
|
//
|
|
#define DTR_CONTROL_DISABLE 0x00
|
|
#define DTR_CONTROL_ENABLE 0x01
|
|
#define DTR_CONTROL_HANDSHAKE 0x02
|
|
|
|
//
|
|
// RTS Control Flow Values
|
|
//
|
|
#define RTS_CONTROL_DISABLE 0x00
|
|
#define RTS_CONTROL_ENABLE 0x01
|
|
#define RTS_CONTROL_HANDSHAKE 0x02
|
|
#define RTS_CONTROL_TOGGLE 0x03
|
|
|
|
typedef struct _WIN32DCB {
|
|
DWORD DCBlength; /* sizeof(DCB) */
|
|
DWORD BaudRate; /* Baudrate at which running */
|
|
DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
|
|
DWORD fParity: 1; /* Enable parity checking */
|
|
DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
|
|
DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
|
|
DWORD fDtrControl:2; /* DTR Flow control */
|
|
DWORD fDsrSensitivity:1; /* DSR Sensitivity */
|
|
DWORD fTXContinueOnXoff: 1; /* Continue TX when Xoff sent */
|
|
DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
|
|
DWORD fInX: 1; /* Enable input X-ON/X-OFF */
|
|
DWORD fErrorChar: 1; /* Enable Err Replacement */
|
|
DWORD fNull: 1; /* Enable Null stripping */
|
|
DWORD fRtsControl:2; /* Rts Flow control */
|
|
DWORD fAbortOnError:1; /* Abort all reads and writes on Error */
|
|
DWORD fDummy2:17; /* Reserved */
|
|
WORD wReserved; /* Not currently used */
|
|
WORD XonLim; /* Transmit X-ON threshold */
|
|
WORD XoffLim; /* Transmit X-OFF threshold */
|
|
BYTE ByteSize; /* Number of bits/byte, 4-8 */
|
|
BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
|
|
BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
|
|
char XonChar; /* Tx and Rx X-ON character */
|
|
char XoffChar; /* Tx and Rx X-OFF character */
|
|
char ErrorChar; /* Error replacement char */
|
|
char EofChar; /* End of Input character */
|
|
char EvtChar; /* Recieved Event character */
|
|
} WIN32DCB, FAR *LPWIN32DCB;
|
|
|
|
#pragma pack()
|
|
|
|
#else // !WIN32
|
|
|
|
typedef DCB WIN32DCB;
|
|
typedef DCB * LPWIN32DCB;
|
|
|
|
// Keep this until this is defined in the NT SDK copy of mcx.h
|
|
#ifndef MDM_V23_OVERRIDE
|
|
#define MDM_V23_OVERRIDE 0x00000400
|
|
#endif
|
|
|
|
#endif // !WIN32
|
|
|
|
#define COMMCONFIG_VERSION_1 1
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
// Registry forms of the MODEMDEVCAPS and MODEMSETTINGS structures.
|
|
// These should match the ones in unimodem\mcx\internal.h.
|
|
//
|
|
|
|
// The portion of the MODEMDEVCAPS that is saved in the registry
|
|
// as Properties
|
|
typedef struct _RegDevCaps
|
|
{
|
|
DWORD dwDialOptions; // bitmap of supported values
|
|
DWORD dwCallSetupFailTimer; // maximum in seconds
|
|
DWORD dwInactivityTimeout; // maximum in the units specified in the InactivityScale value
|
|
DWORD dwSpeakerVolume; // bitmap of supported values
|
|
DWORD dwSpeakerMode; // bitmap of supported values
|
|
DWORD dwModemOptions; // bitmap of supported values
|
|
DWORD dwMaxDTERate; // maximum value in bit/s
|
|
DWORD dwMaxDCERate; // maximum value in bit/s
|
|
} REGDEVCAPS, FAR * LPREGDEVCAPS;
|
|
|
|
// The portion of the MODEMSETTINGS that is saved in the registry
|
|
// as Default
|
|
typedef struct _RegDevSettings
|
|
{
|
|
DWORD dwCallSetupFailTimer; // seconds
|
|
DWORD dwInactivityTimeout; // units specified in the InactivityScale value
|
|
DWORD dwSpeakerVolume; // level
|
|
DWORD dwSpeakerMode; // mode
|
|
DWORD dwPreferredModemOptions; // bitmap
|
|
} REGDEVSETTINGS, FAR * LPREGDEVSETTINGS;
|
|
|
|
|
|
//
|
|
// DeviceType defines
|
|
//
|
|
|
|
#define DT_NULL_MODEM 0
|
|
#define DT_EXTERNAL_MODEM 1
|
|
#define DT_INTERNAL_MODEM 2
|
|
#define DT_PCMCIA_MODEM 3
|
|
#define DT_PARALLEL_PORT 4
|
|
#define DT_PARALLEL_MODEM 5
|
|
|
|
//------------------------------------------------------------------------
|
|
//------------------------------------------------------------------------
|
|
|
|
#ifdef UNICODE
|
|
#define drvCommConfigDialog drvCommConfigDialogW
|
|
#define drvGetDefaultCommConfig drvGetDefaultCommConfigW
|
|
#define drvSetDefaultCommConfig drvSetDefaultCommConfigW
|
|
#else
|
|
#define drvCommConfigDialog drvCommConfigDialogA
|
|
#define drvGetDefaultCommConfig drvGetDefaultCommConfigA
|
|
#define drvSetDefaultCommConfig drvSetDefaultCommConfigA
|
|
#endif
|
|
|
|
DWORD
|
|
APIENTRY
|
|
drvCommConfigDialog(
|
|
IN LPCTSTR pszFriendlyName,
|
|
IN HWND hwndOwner,
|
|
IN OUT LPCOMMCONFIG pcc);
|
|
|
|
DWORD
|
|
APIENTRY
|
|
drvGetDefaultCommConfig(
|
|
IN LPCTSTR pszFriendlyName,
|
|
IN LPCOMMCONFIG pcc,
|
|
IN OUT LPDWORD pdwSize);
|
|
|
|
DWORD
|
|
APIENTRY
|
|
drvSetDefaultCommConfig(
|
|
IN LPTSTR pszFriendlyName,
|
|
IN LPCOMMCONFIG pcc,
|
|
IN DWORD dwSize);
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
//------------------------------------------------------------------------
|
|
|
|
// These are the flags for MODEM_INSTALL_WIZARD
|
|
#define MIWF_DEFAULT 0x00000000
|
|
#define MIWF_INSET_WIZARD 0x00000001 // hwndWizardDlg must be owner's
|
|
// wizard frame
|
|
#define MIWF_BACKDOOR 0x00000002 // enter wizard thru last page
|
|
|
|
// The ExitButton field can be:
|
|
//
|
|
// PSBTN_BACK
|
|
// PSBTN_NEXT
|
|
// PSBTN_FINISH
|
|
// PSBTN_CANCEL
|
|
|
|
#endif // __MODEMP_H__
|