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

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

?? tchmain.c

?? Windows CE下的觸控屏驅(qū)動(dòng)程序源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
    {
        DEBUGMSG(ZONE_INIT | ZONE_WARN,
        	(TEXT("TOUCH:TouchPanelpGetPriority - RegOpenKeyEx(%s) failed %d, using default thread priorities\n"),
            KEYNAME_TOUCH_DRIVER, dwStatus));
        *ThrdPrio = DEFAULT_THREAD_PRIORITY;
        *ThrdHighPrio = DEFAULT_THREAD_HIGH_PRIORITY;
        return;
    }

    dwSize = sizeof(DWORD);
    dwStatus = RegQueryValueEx(
                    hKey,
                    VALNAME_THREAD_PRIO,
                    0,
                    &dwType,
                    (PUCHAR)ThrdPrio,
                    &dwSize
                    );
                    
    if (dwStatus)
    {
        DEBUGMSG(ZONE_INIT | ZONE_WARN,
        	(TEXT("TOUCH:TouchPanelpGetPriority - Failed to get %s value, defaulting to %d\r\n"),
            VALNAME_THREAD_PRIO, DEFAULT_THREAD_PRIORITY));
        *ThrdPrio = DEFAULT_THREAD_PRIORITY;
    }

    dwSize = sizeof(DWORD);
    dwStatus = RegQueryValueEx(
                    hKey,
                    VALNAME_THREAD_HIGH_PRIO,
                    0,
                    &dwType,
                    (PUCHAR)ThrdHighPrio,
                    &dwSize
                    );
                    
    if (dwStatus)
    {
        DEBUGMSG(ZONE_INIT | ZONE_WARN,
        	(TEXT("TOUCH:TouchPanelpGetPriority - Failed to get %s value, defaulting to %d\r\n"),
            VALNAME_THREAD_HIGH_PRIO, DEFAULT_THREAD_HIGH_PRIORITY));
        *ThrdHighPrio = DEFAULT_THREAD_HIGH_PRIORITY;
    }

    RegCloseKey(hKey);

    RETAILMSG(1, (TEXT("TOUCH:ThrdPrio = %d, ThrdHighPrio = %d\n"), *ThrdPrio, *ThrdHighPrio));
    
    return;
}   // TouchPanelpGetPriority


//**********************************************************************
// The following routines provide the exported DDI interface.
// @doc EX_TOUCH_DDI EXTERNAL DRIVERS MDD TOUCH_PANEL
//**********************************************************************



#ifdef DEBUG
PFN_TOUCH_PANEL_SET_CALIBRATION v_pfnSetCalibration = TouchPanelSetCalibration;
#endif


/*++

 @func BOOL | TouchPanelGetDeviceCaps |
 Queries capabilities about the physical touch panel device.

 @parm ULONG | iIndex |
 Specifies the capability to query. They are one of the following:

 @flag DDI_TPDC_SAMPLERATE |
 The sample rate.
 @flag DDI_TPDC_CALIBRATIONPOINTS |
 The X and Y coordinates used for calibration.
 @flag DDI_TPDC_CALIBRATIONDATA |
 The X and Y coordinates used for calibration mapping.
 @flag DDI_TPDC_SAMPLERATE |
 Size of the digitizer panel (X, Y).

 @parm LPVOID | lpOutput |
 Points to the memory location(s) where the queried information
 will be placed. The format of the memory referenced depends on
 the setting of iIndex. If 0, returns the number of words
 required for the output data.

 @rdesc
 The return value is TRUE if the information was retrieved succesfully,
 and FALSE otherwise.
 

--*/
BOOL
TouchPanelGetDeviceCaps(
    INT		iIndex,
    LPVOID  lpOutput
    )
{
    struct TPDC_CALIBRATION_POINT *pTCP;
    BOOL fGotCaps = FALSE;
    

    EnterCriticalSection( &csMutex );

    if( lpOutput != NULL)
    {
        fGotCaps = DdsiTouchPanelGetDeviceCaps(iIndex, lpOutput);

         // We want to remember the screen size for later use.  Some day,
         // we might change this so that screen size is passed in as
         // part of setup.  But for now, it is part of getCalibrationPoint
        if( iIndex == TPDC_CALIBRATION_POINT_ID )
        {
            pTCP = (struct TPDC_CALIBRATION_POINT *)lpOutput;
            DisplayWidth  = pTCP -> cDisplayWidth;
            DisplayHeight = pTCP -> cDisplayHeight;
        }
    }
    
    LeaveCriticalSection( &csMutex );

    return ( fGotCaps );
}
				
