⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tspip.h

📁 See Hanoi.cpp for the implementation of this cla
💻 H
📖 第 1 页 / 共 2 页
字号:

typedef struct  tagDEVCFG  {
    DEVCFGHDR   dfgHdr;
    COMMCONFIG  commconfig;
}   DEVCFG, *PDEVCFG, FAR* LPDEVCFG;

// In TAPI32, the devcfg structure is passed back to applications, 
// which store it in their address books.  So, in CE TAPI I define
// a compact version of the devcfg that contains all of the fields
// that we care about.  It is this structure that gets returned to
// the apps and stored in the registry.  Then when a lineSetDevConfig
// call occurs, I copy individual fields out of the devMiniCfg into
// the memory resident devcfg.
//
// The comments next to each field indicate which data structure
// they belong to when expanded.

// Note that in the V1 tree the DIAL_MODIFIER_LEN was 20.  I went ahead and
// bumped it to 40 in V2 without changing the wVersion since the dial modifier
// is at the very end and I can't see any scenario where the V1 and V2
// objects could get transposed and cause problems.
#define DEVMINCFG_VERSION 0x0010
#define DIAL_MODIFIER_LEN 40
typedef struct  tagDEVMINICFG  {
    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+1];    // Unique to MiniCfg

        
} DEVMINICFG, *PDEVMINICFG;


// 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?
    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       hDevice;                // Device handle
    DWORD        pidDevice;              // Device owner pid
    HANDLE       hDevice_r0;             // ring-0 Device handle
    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
    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;
    BOOL         bWatchdogTimedOut;
    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;
} TSPIGLOBALS, *PTSPIGLOBALS;
extern TSPIGLOBALS TspiGlobals;

// 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);

// Routines from dialer.c
void Dialer(PTLINEDEV pLineDev);
BOOL ModemInit(PTLINEDEV pLineDev);

// Helper routines defined in misc.c
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);


// 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 EnumExternModems( void );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -