亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? udmain.c

?? 工業(yè)組態(tài)軟件modbus驅(qū)動源代碼, 包括幫助文件.共享.
?? C
?? 第 1 頁 / 共 4 頁
字號:
    This function is called when a Topic is being activated.
    If the topic name is valid, a data structure representing
    the topic will be constructed. **/

HLOGDEV
WINAPI
ProtAllocateLogicalDevice(LPSTR lpszTopic, IDLDEV idLogDev)
{
    LPSTNPARAM      lpStnParam;
    LPPORT          lpPort;
    LPSTAT          lpTopic;
    HLOGDEV         hLogDev;

    /* initialize return value */
    hLogDev = (HLOGDEV) NULL;
    /* attempt to allocate structure and lock it */
    lpStnParam = (LPSTNPARAM) wwHeap_AllocPtr(hHeap,
                                              GMEM_MOVEABLE | GMEM_ZEROINIT,
                                              (DWORD) sizeof(STNPARAM));
    if (lpStnParam == (LPSTNPARAM) NULL) {
        /* unable to allocate or lock structure, indicate error */
        MessageBox(GetFocus(),
               GetString(STRUSER + 77)  /* "No Memory for Topic Info" */ ,
               GetAppName(),
               MB_ICONEXCLAMATION | MB_OK);
        return (HLOGDEV) NULL;
    }
    /*
     * ValidateTopic() will check the topic name for validity and if OK
     * will return the pertinent information about the topic in the data
     * structure *lpStnParam.
     */

    if (ValidateTopic(lpszTopic, lpStnParam)) {

        /* Node (Topic) name is ok, param block has been filled-in */

        /* attempt to find an available port structure */
        lpPort = UdprotFindPort(lpStnParam);
        if (lpPort == (LPPORT) NULL) {
            /* Port doesn't already exist, so build one */
            lpPort = UdprotSetupPort(lpStnParam);
        }

        if (lpPort != (LPPORT) NULL) {
            /* port structure available, set up PORT and TOPIC */

            /* Set up some fields in the PORT data structure */
            lpPort->mbReplyTime = lpStnParam->spReplyTimeout * 1000;

            /* Create or initialize the TOPIC data structure */
            lpTopic = UdprotSetupTopic(lpPort, lpStnParam, idLogDev, lpszTopic);
            if (lpTopic != (LPSTAT) NULL) {
                /* This will be the handle returned for future use */
                hLogDev = (HLOGDEV) lpTopic;
            }
        }
        /** At this point, if the port wasn't found to exist already and
            it wasn't created by the preceeding logic, we will fail
            by virtue of the fact that hLogDev is NULL. **/
    }
    /* unlock and free the memory we used */
    wwHeap_FreePtr( hHeap, lpStnParam);
    /* update client display */
    DumpScreen();

#ifdef DEBUG_CALL_TRAFFIC
    if (Verbose)
        debug("ProtAllocateLogicalDevice( \"%Fs\", %04X ) => %8lX",
              lpszTopic, idLogDev, hLogDev);
#endif

    /* if successful, increment the count of allocated devices */
    if (hLogDev != (HLOGDEV) NULL) {
        ++iAllocatedDevices;
    }
    /* return handle to device, if any */
    return hLogDev;
} /* ProtAllocateLogicalDevice */

/***********************************************************************/
/** Free logical device.
    Called when no active points remain on a topic.
    The data structures associated with the topic should be deleted. **/

BOOL
WINAPI
ProtFreeLogicalDevice(HLOGDEV hLogDev)
{
    LPPORT          lpPort;

#ifdef DEBUG_CALL_TRAFFIC
    if (Verbose)
        debug("ProtFreeLogicalDevice( %8lX ) => TRUE", hLogDev);
#endif

    /* unchain this station, get handle to port */
    lpPort = UdprotUnchainTopic((LPSTAT) hLogDev);

    /* attempt to free the station */
    if (UdprotFreeTopic((LPSTAT) hLogDev) != (LPSTAT) NULL) {
        ASSERT_ERROR;
    }
    /* decrement the count of allocated devices */
    --iAllocatedDevices;

    /* free the port associated with this device */
    if (lpPort != (LPPORT) NULL) {
        if (lpPort->mbTopicList.first_item.ptr == NULL) {
            lpPort = UdprotUnchainPort(lpPort);
            if (lpPort != (LPPORT) NULL) {
                UdprotFreePort(lpPort);
            }
        }
    }
    /* update client display */
    DumpScreen();
    /* indicate success */
    return (TRUE);
} /* ProtFreeLogicalDevice */

/***********************************************************************/
/** Create a point
    Called when a new point name is to be added
    to the collection of points being handled on a topic **/

