这篇教程C++ GetCurrentTask函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetCurrentTask函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCurrentTask函数的具体用法?C++ GetCurrentTask怎么用?C++ GetCurrentTask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetCurrentTask函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: WaitEvent16/*********************************************************************** * WaitEvent (KERNEL.30) */BOOL16 WINAPI WaitEvent16( HTASK16 hTask ){ TDB *pTask; if (!hTask) hTask = GetCurrentTask(); pTask = TASK_GetPtr( hTask ); if (pTask->flags & TDBF_WIN32) { FIXME("called for Win32 thread (%04x)!/n", GetCurrentThreadId()); return TRUE; } if (pTask->nEvents > 0) { pTask->nEvents--; return FALSE; } if (pTask->teb == NtCurrentTeb()) { DWORD lockCount; NtResetEvent( pTask->hEvent, NULL ); ReleaseThunkLock( &lockCount ); SYSLEVEL_CheckNotLevel( 1 ); WaitForSingleObject( pTask->hEvent, INFINITE ); RestoreThunkLock( lockCount ); if (pTask->nEvents > 0) pTask->nEvents--; } else FIXME("for other task %04x cur=%04x/n",pTask->hSelf,GetCurrentTask()); return TRUE;}
开发者ID:Barrell,项目名称:wine,代码行数:37,
示例2: GetWindowsDirectoryA/* get the search path for the current module; helper for OpenFile16 */static char *get_search_path(void){ UINT len; char *ret, *p, module[OFS_MAXPATHNAME]; module[0] = 0; if (GetCurrentTask() && GetModuleFileName16( GetCurrentTask(), module, sizeof(module) )) { if (!(p = strrchr( module, '//' ))) p = module; *p = 0; } len = (2 + /* search order: first current dir */ GetSystemDirectory16( NULL, 0 ) + 1 + /* then system dir */ GetWindowsDirectoryA( NULL, 0 ) + 1 + /* then windows dir */ strlen( module ) + 1 + /* then module path */ GetEnvironmentVariableA( "PATH", NULL, 0 ) + 1); /* then look in PATH */ if (!(ret = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL; strcpy( ret, ".;" ); p = ret + 2; GetSystemDirectory16( p, ret + len - p ); p += strlen( p ); *p++ = ';'; GetWindowsDirectoryA( p, ret + len - p ); p += strlen( p ); *p++ = ';'; if (module[0]) { strcpy( p, module ); p += strlen( p ); *p++ = ';'; } GetEnvironmentVariableA( "PATH", p, ret + len - p ); return ret;}
开发者ID:bilboed,项目名称:wine,代码行数:36,
示例3: NotifyHandler/* * NotifyHandler - call back routine for notifications */BOOL __export FAR PASCAL NotifyHandler( WORD id, DWORD data ){ notify *ptr; if( id == NFY_TASKIN || id == NFY_TASKOUT ) { if( GetCurrentTask() == ourTask ) { if( id == NFY_TASKIN ) { UnPauseSampler(); } else { PauseSampler(); } } return( FALSE ); } PauseSampler(); ptr = getNotifyData( data ); switch( id ) { case NFY_STARTDLL: _fmemcpy( &ptr->startdll, (LPVOID) data, sizeof( NFYSTARTDLL ) ); MyModuleFindHandle( &ptr->me, ptr->startdll.hModule ); HandleLibLoad( SAMP_CODE_LOAD, ptr->startdll.hModule ); break; case NFY_STARTTASK: if( ourTask == NULL ) { // handle spawned tasks ourTask = GetCurrentTask(); MyTaskFindHandle( &ptr->te, ptr->task ); MyModuleFindHandle( &ptr->me, ptr->te.hModule ); HandleLibLoad( SAMP_MAIN_LOAD, ptr->te.hModule ); StartSampler(); } else { MyTaskFindHandle( &ptr->te, ptr->task ); MyModuleFindHandle( &ptr->me, ptr->te.hModule ); HandleLibLoad( SAMP_CODE_LOAD, ptr->te.hModule ); } break; case NFY_EXITTASK: if( GetCurrentTask() == ourTask ) { // handle spawned tasks QuitSampler( &TotalTime ); SharedMemory->TaskEnded = TRUE; } break; } UnPauseSampler(); return( FALSE );} /* NotifyHandler */
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:51,
示例4: MZ_Launchstatic void MZ_Launch( LPCSTR cmdtail, int length ){ TDB *pTask = GlobalLock16( GetCurrentTask() ); BYTE *psp_start = PTR_REAL_TO_LIN( DOSVM_psp, 0 ); DWORD rv; SYSLEVEL *lock; MZ_FillPSP(psp_start, cmdtail, length); pTask->flags |= TDBF_WINOLDAP; /* DTA is set to PSP:0080h when a program is started. */ pTask->dta = MAKESEGPTR( DOSVM_psp, 0x80 ); GetpWin16Lock( &lock ); _LeaveSysLevel( lock ); ResumeThread(dosvm_thread); rv = DOSVM_Loop(dosvm_thread); CloseHandle(dosvm_thread); dosvm_thread = 0; dosvm_tid = 0; CloseHandle(loop_thread); loop_thread = 0; loop_tid = 0; VGA_Clean(); ExitProcess(rv);}
开发者ID:howard5888,项目名称:wineT,代码行数:27,
示例5: GetCurrentTaskvoid TAppDictionary::Add(PTApplication pApplication){ HANDLE hTask = GetCurrentTask(); TAppDictionaryEntry *pFreeEntry = NULL; // no free entry yet // First see if table already. If so, replace entry for (TAppDictionaryEntry * pEntry = Table; pEntry < &Table[NumEntries]; pEntry++) { if (pEntry->hTask == hTask) // already in table? { pEntry->pApplication = pApplication; return; } else // see if entry is free { if (!pFreeEntry && pEntry->hTask == 0) // remember this entry pFreeEntry = pEntry; } } // Not in table. See if we encountered a free entry in table. If // so, use it. Otherwise grow table. if ((pEntry = (pFreeEntry ? pFreeEntry : GrowTable())) != 0) { pEntry->hTask = hTask; pEntry->pApplication = pApplication; return; }}
开发者ID:nicolaemariuta,项目名称:bachelorHomeworkAndStudy,代码行数:32,
示例6: NotifyRegister16/*********************************************************************** * NotifyRegister (TOOLHELP.73) */BOOL16 WINAPI NotifyRegister16( HTASK16 htask, FARPROC16 lpfnCallback, WORD wFlags ){ int i; FIXME("(%x,%x,%x), semi-stub./n", htask, (DWORD)lpfnCallback, wFlags ); if (!htask) htask = GetCurrentTask(); for (i=0;i<nrofnotifys;i++) if (notifys[i].htask==htask) break; if (i==nrofnotifys) { if (notifys==NULL) notifys=HeapAlloc( GetProcessHeap(), 0, sizeof(struct notify) ); else notifys=HeapReAlloc( GetProcessHeap(), 0, notifys, sizeof(struct notify)*(nrofnotifys+1)); if (!notifys) return FALSE; nrofnotifys++; } notifys[i].htask=htask; notifys[i].lpfnCallback=lpfnCallback; notifys[i].wFlags=wFlags; return TRUE;}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:29,
示例7: RUASSERTvoid CRUTopologicalDGIterator::Next(){ RUASSERT(FALSE == allTasksLinkMap_.IsEmpty()); CRUTask *pTask = GetCurrentTask(); if (NULL == pTask) { return; // all the tasks have been already traversed } // The tasks that need to be traversed after me CRUTaskList &refTaskList = (DIRECT == dir_) ? pTask->GetTasksThatDependOnMe() : pTask->GetTasksThatIDependOn(); // For all of these tasks, decrecase the reference count // Update the "ready" list, if any of the tasks have become ready. UpdateIterator(refTaskList); // Select a new current task if (TRUE == readyTasksList_.IsEmpty()) { SetCurrentTask(NULL); // The last task has just been traversed } else { // Retrieve a new task from the "ready" list SetCurrentTask(readyTasksList_.RemoveHead()); }}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:31,
示例8: TerminateApp16/*********************************************************************** * TerminateApp (TOOLHELP.77) * * See "Undocumented Windows". */void WINAPI TerminateApp16(HTASK16 hTask, WORD wFlags){ if (hTask && hTask != GetCurrentTask()) { FIXME("cannot terminate task %x/n", hTask); return; } if (wFlags & NO_UAE_BOX) { UINT16 old_mode; old_mode = SetErrorMode16(0); SetErrorMode16(old_mode|SEM_NOGPFAULTERRORBOX); } FatalAppExit16( 0, NULL ); /* hmm, we're still alive ?? */ /* check undocumented flag */ if (!(wFlags & 0x8000)) TASK_CallTaskSignalProc( USIG16_TERMINATION, hTask ); /* UndocWin says to call int 0x21/0x4c exit=0xff here, but let's just call ExitThread */ ExitThread(0xff);}
开发者ID:howard5888,项目名称:wineT,代码行数:31,
示例9: TRSCOPEvoid qPBReaderPlatform::ReaderApplicationStarted(const QString & isBookFile){ TRSCOPE(pb, "qPBReaderPlatform::ReaderApplicationStarted");#ifdef Q_OS_POCKETBOOK TRACE << "Declaring " << ENC(isBookFile) << endl; // set application icon // taskmgr looks for app_%s_icon.bmp file in theme, %s being the // task name. Since I have not found another way to provide an icon at // runtime, setting task name to "reader" does the job. int task = ::GetCurrentTask(); taskinfo * pTask = ::GetTaskInfo(GetCurrentTask()); if (pTask) { int rc = ::SetTaskParameters(task, "reader", 0, 0, pTask->flags); TRACE << "SetTaskParameters " << VAR(rc) << endl; } // switch to reading mode, seems to change panel appearance SetReadingMode(true); // and register book as read by this program ::BookReady(isBookFile.toUtf8().data());#else Q_UNUSED(isBookFile);#endif}
开发者ID:m4mmon,项目名称:qPBReader,代码行数:33,
示例10: PostQuitMessagevoid WINAPIPostQuitMessage(int nExitCode){ APISTR((LF_APICALL,"PostQuitMessage(int %x)/n", nExitCode)); (void) AddAppMsgQueue(GetCurrentTask(),0,0,WM_QUIT,nExitCode,0); APISTR((LF_APIRET,"PostQuitMessage: returns void/n"));}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:7,
示例11: IT_GLOBALALLOCvoidIT_GLOBALALLOC (ENV *envp,LONGPROC f) /* GlobalAlloc */{ UINT uSel,flags; DWORD dwSize; DWORD dwMemSize; HGLOBAL hGlobal; dwSize = GETDWORD(SP+4); flags = GETWORD(SP+8); dwMemSize=dwSize; dwSize = max(32,(dwSize + 31) & 0xffffffe0); uSel = TWIN_AllocSelector(dwSize,flags); if (uSel) { hGlobal = GetSelectorHandle(uSel); CreateDataInstance((HINSTANCE)hGlobal,(HMODULE)0, GetCurrentTask()); if (flags & GMEM_MOVEABLE) { GlobalUnlock(hGlobal); uSel &= 0xfffe; } } envp->reg.sp += UINT_86 + DWORD_86 + RET_86; envp->reg.ax = LOWORD(uSel); envp->reg.dx = 0;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:29,
示例12: GUIHookF1void GUIHookF1( void ){ if( F1Hooked == 0 ) { F1ProcInst = _wpi_makeprocinstance( (WPI_PROC)F1Proc, GUIMainHInst );#ifndef __OS2_PM__ // we use a hook to trap F1 in dialogs that were not // created using this instance yet on our behalf. IE COMMDLG stuff // we cant use a system wide hook because they only can be // used in DLL's #if defined(__NT__) F1HookHandle = SetWindowsHookEx( WH_MSGFILTER, (HOOKPROC)F1ProcInst, GUIMainHInst, (DWORD)GetCurrentThreadId() ); #else F1HookHandle = SetWindowsHookEx( WH_MSGFILTER, (HOOKPROC)F1ProcInst, GUIMainHInst, GetCurrentTask() ); #endif#else // in OS/2, it has to be an app. specific input filter (OS/2 has // bad problems, occassionally, with system input hooks) WinSetHook( GUIMainHInst.hab, HMQ_CURRENT, HK_INPUT, (PFN) F1ProcInst, GUIMainHInst.mod_handle );#endif } F1Hooked++;}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:30,
示例13: SetCurrentDirectory16/*********************************************************************** * SetCurrentDirectory (KERNEL.412) */BOOL16 WINAPI SetCurrentDirectory16( LPCSTR dir ){ char fulldir[MAX_PATH]; if (!GetFullPathNameA( dir, MAX_PATH, fulldir, NULL )) return FALSE; if (!SetCurrentDirectoryA( dir )) return FALSE; if (fulldir[0] && fulldir[1] == ':') { TDB *pTask = GlobalLock16( GetCurrentTask() ); char env_var[4] = "=A:"; env_var[1] = fulldir[0]; SetEnvironmentVariableA( env_var, fulldir ); /* update the directory in the TDB */ if (pTask) { pTask->curdrive = 0x80 | (fulldir[0] - 'A'); GetShortPathNameA( fulldir + 2, pTask->curdir, sizeof(pTask->curdir) ); } } return TRUE;}
开发者ID:bilboed,项目名称:wine,代码行数:28,
示例14: MZ_Launchstatic DWORD MZ_Launch( LPCSTR cmdtail, int length ){ TDB *pTask = GlobalLock16( GetCurrentTask() ); BYTE *psp_start = PTR_REAL_TO_LIN( DOSVM_psp, 0 ); DWORD rv; SYSLEVEL *lock; MSG msg; MZ_FillPSP(psp_start, cmdtail, length); pTask->flags |= TDBF_WINOLDAP; /* DTA is set to PSP:0080h when a program is started. */ pTask->dta = MAKESEGPTR( DOSVM_psp, 0x80 ); GetpWin16Lock( &lock ); _LeaveSysLevel( lock ); /* force the message queue to be created */ PeekMessageW(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); ResumeThread(dosvm_thread); rv = DOSVM_Loop(dosvm_thread); CloseHandle(dosvm_thread); dosvm_thread = 0; dosvm_tid = 0; CloseHandle(loop_thread); loop_thread = 0; loop_tid = 0; if (rv) return rv; VGA_Clean(); ExitProcess(0);}
开发者ID:bpowers,项目名称:wine,代码行数:32,
示例15: LookupETask16/*********************************************************************** * LookupETask (COMPOBJ.94) */HRESULT WINAPI LookupETask16(HTASK16 *hTask,LPVOID p) { FIXME("(%p,%p),stub!/n",hTask,p); if ((*hTask = GetCurrentTask()) == hETask) { memcpy(p, Table_ETask, sizeof(Table_ETask)); } return 0;}
开发者ID:Jactry,项目名称:wine,代码行数:10,
示例16: CRYPTO_THREADID_currentvoid CRYPTO_THREADID_current(CRYPTO_THREADID *id) { if (threadid_callback) { threadid_callback(id); return; }#ifndef OPENSSL_NO_DEPRECATED /* If the deprecated callback was set, fall back to that */ if (id_callback) { CRYPTO_THREADID_set_numeric(id, id_callback()); return; }#endif /* Else pick a backup */#ifdef OPENSSL_SYS_WIN16 CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentTask());#elif defined(OPENSSL_SYS_WIN32) CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentThreadId());#elif defined(OPENSSL_SYS_BEOS) CRYPTO_THREADID_set_numeric(id, (unsigned long)find_thread(NULL));#else /* For everything else, default to using the address of 'errno' */ CRYPTO_THREADID_set_pointer(id, (void*)&errno);#endif }
开发者ID:Wampamba-Nooh,项目名称:MicroFrameworkSDK-Mono,代码行数:27,
示例17: slowPollvoid slowPoll( void ) { RANDOM_STATE randomState; BYTE buffer[ RANDOM_BUFSIZE ]; MODULEENTRY moduleEntry; GLOBALENTRY globalEntry; TASKENTRY taskEntry; int count; initRandomData( randomState, buffer, RANDOM_BUFSIZE ); /* Walk the global heap getting information on each entry in it. This retrieves the objects linear address, size, handle, lock count, owner, object type, and segment type */ count = 0; globalEntry.dwSize = sizeof( GLOBALENTRY ); if( GlobalFirst( &globalEntry, GLOBAL_ALL ) ) do { addRandomData( randomState, &globalEntry, sizeof( GLOBALENTRY ) ); count++; } while( count < 70 && GlobalNext( &globalEntry, GLOBAL_ALL ) ); /* Walk the module list getting information on each entry in it. This retrieves the module name, handle, reference count, executable path, and next module */ count = 0; moduleEntry.dwSize = sizeof( MODULEENTRY ); if( ModuleFirst( &moduleEntry ) ) do { addRandomData( randomState, &moduleEntry, sizeof( MODULEENTRY ) ); count++; } while( count < 20 && ModuleNext( &moduleEntry ) ); /* Walk the task list getting information on each entry in it. This retrieves the task handle, parent task handle, instance handle, stack segment and offset, stack size, number of pending events, task queue, and the name of module executing the task. We also call TaskGetCSIP() for the code segment and offset of each task if it's safe to do so (note that this call can cause odd things to happen in debuggers and runtime code checkers because of the way TaskGetCSIP() is implemented) */ count = 0; taskEntry.dwSize = sizeof( TASKENTRY ); if( TaskFirst( &taskEntry ) ) do { addRandomData( randomState, &taskEntry, sizeof( TASKENTRY ) ); if( taskEntry.hTask != GetCurrentTask() ) addRandomValue( randomState, TaskGetCSIP( taskEntry.hTask ) ); count++; } while( count < 100 && TaskNext( &taskEntry ) ); /* Flush any remaining data through */ endRandomData( randomState, 100 ); }
开发者ID:VlaBst6,项目名称:cryptlib-history,代码行数:60,
示例18: GetModuleFromInstanceHMODULEGetModuleFromInstance(HINSTANCE hInstance){ MEMORYINFO *lpMemory; HANDLE hResult; if (hInstance == 0) { HTASK t; t = GetCurrentTask(); return GetModuleFromInstance((GETTASKINFO(t))->hInst); } if (!(lpMemory = GETHANDLEINFO(hInstance))) { MODULEINFO *lpModule = GETMODULEINFO(hInstance); BOOL bGotModule = lpModule ? TRUE : FALSE; RELEASEMODULEINFO(lpModule); if (!bGotModule) return (HMODULE)0; else { RELEASEHANDLEINFO(lpMemory); return (HMODULE)hInstance; } } hResult = lpMemory->hModule; RELEASEHANDLEINFO(lpMemory); return hResult;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:29,
示例19: definedULONG32 CAsyncNetThread::GetSession(){#if defined( _WIN32 ) return (GetCurrentThreadId());#else return ((ULONG32)(LPSTR)GetCurrentTask());#endif}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:8,
示例20: SetWindowsHook16/*********************************************************************** * SetWindowsHook (USER.121) */FARPROC16 WINAPI SetWindowsHook16( INT16 id, HOOKPROC16 proc ){ HINSTANCE16 hInst = FarGetOwner16( HIWORD(proc) ); /* WH_MSGFILTER is the only task-specific hook for SetWindowsHook() */ HTASK16 hTask = (id == WH_MSGFILTER) ? GetCurrentTask() : 0; return (FARPROC16)SetWindowsHookEx16( id, proc, hInst, hTask );}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:12,
示例21: GetAppCompatFlags16/*********************************************************************** * GetAppCompatFlags (KERNEL.354) */DWORD WINAPI GetAppCompatFlags16( HTASK16 hTask ){ TDB *pTask; if (!hTask) hTask = GetCurrentTask(); if (!(pTask=TASK_GetPtr( hTask ))) return 0; if (GlobalSize16(hTask) < sizeof(TDB)) return 0; return pTask->compat_flags;}
开发者ID:Barrell,项目名称:wine,代码行数:12,
示例22: ssl_sock_initstatic int ssl_sock_init(void) {#ifdef WATT32 extern int _watt_do_exit; _watt_do_exit = 0; if (sock_init()) return (0);#elif defined(OPENSSL_SYS_WINDOWS) if (!wsa_init_done) { int err; #ifdef SIGINT signal(SIGINT,(void (*)(int))ssl_sock_cleanup);#endif wsa_init_done=1; memset(&wsa_state,0,sizeof(wsa_state)); if (WSAStartup(0x0101,&wsa_state)!=0) { err=WSAGetLastError(); BIO_printf(bio_err,"unable to start WINSOCK, error code=%d/n",err); return(0); }#ifdef OPENSSL_SYS_WIN16 EnumTaskWindows(GetCurrentTask(),enumproc,0L); lpTopWndProc=(FARPROC)GetWindowLong(topWnd,GWL_WNDPROC); lpTopHookProc=MakeProcInstance((FARPROC)topHookProc,_hInstance); SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);#endif /* OPENSSL_SYS_WIN16 */ }#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK) WORD wVerReq; WSADATA wsaData; int err; if (!wsa_init_done) { # ifdef SIGINT signal(SIGINT,(void (*)(int))sock_cleanup);# endif wsa_init_done=1; wVerReq = MAKEWORD( 2, 0 ); err = WSAStartup(wVerReq,&wsaData); if (err != 0) { BIO_printf(bio_err,"unable to start WINSOCK2, error code=%d/n",err); return(0); } }#endif /* OPENSSL_SYS_WINDOWS */ return(1); }
开发者ID:0x0B501E7E,项目名称:platform_external_openssl,代码行数:56,
示例23: CreateRootWindowHWNDCreateRootWindow(){ static HWND hRoot; HWND32 lpRootWindow; HCLASS32 hClassRoot32; WNDCLASSEX RootClass; int nScreenWidth,nScreenHeight; if(hRoot) return hRoot; /* Check if class has been registered */ if (!(hClassRoot32 = FindClass((LPSTR)"ROOTWClass",(HANDLE)0))) { return (HWND)0; } /* Get class information */ InternalGetClassInfoEx(hClassRoot32,&RootClass); /* Create handle for the new window */ if (!(lpRootWindow = CREATEHWIN(hRoot))) { RELEASECLASSINFO(hClassRoot32); return 0; } /* Set root window proc */ lpRootWindow->lpfnWndProc = RootClass.lpfnWndProc; /* set style & flags*/ lpRootWindow->dwStyle = WS_POPUP|WS_VISIBLE; lpRootWindow->dwWinFlags = 0L; /* set class pointer */ lpRootWindow->hWindowClass32 = hClassRoot32; /* for now root window doesn't have any extra bytes */ /* Set root window size */ nScreenWidth = GetSystemMetrics(SM_CXSCREEN); nScreenHeight = GetSystemMetrics(SM_CYSCREEN); SetRect(&lpRootWindow->rWnd,0,0,nScreenWidth,nScreenHeight); lpRootWindow->wWidth = nScreenWidth; lpRootWindow->wHeight = nScreenHeight; /* Every window must have a task. It determines the queue to use */ lpRootWindow->hTask = GetCurrentTask(); RELEASEWININFO(lpRootWindow); RELEASECLASSINFO(hClassRoot32); return hRoot;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:54,
示例24: ReplyMessagevoid WINAPI ReplyMessage(LRESULT lParam){ if (lpSendMessageStack && lpSendMessageStack->hReceivingTask == GetCurrentTask()) { lpSendMessageStack->lResult = lParam; lpSendMessageStack->bSendCompleted = TRUE; DirectedYield(lpSendMessageStack->hSendingTask); }}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:11,
示例25: SetTaskSignalProc/*********************************************************************** * SetTaskSignalProc (KERNEL.38) */FARPROC16 WINAPI SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc ){ TDB *pTask; FARPROC16 oldProc; if (!hTask) hTask = GetCurrentTask(); if (!(pTask = TASK_GetPtr( hTask ))) return NULL; oldProc = pTask->userhandler; pTask->userhandler = proc; return oldProc;}
开发者ID:Barrell,项目名称:wine,代码行数:14,
示例26: TWIN_IsSafeToMessageBoxBOOL TWIN_IsSafeToMessageBox(){ if (lpSendMessageStack && lpSendMessageStack->hReceivingTask == GetCurrentTask() && !lpSendMessageStack->bSendReceived) { return FALSE; } else return TRUE;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:11,
示例27: Skt4uRcd/* ------------------------------------------------------------------ */void Skt4uRcd (SOCKET sNewSkt, int nState){int Ark; if ( (Ark=FindFirstFreeIdx()) != INVALID_INDEX) { HistoSocket[Ark].skt = sNewSkt; HistoSocket[Ark].nState = nState; HistoSocket[Ark].nRcv = HistoSocket[Ark].nSnd = 0; HistoSocket[Ark].hTask = GetCurrentTask (); } } /* RcdSocket */
开发者ID:gene9,项目名称:uplink-source-code,代码行数:12,
示例28: WinMainint PASCAL WinMain(HINSTANCE hInst, HINSTANCE /*hPrevInst*/, LPSTR /*pszCmdLine*/, int /*nCmdShow*/){ if (IsWin95()) { if (GetModuleUsage(hInst) <= 1) SetModuleExpWinVer(hInst, 0x0400); SetTaskExpWinVer(GetCurrentTask(), 0x0400); } // do something else... if (IsWin95()) { if (GetModuleUsage(hInst) <= 1) SetModuleExpWinVer(hInst, 0x030a); SetTaskExpWinVer(GetCurrentTask(), 0x030a); } return (0);}
开发者ID:tjotala,项目名称:Articles,代码行数:21,
示例29: NotifyUnRegisterBOOL TOOLHELPAPI NotifyUnRegister( HANDLE hTask){ NOTIFYSTRUCT *pNotify; NOTIFYSTRUCT *pBefore; /* Make sure we have notifications installed and that TOOLHELP is OK */ if (!wLibInstalled || !wNotifyInstalled) return FALSE; /* NULL hTask means current task */ if (!hTask) hTask = GetCurrentTask(); /* First try to find the task */ pBefore = NULL; for (pNotify = npNotifyHead ; pNotify ; pNotify = pNotify->pNext) if (pNotify->hTask == hTask) break; else pBefore = pNotify; if (!pNotify) return FALSE; /* Unhook the death signal proc only if there is no interrupt handler */ if (!InterruptIsHooked(hTask)) SignalUnRegister(hTask); /* Check to see if the notification handler is about to use this entry. * If it is, we point it to the next one, if any. */ if (npNotifyNext == pNotify) npNotifyNext = pNotify->pNext; /* Remove it from the list */ if (!pBefore) npNotifyHead = pNotify->pNext; else pBefore->pNext = pNotify->pNext; /* Free the structure */ LocalFree((HANDLE)pNotify); /* If there are no more handlers, unhook the callback */ if (!npNotifyHead) { NotifyUnInit(); wNotifyInstalled = FALSE; } return TRUE;}
开发者ID:chunhualiu,项目名称:OpenNT,代码行数:52,
示例30: SetWindowsHookEx16/*********************************************************************** * SetWindowsHookEx (USER.291) */HHOOK WINAPI SetWindowsHookEx16( INT16 id, HOOKPROC16 proc, HINSTANCE16 hInst, HTASK16 hTask ){ struct user_thread_info *thread_info = get_user_thread_info(); struct hook16_queue_info *info; HHOOK hook; int index = id - WH_MINHOOK; if (id < WH_MINHOOK || id > WH_MAXHOOK16) return 0; if (!hook_procs[index]) { FIXME( "hook type %d broken in Win16/n", id ); return 0; } if (!hTask) FIXME( "System-global hooks (%d) broken in Win16/n", id ); else if (hTask != GetCurrentTask()) { FIXME( "setting hook (%d) on other task not supported/n", id ); return 0; } if (!(info = thread_info->hook16_info)) { if (!(info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*info) ))) return 0; thread_info->hook16_info = info; } if (info->hook[index]) { FIXME( "Multiple hooks (%d) for the same task not supported yet/n", id ); return 0; } if (!(hook = SetWindowsHookExA( id, hook_procs[index], 0, GetCurrentThreadId() ))) return 0; info->hook[index] = hook; info->proc[index] = proc; return hook;}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:38,
注:本文中的GetCurrentTask函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetCurrentThread函数代码示例 C++ GetCurrentState函数代码示例 |