#ifdef DEBUG
PFN_TOUCH_PANEL_GET_DEVICE_CAPS v_pfnGetDeviceCaps = TouchPanelGetDeviceCaps;
#endif



/*++

Autodoc Information:

 @func BOOL | TouchPanelSetMode |
 Sets information about the abstract touch panel device.

 @parm ULONG | iIndex |
 Specifies the mode to set. They are one of the following:

 @flag DDI_TPSM_SAMPLERATE_HIGH |
 Set the sample rate to the high rate.

 @flag DDI_TPSM_SAMPLERATE_LOW |
 Set the sample rate to the low rate.

 @parm LPVOID | lpInput |
 Points to the memory location(s) where the update information
 resides. The format of the memory referenced depends on the
 mode.
 
 @rdesc
 If the function succeeds the return value is TRUE, otherwise, it is FALSE.
 Extended error information is available via the GetLastError function.

--*/
BOOL
TouchPanelSetMode(
	INT		iIndex,
	LPVOID	lpInput
    )
{
	BOOL	ReturnValue = TRUE;  // Assume it worked until someone says othewise

    EnterCriticalSection( &csMutex );
    switch( iIndex )
    {
        // The thread priority functions were provided so that OOM could
        // raise our priority as needed.
        case TPSM_PRIORITY_HIGH_ID:
			// Set the flag so that no more points are send to transcriber while system in OOM state.
			_bTchThreadHighPriority = TRUE;
            CeSetThreadPriority (hThread, gThreadHighPriority);
            break;
            
        case TPSM_PRIORITY_NORMAL_ID:
            CeSetThreadPriority (hThread, gThreadPriority);
			// We are no longer in OOM state.
			_bTchThreadHighPriority = FALSE;
            break;
            
        default:
            // If we can't handle it, give the PDD a chance
            ReturnValue = DdsiTouchPanelSetMode(iIndex, lpInput);
            break;
    }
    LeaveCriticalSection( &csMutex );
    
    return ( ReturnValue );
}


#ifdef DEBUG
PFN_TOUCH_PANEL_SET_MODE v_pfnSetMode = TouchPanelSetMode;
#endif



/*++

 @func VOID | TouchPanelPowerHandler |
 System power state notification.

 @parm BOOL | bOff | TRUE, the system is powering off; FALSE, the system is powering up.

 @comm
 This routine is called in a kernel context and may not make any system 
 calls whatsoever.  It may read and write its own memory and that's about 
 it.

--*/
void
TouchPanelPowerHandler(
	BOOL	bOff
	)
{
    DdsiTouchPanelPowerHandler( bOff );
	return;
}

#ifdef DEBUG
PFN_TOUCH_PANEL_POWER_HANDLER v_pfnPowerHandler = TouchPanelPowerHandler;
#endif


