想在注册表中检测手机的打电话的状态,在驱动中调用RegistryNotifyCallback,但发现一直加载不了(logo都没打印),搞了好久了,哎,各位大侠做过的指点一下吧,谢谢了!!!
- DWORD WINAPI ThreadProc(
- LPVOID lpParameter
- )
- {
- HKEY hKey=NULL;
- RegOpenKeyEx(HKEY_LOCAL_MACHINE,L"System\\State\\Phone",0,0,&hKey);
- printf("Enter ThreadProcThreadProc$$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n\n\n\n\n\n\n\n\n\n\n");
- if(hKey != NULL)
- {
- printf("Enter hKeyhKeyhKeyhKey$$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- while(!IsAPIReady(SH_SHELL) || !IsAPIReady(SH_WMGR) || !IsAPIReady(SH_GDI))
- {
- Sleep(250);
- }
- printf("Sleep Over....Sleep Over....Sleep Over....Sleep Over....Sleep Over....\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- UpdatePowerKeyFunc();
- RegistryNotifyCallback(hKey,L"System\\States\\Phone",L"Status",RegistryNotifyCallbackFunc,0,NULL,&g_hNotify);
- WaitForSingleObject(g_hevent,INFINITE);
- RegistryCloseNotification(g_hNotify);
- RegCloseKey(hKey);
- }
- return 0;
- }
我是在驱动中开了一个专门的线程来调用RegistryNotifyCallback的。其中的logo都打印不出来。