HPROT
WINAPI
ProtCreatePoint(HLOGDEV hLogDev,  /* Topic of item */
                HDB hDb,          /* Handle to use later */
                LPSTR lpszName,   /* Item name */
                LPPTTYP lpPtType) /* Pointer to item type return variable */
{
    unsigned long   SymHandle;
    LPSTAT          lpTopic;
    PPS             pps;

    /* indicate error if node or DB handle is NULL */
    assert(hLogDev);
    assert(hDb);

    /* get station structure */
    lpTopic = (LPSTAT) hLogDev;
    if (lpTopic == (LPSTAT) NULL) {
        /* unable to access structure, indicate error */
        return (HPROT) NULL;
    }

    /*
     * Check first for the reserved point name "STATUS" which
     * represents the health of the node.  It will be handled specially.
     * This item indicates TRUE when the protocol is successfully
     * gathering data for this topic.  An error condition that cannot
     * be recovered and affects all points for this logical device
     * should result in a FALSE status being sent to the Toolkit.
     * The client can use this to show an alarm condition.  In this
     * example an HPROT of 0xFFFF will indicate the status item.
     */

    if (lstrcmpi("STATUS", lpszName) == 0) {
        /* STATUS, save DB handle, return STATUS point type and handle */
        lpTopic->statHdbStatus = hDb;
        *lpPtType = PTT_DISCRETE;   /* Return the point type */
        return (HPROT_STATUS);      /* HPROT reserved for status */
    }

    /*
     * Validate point will check the point name.  If OK, it will return
     * all of the pertinent information about the point the the data
     * structure *pps.
     */

    if (!ValidatePoint(lpszName, (LPPPS) &pps)) {
        /*
         * Point name not valid.
         * Return NULL as an error indication.
         */

#ifdef DEBUG_CALL_TRAFFIC
        if (Verbose)
            debug("ProtCreatePoint( %8lX, %8lX, \"%Fs\" ) => NULL (invalid point name)",
                  hLogDev, hDb, lpszName);
#endif
        return (HPROT) NULL;
    }

    /** Point name is valid.  Set up a symbol table entry for the point.
        Symbol handle is symbol table index + SYM_OFFSET. **/
    SymHandle = UdprotAddSymbol(lpTopic, (LPPPS) &pps, hDb);
    if (SymHandle == 0) {
        /*
         * Couldn't set up a symbol table entry.
         * Return NULL as an error indicator.
         */
        return (HPROT) NULL;
    }

    /* Success setting up the point's symbol table entry. */
    *lpPtType = pps.ppsDdeType;       /* Return the point type */

#ifdef DEBUG_CALL_TRAFFIC
    if (Verbose)
        debug("ProtCreatePoint( %8lX, %8lX, \"%Fs\" ) => %04X (type: %d)",
              hLogDev, hDb, lpszName, SymHandle, *lpPtType);
#endif

    /* return handle based on symbol table index */
    return (SymHandle);  /* Return hProt (index+SYM_OFFSET) for later use */
} /* ProtCreatePoint */

/***********************************************************************/
/** Activate a point.
    Called when a point must be added to the g roup of points being
    polled regularly.  All of the necessary information has already
    been set up in the symbol table entry identified by hProt.
    The topic is identified by hLogDev. **/

BOOL
WINAPI
ProtActivatePoint(HLOGDEV hLogDev,
                  HPROT   hProt)
{
    BOOL            success = TRUE;
    LPSTAT          lpTopic;
    SYMPTR          lpSymEnt;
    unsigned long   SymIndex;

    /* indicate error if either logical device or handle is NULL */
    assert(hLogDev);
    assert(hProt);

    /* get pointer to the station structure */
    lpTopic = (LPSTAT) hLogDev;
    if (lpTopic == (LPSTAT) NULL) {
        /* unable to access structure, indicate error */
        return FALSE;
    }

    /*
     * Check first whether this is the "STATUS" point.
     * It is associated with the reserved hProt of HPROT_STATUS
     */

    if (hProt == HPROT_STATUS) {
       /* STATUS point */
       if (lpTopic->statHdbStatus == (HDB)NULL) {
            /* DB handle not set, cannot poll the point */
            success = FALSE;
        } else {
            /* DB handle set, indicate point active and due for update */
            lpTopic->statStatusActive = TRUE;
            lpTopic->statStatusDue = TRUE;
            success = TRUE;
        }
        return success;
    }

    /* not STATUS, check for valid handle */
    if (hProt < SYM_OFFSET) {
        /* invalid handle, indicate error */
        return FALSE;
    }

    /* get symbol table index based on handle */
    SymIndex = (unsigned long) (hProt - SYM_OFFSET);

    /* get pointer to point's symbol table entry */
    lpSymEnt = (SYMPTR) GetExtArrayMemberPtr (&lpTopic->statSymTab, SymIndex);
    if (lpSymEnt == (SYMPTR) NULL) {
        /* indicate error if no symbol table or out of range */
        success = FALSE;
    } else {
        /* check whether point is already active */
        if (!lpSymEnt->msActive) {
            /* not active, prepare to activate point */
            /*
             * Add the point to an existing poll message if possible.
             * If not possible, build another poll message.
             */
            success = UdprotAddPoll(lpTopic, lpSymEnt);
            if (success) {
                /* set point active status in symbol table */
                lpSymEnt->msActive = TRUE;
            }
        }
    }

    /* update screen */
    DumpScreen();

#ifdef DEBUG_CALL_TRAFFIC
    if (Verbose)
        debug("ProtActivatePoint( %8lX, %8lX ) => %d",
              hLogDev, hProt, (int) success);
#endif
    /* return TRUE if successful */
    return (success);
} /* ProtActivatePoint */

