📄 tspip.h
字号:
BYTE Parity; // DCB
WCHAR szDialModifier[DIAL_MODIFIER_LEN+1]; // Unique to MiniCfg
// Dynamic devices configuration
WCHAR wszDriverName[MAX_NAME_LENGTH+1];
BYTE pConfigBlob[MAX_CFG_BLOB];
HANDLE hPort;
} DEVMINICFG, *PDEVMINICFG;
#define DEVMINCFG_VERSION_0020 0x0020
//
// Version 0x0020 changes:
// - add wszDriverName, pConfigBlob and hPort to support dynamic Bluetooth modem devices
//
#define DIAL_MODIFIER_LEN_0020 40
typedef struct tagDEVMINICFG_0020 {
WORD wVersion;
WORD wWaitBong; // DevCfgHdr
DWORD dwCallSetupFailTimer; // CommConfig.ModemSettings
DWORD dwModemOptions; // CommConfig.ModemSettings
// MDM_BLIND_DIAL MDM_FLOWCONTROL_SOFT
// MDM_CCITT_OVERRIDE MDM_FORCED_EC
// MDM_CELLULAR MDM_SPEED_ADJUST
// MDM_COMPRESSION MDM_TONE_DIAL
// MDM_ERROR_CONTROL MDM_V23_OVERRIDE
// MDM_FLOWCONTROL_HARD
DWORD dwBaudRate; // DCB
WORD fwOptions; // DevCfgHdr
// TERMINAL_PRE TERMINAL_POST
// MANUAL_DIAL
BYTE ByteSize; // DCB
BYTE StopBits; // DCB
BYTE Parity; // DCB
WCHAR szDialModifier[DIAL_MODIFIER_LEN_0020+1]; // Unique to MiniCfg
// Dynamic devices configuration
WCHAR wszDriverName[MAX_NAME_LENGTH+1];
BYTE pConfigBlob[MAX_CFG_BLOB];
HANDLE hPort;
} DEVMINICFG_0020, *PDEVMINICFG_0020;
#define DEVMINCFG_VERSION_0010 0x0010
#define DIAL_MODIFIER_LEN_0010 40
typedef struct tagDEVMINICFG_0010 {
WORD wVersion;
WORD wWaitBong; // DevCfgHdr
DWORD dwCallSetupFailTimer; // CommConfig.ModemSettings
DWORD dwModemOptions; // CommConfig.ModemSettings
// MDM_BLIND_DIAL MDM_FLOWCONTROL_SOFT
// MDM_CCITT_OVERRIDE MDM_FORCED_EC
// MDM_CELLULAR MDM_SPEED_ADJUST
// MDM_COMPRESSION MDM_TONE_DIAL
// MDM_ERROR_CONTROL MDM_V23_OVERRIDE
// MDM_FLOWCONTROL_HARD
DWORD dwBaudRate; // DCB
WORD fwOptions; // DevCfgHdr
// TERMINAL_PRE TERMINAL_POST
// MANUAL_DIAL
BYTE ByteSize; // DCB
BYTE StopBits; // DCB
BYTE Parity; // DCB
WCHAR szDialModifier[DIAL_MODIFIER_LEN_0010+1]; // Unique to MiniCfg
} DEVMINICFG_0010, *PDEVMINICFG_0010;
#define MIN_DEVCONFIG_SIZE (sizeof(DEVMINICFG_0010)-(DIAL_MODIFIER_LEN_0010*sizeof(WCHAR)))
#define MAX_CMD_LENGTH DIAL_MODIFIER_LEN+4
#define DEF_CMD_SEND_DELAY 0
#define MAX_CMD_SEND_DELAY 500
// Line device data structure
//
typedef struct __LineDev {
LIST_ENTRY llist; // pointer to next LineDev
DWORD dwVersion; // Version stamp
DWORD dwDeviceID; // Local device ID
WCHAR szDeviceName[MAXDEVICENAME+1]; // actual device name
WCHAR szFriendlyName[MAXDEVICENAME+1]; // friendly device name
HKEY hSettingsKey; // Registry handle for settings key
WORD wDeviceType; // the modem type
WORD wDeviceAvail; // Is the modem currently available?
DWORD dwPPPMTU; // MTU that PPP will use on this device.
DEVMINICFG DevMiniCfg; // Compact version of Device configuration
DWORD dwDefaultMediaModes; // Default supported media modes
DWORD dwBearerModes; // supported bearer modes
DWORD dwCurBearerModes; // The current media bearer modes. Plural because
// we keep track of PASSTHROUGH _and_ the real b-mode
// at the same time.
DWORD dwMediaModes; // Current supported media modes
DWORD dwCurMediaModes; // The current media modes
DWORD dwDetMediaModes; // The current detection media modes
HANDLE hDynamicPort; // Handle to dynamic port created by RegisterDevice()
HANDLE hDevice; // Device handle
DWORD pidDevice; // Device owner pid
HANDLE hDevice_r0; // ring-0 Device handle
DWORD dwWaitMask;
HTAPILINE htLine; // Tapi line handle
LINEEVENT lpfnEvent; // Line event callback function
HWND hwndLine; // Tapi emulation
WCHAR szAddress[MAXADDRESSLEN+1];
DWORD dwPendingID; // async pending ID
DWORD dwPendingType; // pending operation
DWORD dwPendingStatus; // status of pending op
#ifdef DEBUG
DWORD dwLastPendingOp;
#endif
DWORD dwCallFlags; // Call attributes
HTAPICALL htCall; // TAPI call handle
HWND hwTermCtrl; // TermCtrl Window Handle
HANDLE hTimeoutEvent; // Event Handle for Call Timeout event
DWORD dwCurWatchdog;
HANDLE hCallComplete; // Event Handle for Call Completions
DWORD dwCallState; // Current call state
DWORD dwCallStateMode; // Further details about current call state
DWORD dwNumRings;
CRITICAL_SECTION OpenCS; // Critical Section for DevLineClose
DEVSTATES DevState; // intermediate TAPI device state
MDMSTATE MdmState; // what state is the modem in
DWORD dwDialOptions; // Options set in a lineMakeCall
BOOL fTakeoverMode; // True if unimodem is in takover mode
WCHAR szDriverKey[MAX_CLASS_NAME_LEN+10]; // ex. "Modem\0000"
DWORD dwDevCapFlags; // LINEDEVCAPSFLAGS (ie. DIALBILLING, DIALQUIET, DIALDIALTONE)
DWORD dwMaxDCERate; // Max DCE as stored in the Properties line of the registry
DWORD dwCurrentBaudRate; // Extracted from the CONNECT or CARRIER response
DWORD dwLastBaudRate;
DWORD dwLineStatesMask; // Filter status messages
DWORD dwMaxCmd;
DWORD dwCmdSendDelay; // Time in milliseconds to wait before sending a response to modem
BOOL bWatchdogTimedOut;
BOOL bMdmLogFile; // Control logging of modem command history.
HANDLE hMdmLog; // Modem command history for this device.
//
// Fields used by UnimodemControlThread
//
BOOL bControlThreadRunning;
LPSTR lpstrNextCmd;
WCHAR chContinuation; // Modem command continuation character (usually ';')
} TLINEDEV, *PTLINEDEV;
// Default mask to MDM_ options
//
#define MDM_MASK (MDM_TONE_DIAL | MDM_BLIND_DIAL)
typedef struct _TSPIGLOBALS
{
HINSTANCE hInstance;
DWORD dwProviderID;
HPROVIDER hProvider;
HKEY hDefaultsKey;
LINEEVENT fnLineEventProc; // Line Event callback in TAPI
ASYNC_COMPLETION fnCompletionCallback; // Completion Create callback in TAPI
LIST_ENTRY LineDevs; // Linked List of TLINEDEV
CRITICAL_SECTION LineDevsCS; // Critical section for above list
HICON hIconLine;
BOOL bExternModems;
} TSPIGLOBALS, *PTSPIGLOBALS;
extern TSPIGLOBALS TspiGlobals;
extern const WCHAR szSettings[];
extern const WCHAR szDialSuffix[];
// Some quick macros till we actually implement MemTracking
#define TSPIAlloc( Size ) LocalAlloc( LPTR, Size )
#define TSPIFree( Ptr ) LocalFree( Ptr )
// Default CommMask for SetCommMask/WaitCommEvent
#define EV_DEFAULT (EV_BREAK|EV_CTS|EV_DSR|EV_ERR|EV_RING|EV_RLSD|EV_RXCHAR)
// Routines from config.c
LONG DevSpecificLineConfigEdit(PTLINEDEV pLineDev, PUNIMDM_CHG_DEVCFG pChg);
LONG DevSpecificLineConfigGet(PTLINEDEV pLineDev, PUNIMDM_CHG_DEVCFG pChg);
// Routines from dialer.c
void Dialer(PTLINEDEV pLineDev);
BOOL ModemInit(PTLINEDEV pLineDev);
LPWSTR PendingOpName(DWORD dwPendingOp);
// Helper routines defined in misc.c
void ConvertDevConfig(PDEVMINICFG pInDevMiniCfg, DWORD dwSize, PDEVMINICFG pOutDevMiniCfg);
VOID getDefaultDevConfig(PTLINEDEV ptLineDev, PDEVMINICFG pDevMiniCfg);
void TSPIDLL_Load(void);
PTLINEDEV createLineDev(HKEY hActiveKey, LPCWSTR lpszDevPath, LPCWSTR lpszDeviceName);
PTLINEDEV GetLineDevfromID(DWORD dwDeviceID);
PTLINEDEV GetLineDevfromName(LPCWSTR lpszDeviceName,LPCWSTR lpszFriendlyName);
PTLINEDEV GetLineDevfromHandle (DWORD handle);
PTLINEDEV LineExists( PTLINEDEV ptNewLine);
BOOL ValidateDevCfgClass (LPCWSTR lpszDeviceClass);
DWORD NullifyLineDevice (PTLINEDEV pLineDev, BOOL bDefaultConfig);
LONG DevlineGetDefaultConfig(PTLINEDEV pLineDev);
LONG ValidateAddress( PTLINEDEV pLineDev, LPCWSTR lpszInAddress, LPWSTR lpszOutAddress);
LONG DevlineDial( PTLINEDEV pLineDev );
BOOL DisplayTerminalWindow(PTLINEDEV pLineDev, DWORD dwTitle);
void CallLineEventProc(PTLINEDEV ptLine, HTAPICALL htCall, DWORD dwMsg, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
void CompleteAsyncOp(PTLINEDEV pLineDev);
BOOL StartCompleteAsyncOp(PTLINEDEV pLineDev);
void NewCallState(PTLINEDEV pLineDev,DWORD dwCallState,DWORD dwCallState2);
void InitVarData(LPVOID lpData, DWORD dwSize);
DWORD SetAsyncID(PTLINEDEV pLineDev, DWORD dwID);
void SetAsyncStatus(PTLINEDEV pLineDev, DWORD dwNewStatus);
void SetAsyncOp(PTLINEDEV pLineDev, DWORD dwNewOp);
BOOL IsDynamicDevice(PTLINEDEV pLineDev);
BOOL IsNullModem(PTLINEDEV pLineDev);
#define IS_NULL_MODEM(pLineDev) (IsNullModem(pLineDev))
// Routines from modem.c
LPWSTR GetPendingName(DWORD dwPendingType);
LONG DevlineClose (PTLINEDEV pLineDev, BOOL fDoDrop);
LONG DevlineDetectCall(PTLINEDEV pLineDev);
LONG DevlineDrop(PTLINEDEV pLineDev);
LONG DevlineOpen(PTLINEDEV pLineDev);
LONG ControlThreadCmd(PTLINEDEV pLineDev,DWORD dwPendingOP,DWORD dwPendingID);
// Routines from registry.c
DWORD MdmRegGetValue(PTLINEDEV ptLineDev, LPCWSTR szKeyName, LPCWSTR szValueName,
DWORD dwType, LPBYTE lpData, LPDWORD lpdwSize);
void MdmRegGetLineValues(PTLINEDEV ptLineDev);
void EnumExternModems( void );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -