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

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

?? tchstub.cpp

?? 觸摸屏驅動源碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
                begTick-_dwLastSendedTick>dwMinPauseBeforeClick)) ) 
            {  //Yes, it's initial delay
             BOOL bPermition = TRUE;
               if((_iClientFlags&(TABLET_SEND|TABLET_NEED_PERMITION))!=0)
                  bPermition = (BOOL)SendMessage(_hClientWnd, WM_PEGREC_STARTDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));
               else
                  PostMessage(_hClientWnd, WM_PEGREC_STARTDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));
               if((_iClientFlags&TABLET_NEED_PERMITION)==0 || bPermition)
                  {
                     _iClientFlags |= TABLET_ALL_TO_SYSTEM;
                     _iClientFlags  &= (~TABLET_SMART_TO_SYSTEM);
                     FlagsToDll = 0x07;
                     bDelay = TRUE;
                  }
               else
                  {
//                   _iClientFlags = 0; //skip this stroke
                     _iClientFlags &= (~TABLET_STARTDELAY_TO_SYSTEM);
                  }

               _dwLastSendedTick = 0;
            }


         // IS SECONDARY DELAY?  (end of a stroke)
         if( !bNear                                      &&
             Flags==0x0f   /*intermediate point*/       &&
             (_iClientFlags&TABLET_INTERDELAY_TO_SYSTEM)!=0)
            if(iLastDelayX-X<iMaxDelayDist && X-iLastDelayX<iMaxDelayDist &&
               iLastDelayY-Y<iMaxDelayDist && Y-iLastDelayY<iMaxDelayDist)
               { //Yes, it is
                  if(dwTick - dwLastDelayTick > dwMinInterDelayTime)
                     {
                      BOOL bPermition = TRUE;
                        if((_iClientFlags&(TABLET_SEND|TABLET_NEED_PERMITION))!=0)
                           bPermition = (BOOL)SendMessage(_hClientWnd, WM_PEGREC_ENDDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));
                        else
                           PostMessage(_hClientWnd, WM_PEGREC_ENDDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));

                        if((_iClientFlags&TABLET_NEED_PERMITION)==0 || bPermition)
                           {
                              _iClientFlags |= TABLET_ALL_TO_SYSTEM;
                              _iClientFlags  &= (~TABLET_SMART_TO_SYSTEM);
//                              _iClientFlags  &= (~TABLET_ALL_TO_CLIENT);
                              FlagsToDll = 0x07;
                              X=_begX;
                              Y=_begY;
                              _dwLastSendedTick = 0;
                              bDelay = TRUE;

//                              DeferedDelay = TRUE;
                           }
                        else
                           {
//                           _iClientFlags = 0; //skip this stroke
                              _iClientFlags &= (~TABLET_INTERDELAY_TO_SYSTEM);
                           }

//                        SendMessage(_hClientWnd, WM_PEGREC_CLEARTRACE, 0, 1);
                     }
               }
            else
               { // new delay point
                  iLastDelayX = X;
                  iLastDelayY = Y;
                  dwLastDelayTick = dwTick;
               }

      } // endif "smart"

   // TO ORIGINAL DLL CALLBACK 
   if((_iClientFlags&TABLET_ALL_TO_SYSTEM)!=0)
      {
         (*v_pfnCgrPointCallback)(FlagsToDll, X, Y);
      }

   // TO The Transcriber App window
   if((_iClientFlags&TABLET_ALL_TO_CLIENT)!=0)
      {

         // it should be here because of possible _dwLastSendedTick changing
         if(Flags == 0x0d && !bClick && !bDelay)
            _dwLastSendedTick = dwTick;

#if DISCARD_SIMILAR_POINTS    
		 // Alex says safe to leave out - originally placed here to avoid overloading
		 //  slower processors.
		 // throw away redundant points (pen didn't move far enough within small time)
         if((FlagsToWnd&TouchSampleDownFlag)!=0)
            {
             int X0 = _iLastProceedX, Y0 = _iLastProceedY;
             
			 _iLastProceedX = X;
             _iLastProceedY = Y;
             _iLastProceedFlags = FlagsToWnd;
             
			 if((FlagsToWnd&TouchSamplePreviousDownFlag)!=0)
                  { //only for internal points
                   int iSum;

				   X = X0;
				   Y = Y0;               

				   if(dwTick-_dwLastPostedToClient<1000)
                         {
                            iSum = abs(X - _iLastPostedX)+abs(Y - _iLastPostedY);
                            if(iSum<_iMinDist)
                               goto bypass_sendpoint;
                         }
//                      if(iSum>_iMaxDist)
//                         goto bypass_sendpoint;
                  }
             
			   _iLastPostedX = X;
               _iLastPostedY = Y;
            }
         else
            {
               if((FlagsToWnd&TouchSamplePreviousDownFlag)!=0 &&
                  (_iLastPostedX != _iLastProceedX || _iLastPostedY != _iLastProceedY))
                  {
                     if(abs(X - _iLastPostedX)+abs(Y - _iLastPostedY) < _iMaxDist)
                        {
                           _iLastPostedX = _iLastProceedX;
                           _iLastPostedY = _iLastProceedY;
                           SendPtToWnd(_iLastProceedFlags, _iLastProceedX, _iLastProceedY);
                        }
                  }
            }

#endif // DISCARD_SIMILAR_POINTS

         _dwLastPostedToClient  = dwTick;

         SendPtToWnd(FlagsToWnd, X, Y);

//bypass_sendpoint:
        ;

//       if(Flags == 0x0d && !bClick && !bDelay)
//          _dwLastSendedTick = dwTick;
      }
#ifdef DEBUG2
      else
	  {
         OutputDebugString(L"CgrTouch Point 4\n");
      }
#endif

 	return;
}

void CgrTouchStubInitialize(HANDLE hinstDll) {

	TCHAR		*pOldDriverName = DEFAULT_TOUCH_DRIVER_NAME;
	SECURITY_ATTRIBUTES     SecAttr;
	ULONG		iSize = 0;
	DWORD       dwResult;

   // This code was all written originally with the (bad) assumption that
   //  if two processes load the same DLL, the dll shares global variables.
   //  In Win32, that assumption is not true. So, for the global variables
   //  that must be shared, we enforce the shared memory by using a MemoryMappedFile
   //  Both processes will attempt to create a MMF - whoever gets there first creates,
   //  whoever gets there second will open the existing MMF.
   //  so far, we need to put *_phStubWnd and the outer touch queue into the MMF area.
   //  This is really a bit of a misnomer since we never have a real file, just a memory object.
   //  might have to set SEC_NOCACHE for the ARM if there are cache coherency problems
   iSize = sizeof(HANDLE) + sizeof(HWND) + sizeof(TOUCH_QUEUE);
   _hFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, iSize, 
	                                 TEXT("TranscriberSharedGlobals"));
   dwResult = GetLastError();
   if (NULL == _hFileMapping)
   {
	  MYERRORMSG(1, (__TEXT("Transcriber driver couldn't create shared global memory area.\r\n")));
	  return;
   }

   _pView = MapViewOfFile(_hFileMapping, FILE_MAP_WRITE, 0, 0, 0);
   if (NULL == _pView)
   {
	  MYERRORMSG(1, (__TEXT("Transcriber driver couldn't access shared global memory area.\r\n")));
	  return;
   }

   // once we make it to here, _pView can be used as a base pointer to the global area.


   _hClientWnd=NULL;
   _iClientFlags=TABLET_ALL_TO_SYSTEM;

   SecAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
   SecAttr.lpSecurityDescriptor = NULL;
   SecAttr.bInheritHandle = TRUE;
   g_hTabletEvent = CreateEvent(&SecAttr, TRUE, TRUE, L"CgrTabletEvent");
   g_hInnerEvent  = CreateEvent(&SecAttr, TRUE, TRUE, L"CgrTabletInnerEvent");

   // initialize the thread safety objects
   InitializeCriticalSection(&Q2CritSect);
   hQ1Mutex = CreateMutex(NULL, FALSE, TRANSCRIBER_Q1MUTEX);