/*++

 @func BOOL | TouchPanelEnable |
 Powers up and initializes the touch panel for operation.

 @rdesc
 If the function succeeds, the return value is TRUE; otherwise, it is FALSE.

 @comm
 Following the call to this function the touch panel device generates
 pen tip events and samples.

--*/
BOOL
TouchPanelEnable(
	PFN_TOUCH_PANEL_CALLBACK	pfnCallback
    )
{
    BOOL    ReturnValue;

     //
     // Do the 'attach' code.  Normally, this would have been
     // done in the ThreadAttach block, but this driver is set
     // up to be statically linked to GWE, in which case none of
     // the DLL related calls would even be invoked.
     //
    TouchPanelpAttach();

    EnterCriticalSection( &csMutex );

    //
    // Insure the device is disabled and no one is attached to the logical
    // interrupt.
    // Power on the device.
    // Connect the logical interrupt to the device.
    //

    InterruptDone( gIntrTouch );
    InterruptDisable( gIntrTouch );
	if( SYSINTR_NOP != gIntrTouchChanged ) {
	    InterruptDone( gIntrTouchChanged );
    	InterruptDisable( gIntrTouchChanged );
	}

    v_pfnCgrPointCallback = pfnCallback;
    if (v_pfnCgrCallback != NULL)
	v_pfnPointCallback = v_pfnCgrCallback;
    else
        v_pfnPointCallback = pfnCallback;

    ReturnValue = DdsiTouchPanelEnable();

    if (ReturnValue && !InterruptInitialize(gIntrTouch, hTouchPanelEvent, NULL, 0)) {
		DEBUGMSG(ZONE_ERROR, (TEXT("TouchPanelEnable: InterruptInitialize(gIntrTouch %d failed\r\n"),
                              gIntrTouch));
		DdsiTouchPanelDisable();
		ReturnValue = FALSE;
    }
    if ( ( SYSINTR_NOP != gIntrTouchChanged ) &&
    	ReturnValue && !InterruptInitialize( gIntrTouchChanged, hTouchPanelEvent, NULL, 0)) {
		DEBUGMSG(ZONE_ERROR, (TEXT("TouchPanelEnable: InterruptInitialize(gIntrTouchChanged %d failed\r\n"),
                              gIntrTouchChanged));
        InterruptDisable(gIntrTouch);
		DdsiTouchPanelDisable();
		ReturnValue = FALSE;
    }
	if (ReturnValue) {
	    // Create the ISR thread.  If creation fails, perform cleanup and return failure.
	    //
		if (!(hThread = CreateThread( NULL, 0, TouchPanelpISR, 0, 0, NULL))) {
	        TouchPanelpDetach();
	        InterruptDisable(gIntrTouch);
			if( SYSINTR_NOP != gIntrTouchChanged )
		        InterruptDisable(gIntrTouchChanged);
			DdsiTouchPanelDisable();
    	    ReturnValue = FALSE;
	    } else {
	    	// Get thread priority from registry
	    	TouchPanelpGetPriority(&gThreadPriority, &gThreadHighPriority);
	    	
		    // Set our interrupt thread's priority
		    CeSetThreadPriority(hThread, gThreadPriority);
		}
	}
    LeaveCriticalSection(&csMutex);
    return(ReturnValue);
}
#ifdef DEBUG
PFN_TOUCH_PANEL_ENABLE v_pfnEnableTest = TouchPanelEnable;
#endif





/*++

 @func BOOL | TouchPanelDisable |
 Powers down the touch panel. Following the call to this function
 the touch panel device no longer generates pen tip events or samples.

 @rdesc
 If the function succeeds, the return value is TRUE; otherwise, it is FALSE.

 @comm
 Following the call to this function the touch panel device no longer
 generates pen tip events or samples.


--*/
VOID
TouchPanelDisable(
    VOID
    )
{
    EnterCriticalSection( &csMutex );

    DdsiTouchPanelDisable();                // power off the panel.
    InterruptDone( gIntrTouch );         // Unregister the logical interrupt.
    InterruptDisable( gIntrTouch );
	if( SYSINTR_NOP != gIntrTouchChanged ) {
	    InterruptDone( gIntrTouchChanged ); // Unregister the logical interrupt.
	    InterruptDisable( gIntrTouchChanged );
	}
    hThread = NULL;

    if ( hTouchPanelEvent )
    {
        //
        // We created the touch panel event:
        //  close the event handle
        //  reset our bookkeeping information
        //

        CloseHandle( hTouchPanelEvent );
        hTouchPanelEvent = NULL;
    }

    if ( hCalibrationSampleAvailable )
    {
        //
        // We created the calibration sample available event:
        //  close the event handle
        //  reset our bookkeeping information
        //

        CloseHandle( hCalibrationSampleAvailable );
        hCalibrationSampleAvailable = NULL;
    }

    LeaveCriticalSection( &csMutex );

    DeleteCriticalSection( &csMutex );
}

#ifdef DEBUG
PFN_TOUCH_PANEL_DISABLE v_pfnDisableTest = TouchPanelDisable;
#endif