/***********************************************************************/
/** Send a new value to the device.
    Called when a new value must be written
    via the protocol to the point. **/

BOOL
WINAPI
ProtNewValueForDevice(HLOGDEV hLogDev,  /* Identifies the topic   */
                      HPROT hProt,      /* Identifies which item  */
                      PTVALUE ptValue)  /* New value for the item */
{
    unsigned long   SymIndex;
    LPSTAT          lpTopic;
    SYMPTR          lpSymEnt;
    BOOL            Ok = FALSE;

    /* indicate error if either logical device or handle is NULL */
    assert(hLogDev);
    assert(hProt);

    /* First check whether this is the special STATUS point */
    if (hProt == HPROT_STATUS) {
        /* STATUS point -- value is read only */
        return FALSE;
    }

    /* not STATUS, get pointer to station data structure */
    lpTopic = (LPSTAT) hLogDev;
    if (lpTopic == (LPSTAT) NULL) {
        /* unable to access structure, indicate error */
        return FALSE;
    }

    /* check for valid handle */
    if (hProt < SYM_OFFSET) {
        /* invalid handle, indicate error */
        return FALSE;
    }

    /* get symbol table index based on handle */
    SymIndex = (unsigned long) (hProt - SYM_OFFSET);

    /* get pointer to point's symbol table entry */
    lpSymEnt = (SYMPTR) GetExtArrayMemberPtr (&lpTopic->statSymTab, SymIndex);
    if (lpSymEnt == (SYMPTR) NULL) {
        /* indicate error if no symbol table or out of range */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
热久久免费视频| 精品国产乱码久久久久久免费 | 久久久国际精品| 亚洲va在线va天堂| 成人性生交大片免费看在线播放 | 亚洲欧洲精品天堂一级| 午夜日韩在线电影| 日本韩国精品一区二区在线观看| 精品国产污污免费网站入口| 亚洲香蕉伊在人在线观| 91美女片黄在线| 中文字幕乱码日本亚洲一区二区| 美女视频免费一区| 6080日韩午夜伦伦午夜伦| 亚洲猫色日本管| 粉嫩欧美一区二区三区高清影视 | 99国产精品一区| 欧美国产综合一区二区| 国产乱子伦视频一区二区三区 | 精品国产一区久久| 蜜臀av一区二区在线免费观看| 色婷婷狠狠综合| 亚洲精品日韩一| 一本一道综合狠狠老| 亚洲视频 欧洲视频| 91久久精品一区二区三区| 亚洲欧美在线另类| 97se狠狠狠综合亚洲狠狠| 国产欧美精品一区二区色综合 | 懂色av一区二区夜夜嗨| 欧美午夜精品久久久久久孕妇| 亚洲欧美日韩国产一区二区三区| 欧美另类高清zo欧美| 日本中文字幕一区二区视频 | 成人午夜在线视频| 18欧美亚洲精品| 91精品福利在线| 亚洲6080在线| 久久久久久电影| 91香蕉视频黄| 麻豆国产精品官网| 久久精品一区四区| 91国偷自产一区二区使用方法| 亚洲自拍都市欧美小说| 日韩欧美中文字幕一区| 成人天堂资源www在线| 一二三区精品福利视频| 精品久久久久香蕉网| 91在线porny国产在线看| 午夜精彩视频在线观看不卡| 久久影院午夜片一区| 色婷婷综合视频在线观看| 日本怡春院一区二区| 亚洲男女一区二区三区| 久久毛片高清国产| 欧美色男人天堂| 国产精品一二三四五| 亚洲福利一二三区| 中文字幕一区二区三区在线播放 | 中文字幕中文字幕中文字幕亚洲无线| 91视频观看视频| 国内精品伊人久久久久av影院| 亚洲精品国产视频| 久久五月婷婷丁香社区| 欧美日韩午夜影院| 91蝌蚪porny| 丁香婷婷综合五月| 一区二区三区精品视频| 日韩欧美成人一区二区| 欧美老年两性高潮| 欧美午夜精品电影| av欧美精品.com| 国产麻豆成人精品| 久久99精品久久久久久动态图 | 日本不卡的三区四区五区| 亚洲啪啪综合av一区二区三区| 欧美激情综合五月色丁香小说| 欧美本精品男人aⅴ天堂| 欧美一区二区美女| 91精品国产91久久久久久一区二区 | 久久久精品欧美丰满| 精品欧美黑人一区二区三区| 777欧美精品| 欧美一级专区免费大片| 欧美一区二区在线免费播放| 91精品欧美福利在线观看| 色综合久久久久| 在线观看91视频| 91精品国产综合久久香蕉的特点| 91精品国产乱| 精品国产精品网麻豆系列| 久久精品亚洲一区二区三区浴池| 久久久国产午夜精品| 中文字幕在线不卡| 午夜国产精品一区| 国产综合色产在线精品| www.日韩大片| 欧美一区三区四区| 久久午夜免费电影| 亚洲日本一区二区| 日韩av在线发布| 成人性生交大合| 欧美视频一区二| 精品久久久久久久一区二区蜜臀| 欧美激情一区二区在线| 午夜久久电影网| 大胆欧美人体老妇| 欧美一区二区福利在线| 国产精品婷婷午夜在线观看| 亚洲国产中文字幕| 日本一道高清亚洲日美韩| 日产国产欧美视频一区精品| 精品一区二区av| 欧美系列日韩一区| 国产欧美中文在线| 青青草国产精品97视觉盛宴| 99精品视频在线观看| 欧美mv和日韩mv国产网站| 亚洲女性喷水在线观看一区| 久久国产精品区| 欧美日韩久久一区| 亚洲欧美一区二区在线观看| 国产另类ts人妖一区二区| 欧美丝袜丝交足nylons图片| 国产精品久久久久久福利一牛影视| 免费高清成人在线| 欧美久久久久久久久久| 亚洲欧美日韩电影| 国产suv精品一区二区三区| 日韩精品一区二区三区视频| 亚洲mv大片欧洲mv大片精品| 色香色香欲天天天影视综合网| 日本一区二区三区四区| 蜜臀久久99精品久久久画质超高清 | 亚洲一级片在线观看| 91丝袜美女网| 中文字幕在线一区免费| 成人综合日日夜夜| 亚洲国产高清在线观看视频| 国产在线播放一区二区三区| 日韩欧美国产电影| 久久国产精品免费| 2023国产精华国产精品| 国产精品99久久久久| 国产亚洲一二三区| 99久久精品国产导航| 亚洲精品久久久久久国产精华液| 色婷婷综合久久久中文字幕| 一区二区三区资源| 欧美一区二区大片| 国产一区二区看久久| 国产精品久99| 色久综合一二码| 日韩av一级片| 久久久精品综合| 一本大道av伊人久久综合| 天堂成人免费av电影一区| 日韩一区二区三区四区| 亚洲精品中文在线| 97久久超碰国产精品| 亚洲成人手机在线| 久久久精品影视| 欧美少妇xxx| 国产酒店精品激情| 亚洲影视在线观看| 国产午夜亚洲精品午夜鲁丝片| 色婷婷国产精品综合在线观看| 日韩中文字幕麻豆| 国产精品女上位| 精品毛片乱码1区2区3区| 91麻豆自制传媒国产之光| 蜜臀av性久久久久av蜜臀妖精| 亚洲欧洲av一区二区三区久久| 日韩美一区二区三区| 日本久久电影网| 成人手机在线视频| 久久av老司机精品网站导航| 亚洲欧洲成人精品av97| 91麻豆精品久久久久蜜臀| 99精品热视频| 春色校园综合激情亚洲| 久久成人综合网| 亚洲电影一区二区| 中文字幕一区免费在线观看| 久久日韩粉嫩一区二区三区| 91精品国产乱| 欧洲av在线精品| 色综合久久88色综合天天6 | 精品国产成人系列| 7777精品伊人久久久大香线蕉 | 亚洲品质自拍视频网站| 国产日韩精品视频一区| 精品福利av导航| 欧美变态凌虐bdsm| 日韩欧美一级精品久久| 91精品婷婷国产综合久久 | 国产精品人成在线观看免费| 精品国产91久久久久久久妲己| 欧美电影免费观看高清完整版在线观看 | 中文字幕一区二区在线观看|