#ifdef DEBUGTOUCH
   InitializeCriticalSection(&csErrMsg);
#endif // DEBUGTOUCH

   // get a pointer that we can share out for the shared queue
   //@future - I should have a more elegant way for doing this than byte offset
   //  when I add more elements, go to a struct
   // LAYOUT - the hwnd occupies the low 4 bytes of shared memory.
   //  The touch queue starts after that.
   ptq = (TOUCH_QUEUE*)((BYTE*)_pView + sizeof(HWND) + sizeof(HANDLE));
   _phinstDll = (HANDLE *)((BYTE*)_pView + sizeof(HWND));
   _phStubWnd = (HWND*) _pView;
   if (dwResult != ERROR_ALREADY_EXISTS) {
       ptq->iPut = ptq->iGet = 0;  
       tq2.iPut = tq2.iGet = 0;  
       *_phinstDll = NULL;
   }
   if (*_phinstDll == NULL) *_phinstDll = hinstDll;
     //  if(!FindWindow(TOUCHSTUB_WNDCLASSNAME, NULL))
     {
      DWORD dwIDThread;
        if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TchWindowThread, (LPVOID)hinstDll, 0, &dwIDThread)==NULL )
			 {
            MYERRORMSG(1,
				   (__TEXT("Couldn't create touchstub window thread.\r\n")));
          }
        if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TchInnerThread, (LPVOID)hinstDll, 0, &dwIDThread)==NULL )
			 {
            MYERRORMSG(1,
				   (__TEXT("Couldn't create touchstub inner thread.\r\n")));
          }
     }


}

extern ULONG   culReferenceCount;              //@globalvar ULONG | culReferenceCount | Count of attached threads
extern PFN_TOUCH_PANEL_CALLBACK v_pfnPointCallback;
PFN_TOUCH_PANEL_CALLBACK v_pfnCgrCallback = CgrCallback;

/*++
Autodoc Information:

    @func BOOL | TouchPanelDllEntry |
    Dll entry point.

    @rdesc
    TRUE if the function succeeds. Otherwise, FALSE.

--*/
BOOL
TouchPanelDllEntry(
    HANDLE  hinstDll,    //@parm Process handle.
    DWORD   fdwReason,   //@parm Reason for calling the function.
    LPVOID  lpvReserved  //@parm Reserved, not used.
    )
{

    BOOL ReturnCode = TRUE;

    switch ( fdwReason )
    {
        case DLL_PROCESS_ATTACH:
            DEBUGREGISTER(reinterpret_cast<HINSTANCE>(hinstDll));
            DEBUGMSG( ZONE_FUNCTION, (TEXT("Dll Process Attach\r\n")) );

             //
             // Process is attaching.  We allow only 1 process to be attached.
             // If our global counter (maintained by the PDD) is greater than 0,
             //   error.
             //

            CgrTouchStubInitialize(hinstDll); // init calligrapher's part

            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;
            if ( DdsiTouchPanelAttach() > 1 )
            {
                DEBUGMSG( ZONE_FUNCTION, (TEXT("DdsiTouchPanelAttach > 1\r\n") ) );
                DdsiTouchPanelDetach(); // if a process attach fails, the  detach is
                 // never called. So adjust the count here.
                ReturnCode = FALSE;
            }

            break;

        case DLL_THREAD_ATTACH:
            DEBUGMSG( ZONE_FUNCTION, (TEXT("Dll Thread Attach\r\n")) );

             //
             // Thread is attaching.  We allow only 1 thread to be attached.
             //
            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;
            if ( ++culReferenceCount > 1 )
                ReturnCode = FALSE;
            break;

        case DLL_THREAD_DETACH:
            DEBUGMSG( ZONE_FUNCTION, (TEXT("Dll Thread Detach\r\n")) );

             //
             // Thread is detaching. If the detaching thread is the thread that
             // was allowed to attach, we now have no one to process touch panel
             // points. In this case we clear the callback functions, disable the
             // touch panel hardware, and disconnect from the logical interrupt.
             //

            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;
            if ( --culReferenceCount == 0 )
            {
                v_pfnPointCallback = NULL;
                DdsiTouchPanelDisable();
                InterruptDisable( gIntrTouch );
//				if( SYSINTR_NOP != gIntrTouchChanged )
//               		InterruptDisable( gIntrTouchChanged );
            }
            break;

        case DLL_PROCESS_DETACH:
            DEBUGMSG( ZONE_FUNCTION,
                      (TEXT("Dll Process Detach\r\n")) );

            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;

             //
             // Process is detaching.
             // If the detaching process is the process that was allowed
             // to attach, we reset the callback functions,
             // reference count, disable the touch panel, and disconnect from the
             // logical interrupt.
             //
             //
            DdsiTouchPanelDetach();
            break;
    }
    return ( ReturnCode );
}