/*++

 @func VOID | TouchPanelReadCalibrationPoint |
 Initates the process of getting a calibration point.  This function
 causes the device driver to foward the last valid x and y coordinates
 between the tip states of initial down and up to the calibration callback
 function. The tip state of the forwarded coordinates is reported as
 initial down.

 @parm LONG | UcalX |
 The uncalibrated X coordinate under calibration.
 @parm LONG | UcalY |
 The uncalibrated Y coordinate under calibration.

 @rdesc
 If the function succeeds, TRUE; otherwise FALSE. Extended error information
 is available via the GetLastError function.


--*/
BOOL
TouchPanelReadCalibrationPoint(
	INT	*pRawX,
    INT	*pRawY
    )
{
	BOOL	retval;


    if(!pRawX  || !pRawY ) {
    	SetLastError(ERROR_INVALID_PARAMETER);        
    	return ( FALSE ) ;
    }
    
    EnterCriticalSection( &csMutex );

    //
    // If a calibration is already active, error.
    //

    if ( CalibrationState )
    {
        SetLastError( ERROR_POSSIBLE_DEADLOCK );
    	LeaveCriticalSection( &csMutex );
        return ( FALSE );
    }

    //
    // Set sample count and active flag.
    // Wait for calibration to happen.
	// Update the memory with the x and y coordinates.
    // Clear active flag.
    // We be done.
    CalibrationState = CalibrationWaiting;

    LeaveCriticalSection( &csMutex );

    WaitForSingleObject( hCalibrationSampleAvailable, INFINITE );
    EnterCriticalSection( &csMutex );

	*pRawX = lCalibrationXCoord;
	*pRawY = lCalibrationYCoord;

	retval = ( CalibrationState == CalibrationValid );
    CalibrationState = CalibrationInactive;

    LeaveCriticalSection( &csMutex );

    return retval;
}
#ifdef DEBUG
PFN_TOUCH_PANEL_READ_CALIBRATION_POINT v_pfnReadCalibrationPointTest = TouchPanelReadCalibrationPoint;
#endif

