|
[讨论]各位有对车辆发动机电脑MCU有研究兴趣么?
芯片型号传上来看看 |
|
[求助]编写驱动挂钩时钟中断
请教一下老大们,在WINXP下是否还可以得到原来的INT8时钟中断,APIC里面的好像没有了,哪位老大能指导一下. |
|
[求助]编写驱动挂钩时钟中断
谢谢老大指点,我试了APC机制,但是在定时20ms间隔时他的误差会在一两毫秒间,我需要的最好能在1ms内,不知是不是程序的问题,请老大指正一下。 CreateWaitableTime/SetWaitableTime #define _WIN32_WINNT 0x0400 #include <windows.h> #include <stdio.h> #define _SECOND 10000000 typedef struct _MYDATA { TCHAR *szText; DWORD dwValue; } MYDATA; VOID CALLBACK TimerAPCProc( LPVOID lpArg, // Data value DWORD dwTimerLowValue, // Timer low value DWORD dwTimerHighValue ) // Timer high value { MYDATA *pMyData = (MYDATA *)lpArg; SYSTEMTIME st; GetLocalTime(&st); printf( "Message: %s\nValue: %d\n\n", pMyData->szText, pMyData->dwValue ); printf("st.wSecond=%d,st.wMilliseconds=%d\n",st.wSecond,st.wMilliseconds); MessageBeep(0); } void main( void ) { HANDLE hTimer; BOOL bSuccess; __int64 qwDueTime; LARGE_INTEGER liDueTime; MYDATA MyData; TCHAR szError[255]; MyData.szText = "This is my data."; MyData.dwValue = 100; if ( hTimer = CreateWaitableTimer( NULL, // Default security attributes FALSE, // Create auto-reset timer "MyTimer" ) ) // Name of waitable timer { __try { qwDueTime = -2 * _SECOND; liDueTime.LowPart = (DWORD) ( qwDueTime & 0xFFFFFFFF ); liDueTime.HighPart = (LONG) ( qwDueTime >> 32 ); bSuccess = SetWaitableTimer( hTimer, // Handle to the timer object &liDueTime, // When timer will become signaled 10, // Periodic timer interval of 2 seconds TimerAPCProc, // Completion routine &MyData, // Argument to the completion routine FALSE ); // Do not restore a suspended system if ( bSuccess ) { for ( ; MyData.dwValue < 1000; MyData.dwValue += 100 ) { SleepEx( INFINITE, // Wait forever TRUE ); // Put thread in an alertable state } } else { wsprintf( szError, "SetWaitableTimer failed with Error \ %d.", GetLastError() ); MessageBox( NULL, szError, "Error", MB_ICONEXCLAMATION ); } } __finally { CloseHandle( hTimer ); } } else { wsprintf( szError, "CreateWaitableTimer failed with Error %d.", GetLastError() ); MessageBox( NULL, szError, "Error", MB_ICONEXCLAMATION ); } } |
|
[求助]读取事件很麻烦啊,下面这段是VC代码,我只关心其中取事件描述部分,谁能把那部分的原理给俺说说啊,实在是看不懂
pStrings=new char[mRet];//申请空间 memcpy(pStrings,(LPBYTE)ptr+ptr->StringOffset,mRet);//拷贝制定长度字符串 uStepOfString=0;//步长初始化为零 for(int x=0;x<ptr->NumStrings;x++) { if(x==0)//第一个字符串 { strcpy(szExpandedString, (TCHAR *)pStrings + uStepOfString);//复制源串 if(x<(UINT)ptr->NumStrings - 1)strcat(szExpandedString, ","); } else strcat(szExpandedString, pStrings + uStepOfString);//将源串和目的串连接起来 uStepOfString = strlen(pStrings + uStepOfString) + 1;//跟新步长 } delete [] pStrings;//释放空间 这段的主要作用是将源串连接起来。 |
|
[原创]驱动开发和调试的环境设置
我调试的是您说的那个ioctl的程序啊没有GS_SUPPORT.C这个源文件 |
|
[原创]驱动开发和调试的环境设置
MS的符号下载路径和本地路径 如何设置能不能详细些?我每次调试时老是出现查找gs_support.c文件的对话框,并且没有源程序的标签页 应该如何设置! |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值