#ifdef __cplusplus
   }
#endif //ifdef __cplusplus

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美艳星brazzers| 久久久国产午夜精品| 国产亚洲欧洲一区高清在线观看| 亚洲人成亚洲人成在线观看图片| 麻豆国产精品一区二区三区 | 久久九九国产精品| 亚洲一区二区精品3399| 国产69精品久久久久毛片 | 亚洲成人7777| 色婷婷久久久亚洲一区二区三区| 欧美成人福利视频| 国产成人aaa| 日韩一区二区在线免费观看| 成人欧美一区二区三区黑人麻豆| 久久66热偷产精品| 欧美蜜桃一区二区三区| 日韩毛片视频在线看| 国产成a人无v码亚洲福利| 欧美精品自拍偷拍| 亚洲国产精品尤物yw在线观看| 北岛玲一区二区三区四区| 精品国一区二区三区| 免费成人小视频| 91精品黄色片免费大全| 香蕉久久一区二区不卡无毒影院| 99国产精品一区| 日韩一区中文字幕| www.欧美日韩国产在线| 中文在线资源观看网站视频免费不卡 | 粉嫩久久99精品久久久久久夜 | 久久99精品一区二区三区三区| 欧美日韩夫妻久久| 丝袜美腿亚洲色图| 制服丝袜成人动漫| 秋霞成人午夜伦在线观看| 777久久久精品| 美女在线一区二区| 精品美女被调教视频大全网站| 久久激情综合网| 欧美va天堂va视频va在线| 美腿丝袜亚洲三区| 久久久亚洲欧洲日产国码αv| 国产激情一区二区三区四区| 亚洲国产精品精华液ab| av在线播放不卡| 亚洲精品少妇30p| 欧美日韩一区二区欧美激情 | 18欧美亚洲精品| 91极品美女在线| 秋霞成人午夜伦在线观看| 精品国产精品一区二区夜夜嗨| 国产精品影视在线| 亚洲欧洲精品成人久久奇米网| 色爱区综合激月婷婷| 三级欧美在线一区| 欧美精品一区二区在线观看| 国产成人精品免费网站| 亚洲精品免费在线观看| 欧美丰满美乳xxx高潮www| 韩国在线一区二区| 亚洲人123区| 91精品一区二区三区久久久久久 | 欧美精品粉嫩高潮一区二区| 九九精品一区二区| 国产精品麻豆视频| 欧美视频精品在线观看| 久久精品国产精品亚洲精品| 亚洲国产精品t66y| 欧美日韩久久一区| 国产毛片一区二区| 亚洲激情网站免费观看| 日韩欧美www| 91碰在线视频| 韩国女主播成人在线观看| 亚洲视频免费观看| 欧美大片日本大片免费观看| 不卡一区二区在线| 奇米888四色在线精品| 中文字幕一区二区三区在线播放| 欧美猛男超大videosgay| 国产成人免费在线观看| 五月天激情小说综合| 日本视频免费一区| 欧美激情一区二区三区在线| 91精品欧美一区二区三区综合在| 国产亲近乱来精品视频| 日韩不卡一区二区| 中文字幕在线一区免费| 欧美精品一区二区三区四区| 91麻豆国产香蕉久久精品| 国产一区二区在线观看视频| 亚洲成人1区2区| 亚洲男帅同性gay1069| 国产人成亚洲第一网站在线播放 | 久久精品国产免费| 亚洲国产一区视频| 亚洲日本青草视频在线怡红院 | 另类小说视频一区二区| 亚洲国产视频在线| 亚洲欧美另类久久久精品 | 日韩一区二区三| 欧美日韩卡一卡二| 欧美最猛性xxxxx直播| jlzzjlzz欧美大全| 成人av在线一区二区三区| 国产一区二区三区久久悠悠色av| 美女视频网站黄色亚洲| 奇米影视一区二区三区| 天涯成人国产亚洲精品一区av| 亚洲一区二区不卡免费| 综合激情成人伊人| 综合欧美一区二区三区| 综合欧美亚洲日本| 亚洲精品亚洲人成人网| 亚洲精品国产第一综合99久久| 亚洲欧美日韩综合aⅴ视频| 自拍偷拍亚洲激情| 国产精品国产馆在线真实露脸| 国产精品午夜久久| 国产精品嫩草99a| 亚洲日本在线a| 亚洲国产一区二区视频| 亚洲电影欧美电影有声小说| 亚洲成av人综合在线观看| 婷婷综合另类小说色区| 免费日本视频一区| 精品亚洲porn| 粉嫩在线一区二区三区视频| 国产91精品欧美| 91在线你懂得| 欧美久久久久久蜜桃| 日韩一区二区精品在线观看| 欧美不卡一区二区| 国产精品午夜电影| 亚洲综合色自拍一区| 青草国产精品久久久久久| 狠狠狠色丁香婷婷综合激情| 成人综合婷婷国产精品久久蜜臀 | 久久精品999| 成人午夜电影小说| 欧美性高清videossexo| 日韩欧美国产不卡| 国产精品电影一区二区三区| 亚洲成人免费电影| 九九热在线视频观看这里只有精品| 国产69精品久久久久毛片| 在线一区二区观看| 日韩欧美视频在线| 国产精品福利一区| 日韩精品国产欧美| 波多野结衣视频一区| 欧美乱妇一区二区三区不卡视频| 欧美精品一区二区三| 亚洲激情自拍偷拍| 国产精品伊人色| 欧美亚洲国产怡红院影院| 精品国内片67194| 亚洲激情图片一区| 国产自产高清不卡| 欧美私人免费视频| 国产日韩av一区二区| 亚洲国产成人精品视频| 成人性生交大片免费看中文 | 91在线视频在线| 日韩欧美的一区二区| 中文字幕一区不卡| 狠狠狠色丁香婷婷综合久久五月| 欧美专区日韩专区| 国产欧美中文在线| 毛片基地黄久久久久久天堂| 色先锋资源久久综合| 久久久久综合网| 美国毛片一区二区| 欧美在线观看18| 最好看的中文字幕久久| 国产精品自拍毛片| 日韩一级片在线播放| 亚洲午夜精品网| 91老师国产黑色丝袜在线| 国产亚洲精品7777| 精品一区二区三区蜜桃| 欧美一区二区三区思思人| 亚洲午夜免费视频| 91丨porny丨中文| 国产精品久久久久桃色tv| 麻豆免费看一区二区三区| 制服丝袜av成人在线看| 亚洲一区二区三区不卡国产欧美| 91在线观看美女| 中文字幕一区二区日韩精品绯色| 国产传媒久久文化传媒| 久久亚区不卡日本| 紧缚奴在线一区二区三区| 91精品国产综合久久蜜臀| 首页综合国产亚洲丝袜| 欧美日韩在线播放| 五月天丁香久久| 欧美一区二区三区四区久久| 日韩**一区毛片| 欧美一级欧美三级在线观看|