/*++

 @func VOID | TouchPanelReadCalibrationAbort |
 Aborts the currently active <f TouchPanelCalibratePoint>.

 @rdesc
 If the function succeeds, TRUE; FALSE is returned if there is no active
 <f TouchPanelCalibrateAPoint> in progress.

--*/
VOID
TouchPanelReadCalibrationAbort(
	VOID
    )
{
    EnterCriticalSection( &csMutex );

	if ( ( CalibrationState == CalibrationValid ) ||
		 ( CalibrationState == CalibrationInactive ) )
	{
		LeaveCriticalSection( &csMutex );
		return;
	}

	CalibrationState = CalibrationAborted;

    SetEvent( hCalibrationSampleAvailable );

	LeaveCriticalSection( &csMutex );

	return;
}
#ifdef DEBUG
PFN_TOUCH_PANEL_READ_CALIBRATION_ABORT v_pfnCalibrationPointAbortTest = TouchPanelReadCalibrationAbort;
#endif


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天操天天色综合| 国产在线不卡一区| 亚洲黄色小视频| 欧美丰满美乳xxx高潮www| 国产一区二区中文字幕| 一区二区高清免费观看影视大全| 欧美不卡视频一区| 91久久国产最好的精华液| 国产麻豆欧美日韩一区| 视频一区视频二区中文| 综合久久久久久| 久久亚洲春色中文字幕久久久| 在线免费观看日本一区| 国产精品一区不卡| 免费av成人在线| 亚洲狠狠丁香婷婷综合久久久| 久久久电影一区二区三区| 91精品国产免费| 欧美日免费三级在线| 91丨porny丨户外露出| 国产剧情一区二区| 蜜臀久久久99精品久久久久久| 亚洲一区在线视频| 国产精品传媒在线| 国产偷v国产偷v亚洲高清| 欧美精品国产精品| 欧美最新大片在线看| 不卡的看片网站| 国产成人精品一区二区三区四区 | 国产精品99久久久久久久vr| 丝袜诱惑亚洲看片| 一区二区国产视频| 亚洲精品乱码久久久久久久久 | 在线观看亚洲a| 91色|porny| 97久久精品人人澡人人爽| 国产成人在线网站| 国产精品一二三在| 国产综合一区二区| 国产精品中文欧美| 国产大陆a不卡| 风流少妇一区二区| 成人高清视频免费观看| 成人一区二区三区| proumb性欧美在线观看| 99久久伊人网影院| 91在线视频观看| 色菇凉天天综合网| 欧美最猛黑人xxxxx猛交| 欧美色精品在线视频| 制服丝袜亚洲播放| 欧美精品第1页| 欧美成人精品1314www| 久久影院视频免费| 国产色一区二区| 亚洲欧美怡红院| 亚洲成人自拍网| 蜜桃视频在线观看一区二区| 蜜臀国产一区二区三区在线播放| 精品在线一区二区三区| 国产超碰在线一区| 99精品视频一区二区| 欧美日韩精品免费| 精品免费国产二区三区| 国产精品你懂的| 亚洲综合精品自拍| 久久99最新地址| 成人av电影免费观看| 欧美天堂一区二区三区| 欧美大片一区二区| 中文字幕精品综合| 亚洲福利电影网| 精品一区二区精品| 91免费版pro下载短视频| 欧美性色aⅴ视频一区日韩精品| 欧美巨大另类极品videosbest| 日韩欧美高清dvd碟片| 国产亚洲欧洲997久久综合| 中文字幕电影一区| 偷拍日韩校园综合在线| 国产成人自拍网| 欧美日韩国产精品成人| 久久综合九色综合欧美98| 亚洲日本在线看| 美女视频免费一区| 91麻豆国产福利在线观看| 欧美一区二区视频网站| 中文字幕一区日韩精品欧美| 日韩中文字幕91| 成人av网址在线| 欧美一区午夜精品| 亚洲女与黑人做爰| 狠狠色狠狠色合久久伊人| 色8久久人人97超碰香蕉987| 欧美mv和日韩mv的网站| 亚洲男同1069视频| 激情欧美一区二区| 欧美日韩在线免费视频| 国产精品久久久久久久久免费相片| 日本中文字幕一区二区视频 | 青草av.久久免费一区| 99re这里都是精品| xvideos.蜜桃一区二区| 一区二区三区高清在线| 国产老妇另类xxxxx| 欧美日韩一区二区在线观看视频| 欧美国产成人在线| 精品一区二区三区不卡| 欧美日韩国产a| 最近中文字幕一区二区三区| 国产高清久久久| 日韩一区二区三区观看| 亚洲一区二区三区中文字幕 | 精品伦理精品一区| 亚洲va韩国va欧美va| 99国产精品一区| 国产色婷婷亚洲99精品小说| 奇米影视在线99精品| 欧美视频日韩视频| 国产精品毛片无遮挡高清| 黄一区二区三区| 日韩手机在线导航| 亚洲一区二区欧美激情| 在线免费观看不卡av| 中文字幕在线不卡视频| 成人午夜大片免费观看| 久久精品亚洲精品国产欧美 | 成人18视频日本| 久久精品视频在线看| 另类专区欧美蜜桃臀第一页| 337p亚洲精品色噜噜噜| 亚洲国产视频网站| 在线精品视频小说1| 亚洲欧美日韩人成在线播放| 成人午夜短视频| 国产精品不卡在线观看| k8久久久一区二区三区| 自拍偷拍亚洲激情| 97久久精品人人做人人爽50路| 国产精品久久福利| 99久久亚洲一区二区三区青草| 中文字幕国产精品一区二区| 国产99久久久精品| 中文字幕一区二区三中文字幕| 成人福利视频在线| 亚洲精品网站在线观看| 欧美在线免费观看视频| 亚洲国产综合色| 欧美日韩色综合| 男人的j进女人的j一区| 精品国产123| 国产91精品精华液一区二区三区| 国产精品色婷婷久久58| 99久久国产综合精品女不卡| 综合久久给合久久狠狠狠97色| 色成年激情久久综合| 亚洲第一福利视频在线| 日韩视频一区二区三区| 国产专区综合网| 国产精品久久午夜夜伦鲁鲁| 一本大道久久精品懂色aⅴ| 亚洲综合色自拍一区| 日韩一区二区三区在线视频| 国产精品中文字幕日韩精品 | 精品国产人成亚洲区| 国产精品99久久久| 亚洲蜜臀av乱码久久精品| 欧美日韩在线亚洲一区蜜芽| 老色鬼精品视频在线观看播放| 久久精品一区蜜桃臀影院| 91麻豆自制传媒国产之光| 亚洲电影第三页| 久久综合999| 在线精品国精品国产尤物884a| 奇米888四色在线精品| 亚洲国产高清在线观看视频| 欧美综合久久久| 久久99久久久久久久久久久| 国产精品乱码人人做人人爱| 色天使久久综合网天天| 久久黄色级2电影| 亚洲欧美在线另类| 91精品国产91久久综合桃花 | 色欧美88888久久久久久影院| 三级久久三级久久久| 亚洲国产高清不卡| 欧美日韩精品一区二区三区四区| 国产高清不卡一区二区| 亚洲大片一区二区三区| 国产午夜久久久久| 欧美日韩一区二区在线观看 | 日韩高清不卡一区二区三区| 中日韩av电影| 日韩一级二级三级精品视频| 91香蕉视频黄| 国产一区二区精品久久| 亚洲图片欧美综合| 国产精品久久午夜| 26uuu久久天堂性欧美| 欧美精品aⅴ在线视频|