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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tchmain.c

?? 觸摸屏驅動源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
    {
        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


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re热这里只有精品视频| 欧美国产日韩一二三区| 亚洲精品一区二区三区在线观看| 中文字幕乱码一区二区免费| 亚洲bt欧美bt精品| 国产**成人网毛片九色| 欧美精品日日鲁夜夜添| 国产精品免费久久| 紧缚奴在线一区二区三区| 欧美色欧美亚洲另类二区| 国产精品国产成人国产三级 | 日本道色综合久久| 日韩欧美久久一区| 亚洲香肠在线观看| 91亚洲国产成人精品一区二三 | 欧美性做爰猛烈叫床潮| 中文字幕第一区综合| 久久99精品久久久久久国产越南 | 亚洲久草在线视频| 成人午夜视频在线| 国产丝袜在线精品| 九九九精品视频| 日韩欧美在线影院| 裸体一区二区三区| 欧美精品vⅰdeose4hd| 午夜久久福利影院| 欧美色成人综合| 亚洲一区二区在线免费观看视频| eeuss鲁片一区二区三区在线看| 久久综合久久综合久久综合| 青青草一区二区三区| 91精品久久久久久蜜臀| 亚洲国产婷婷综合在线精品| 91久久免费观看| 亚洲男人天堂一区| 色噜噜久久综合| 亚洲宅男天堂在线观看无病毒 | 国产二区国产一区在线观看| 精品成人a区在线观看| 国产一区 二区 三区一级| 久久久久久一级片| 国产成a人亚洲精品| 中文一区二区完整视频在线观看| 懂色av噜噜一区二区三区av| 国产精品亲子伦对白| 99视频国产精品| 亚洲精品伦理在线| 欧美性xxxxxxxx| 丝袜美腿亚洲综合| 精品成人一区二区三区四区| 国产精品69毛片高清亚洲| 国产精品乱人伦一区二区| 91麻豆123| 免费在线成人网| 久久久久成人黄色影片| 成人黄色网址在线观看| 亚洲综合在线第一页| 欧美一二三区在线观看| 粉嫩久久99精品久久久久久夜| 亚洲日本va午夜在线影院| 欧美日韩亚洲综合在线| 美脚の诱脚舐め脚责91| 国产精品美女一区二区在线观看| 在线观看亚洲精品视频| 久久国产麻豆精品| ●精品国产综合乱码久久久久| 欧美亚洲一区二区在线观看| 久久er99热精品一区二区| 欧美国产1区2区| 欧美日韩激情一区二区| 韩国中文字幕2020精品| 亚洲欧美日韩成人高清在线一区| 4438x成人网最大色成网站| 国产精品伊人色| 一区二区成人在线观看| 26uuu国产电影一区二区| 色综合久久综合| 久久福利资源站| 亚洲国产精品一区二区www | 国产乱对白刺激视频不卡| 怡红院av一区二区三区| 欧美v国产在线一区二区三区| 91天堂素人约啪| 国产自产高清不卡| 性感美女久久精品| 亚洲欧洲日本在线| 精品国产99国产精品| 欧美曰成人黄网| 成人免费福利片| 九色综合狠狠综合久久| 天天影视色香欲综合网老头| 中文字幕国产一区二区| 精品美女在线观看| 91精品国产综合久久久久久久 | 国产人妖乱国产精品人妖| 欧美一区二区三区在线| 色欧美88888久久久久久影院| 国产真实乱偷精品视频免| 亚洲成av人在线观看| 中文字幕欧美一区| 欧美成人精品1314www| 在线不卡一区二区| 欧美三级日韩三级| 99综合影院在线| 国产精品自拍av| 精品影视av免费| 麻豆免费看一区二区三区| 免费在线观看一区二区三区| 亚洲一区二区av电影| 亚洲黄网站在线观看| 亚洲黄色性网站| 亚洲精品视频免费观看| 亚洲手机成人高清视频| 1024成人网色www| 国产精品久久久久久久久免费丝袜| 精品福利一二区| www日韩大片| 欧美成人国产一区二区| 日韩精品一区二区三区视频播放 | 在线观看日韩高清av| 91精彩视频在线| 欧美在线不卡视频| 欧美三级在线看| 欧美顶级少妇做爰| 日韩免费观看高清完整版| 精品少妇一区二区三区日产乱码 | 亚洲国产成人自拍| 国产欧美精品国产国产专区| 国产精品高潮呻吟| 综合亚洲深深色噜噜狠狠网站| 亚洲女子a中天字幕| 艳妇臀荡乳欲伦亚洲一区| 亚洲成人福利片| 美女mm1313爽爽久久久蜜臀| 国产很黄免费观看久久| 99在线热播精品免费| 欧美视频一区在线| 欧美一区二区免费| 久久精品免费在线观看| 国产精品久久久久影院色老大| 一区二区三区在线看| 亚洲成人综合网站| 黄色小说综合网站| 成人av电影在线播放| 欧美视频自拍偷拍| 精品国产乱码久久久久久牛牛| 国产色产综合产在线视频| 亚洲视频一区在线| 日本强好片久久久久久aaa| 国产91精品精华液一区二区三区| www.日韩在线| 91精品国产福利| 国产精品福利影院| 天天综合色天天综合色h| 久久精品国产77777蜜臀| 97久久久精品综合88久久| 欧美日韩中文字幕一区| 久久中文字幕电影| 亚洲一区二区在线免费观看视频| 激情小说亚洲一区| 在线免费观看一区| 国产网站一区二区| 亚洲va在线va天堂| 成人在线综合网| 日韩欧美一级二级三级| 亚洲免费在线视频一区 二区| 精品一区二区影视| 欧美午夜不卡视频| 中文一区二区在线观看| 久久99九九99精品| 91精品福利视频| 国产午夜精品福利| 久久狠狠亚洲综合| 欧美视频中文字幕| 成人免费在线视频| 国内精品视频666| 日韩一区二区三区电影在线观看 | 国产精品久久久久一区二区三区 | 欧美二区三区的天堂| 一区二区三区国产| 国产不卡在线播放| 久久久久久久久久久电影| 麻豆一区二区三| 欧美日韩精品一区二区| 亚洲欧美日韩一区| 99视频精品在线| 欧美国产精品一区| 高清av一区二区| 精品美女一区二区| 免费在线一区观看| 91精品在线观看入口| 亚洲chinese男男1069| 欧美亚洲国产一卡| 一区二区高清视频在线观看| 色综合久久综合网欧美综合网 | 亚洲444eee在线观看| 91麻豆免费在线观看| 亚洲欧美日韩久久| 91在线国产观看| 一区二区中文视频|