这篇教程C++ Detach函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Detach函数的典型用法代码示例。如果您正苦于以下问题:C++ Detach函数的具体用法?C++ Detach怎么用?C++ Detach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Detach函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetContext void TerminalDisplay::DisplayInfo(const std::vector<std::string>& Options) { char infoColIdx = 0; if (GetContext()->GetColorizer()) { infoColIdx = GetContext()->GetColorizer()->GetInfoColor(); } WriteRawString("/n", 1); for (size_t i = 0, n = Options.size(); i < n; ++i) { Text t(Options[i], infoColIdx); WriteWrappedElement(t, 0, 0, (size_t) -1); WriteRawString("/n", 1); } // Reset position Detach(); Attach(); }
开发者ID:0x0all,项目名称:ROOT,代码行数:16,
示例2: Attachvoid TaskManager::UpdateProcesses(Uint32 deltaMs){ TaskPtr next; for (auto current : task_list) { if (current->IsDead()) { next = current->GetNext(); if (next) { current->SetNext(TaskPtr(nullptr)); Attach(next); } Detach(current); } else if (current->IsActive() && !current->IsPaused()) { current->OnUpdate(deltaMs); } }}
开发者ID:stephenap07,项目名称:sp_engine,代码行数:16,
示例3: Detach// ----------------------------------------------------------------------------void MouseSap::OnWindowClose(wxEvent& event)// ----------------------------------------------------------------------------{ // wxEVT_DESTROY entry wxWindow* pWindow = (wxWindow*)(event.GetEventObject()); if ( (pWindow) && (m_EditorPtrs.Index(pWindow) != wxNOT_FOUND)) { // window is one of ours Detach(pWindow); #ifdef LOGGING LOGIT( _T("OnWindowClose Detached %p"), pWindow); #endif //LOGGING } event.Skip();}//OnWindowClose
开发者ID:stahta01,项目名称:EmBlocks,代码行数:17,
示例4: Detachvoid cEntity::AttachTo(cEntity * a_AttachTo){ if (m_AttachedTo == a_AttachTo) { // Already attached to that entity, nothing to do here return; } // Detach from any previous entity: Detach(); // Attach to the new entity: m_AttachedTo = a_AttachTo; a_AttachTo->m_Attachee = this; m_World->BroadcastAttachEntity(*this, a_AttachTo);}
开发者ID:ravenscroftj,项目名称:MCServer,代码行数:16,
示例5: Detach/// <summary>/// Create new process and attach to it/// </summary>/// <param name="path">Executable path</param>/// <param name="suspended">Leave process in suspended state. To resume process one should resume its main thread</param>/// <param name="forceInit">If 'suspended' is true, this flag will enforce process initialization via second thread</param>/// <param name="cmdLine">Process command line</param>/// <param name="currentDir">Startup directory</param>/// <param name="pStartup">Additional startup params</param>/// <returns>Status code</returns>NTSTATUS Process::CreateAndAttach( const std::wstring& path, bool suspended /*= false*/, bool forceInit /*= true*/, const std::wstring& cmdLine /*= L""*/, const wchar_t* currentDir /*= nullptr*/, STARTUPINFOW* pStartup /*= nullptr*/ ){ Detach(); STARTUPINFOW si = { 0 }; PROCESS_INFORMATION pi = { 0 }; if (!pStartup) pStartup = &si; if (!CreateProcessW( path.c_str(), const_cast<LPWSTR>(cmdLine.c_str()), NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, currentDir, pStartup, &pi )) { return LastNtStatus(); } // Get handle ownership auto status = _core.Open( pi.hProcess ); if (NT_SUCCESS( status )) { _nativeLdr.Init(); // Check if process must be left in suspended mode if (suspended) { // Create new thread to make sure LdrInitializeProcess gets called if (forceInit) EnsureInit(); } else ResumeThread( pi.hThread ); } // Close unneeded handles CloseHandle( pi.hThread ); return status;}
开发者ID:ApocalypsEnd,项目名称:Blackbone,代码行数:57,
示例6: mainint main(int argc, char *argv[]){ HIJACK *hijack; FUNC *func; unsigned long addr; PLT *plts, *plt; if (argc != 2) usage(argv[0]); hijack = InitHijack(); ToggleFlag(hijack, F_DEBUG); ToggleFlag(hijack, F_DEBUG_VERBOSE); AssignPid(hijack, atoi(argv[1])); if (Attach(hijack) != ERROR_NONE) { fprintf(stderr, "[-] Couldn't attach!/n"); exit(EXIT_FAILURE); } if (LocateAllFunctions(hijack) != ERROR_NONE) { fprintf(stderr, "[-] Couldn't locate all functions!/n"); exit(EXIT_FAILURE); } if (LocateSystemCall(hijack) != ERROR_NONE) { fprintf(stderr, "[-] Couldn't locate system call!/n"); exit(EXIT_FAILURE); } addr = MapMemory(hijack, NULL, 8192, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_SHARED); if (GetErrorCode(hijack) != ERROR_NONE) { fprintf(stderr, "[-] %s/n", GetErrorString(hijack)); perror("ptrace"); } printf("[*] PLT/GOT @ 0x%016lx/n", hijack->pltgot); printf("[*] Baseaddr @ 0x%016lx/n", hijack->baseaddr); printf("[*] Syscall @ 0x%016lx/n", hijack->syscalladdr); printf("[*] addr @ 0x%016lx/n", addr); Detach(hijack); return 0;}
开发者ID:0xDEC0DE8,项目名称:libhijack,代码行数:47,
示例7: switchvoid CInventoryItem::OnEvent (NET_Packet& P, u16 type){ switch (type) { case GE_ADDON_ATTACH: { u32 ItemID; P.r_u32 (ItemID); CInventoryItem* ItemToAttach = smart_cast<CInventoryItem*>(Level().Objects.net_Find(ItemID)); if (!ItemToAttach) break; Attach(ItemToAttach,true); CActor* pActor = smart_cast<CActor*>(object().H_Parent()); if (pActor && pActor->inventory().ActiveItem() == this) { pActor->inventory().SetPrevActiveSlot(pActor->inventory().GetActiveSlot()); pActor->inventory().Activate(NO_ACTIVE_SLOT); } }break; case GE_ADDON_DETACH: { string64 i_name; P.r_stringZ (i_name); Detach(i_name, true); CActor* pActor = smart_cast<CActor*>(object().H_Parent()); if (pActor && pActor->inventory().ActiveItem() == this) { pActor->inventory().SetPrevActiveSlot(pActor->inventory().GetActiveSlot()); pActor->inventory().Activate(NO_ACTIVE_SLOT); }; }break; case GE_CHANGE_POS: { Fvector p; P.r_vec3(p); CPHSynchronize* pSyncObj = NULL; pSyncObj = object().PHGetSyncItem(0); if (!pSyncObj) return; SPHNetState state; pSyncObj->get_State(state); state.position = p; state.previous_position = p; pSyncObj->set_State(state); }break; }}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:47,
示例8: Detach/*----------------------------------------------------------------------------------------------------------------------| Sets all data members to their factory default settings: `inf_open', `logf_open' and `quit_now' are set to false;| `message' to the null string, and the pointers `data', `characters', `assumptions', `taxa' and `trees'| are all set to NULL. The C-string `next_command' is allocated COMMAND_MAXLEN + 1 bytes if it is currently NULL,| and its first byte is set to the null character to create an empty `next_command' string.*/void GarliReader::FactoryDefaults(){ isEmpty = true; inf_open = false; logf_open = false; quit_now = false; message.clear(); if (trees != NULL) { Detach(trees); delete trees; trees = NULL; } if (taxa != NULL) { Detach(taxa); delete taxa; taxa = NULL; } if (assumptions != NULL) { Detach(assumptions); delete assumptions; assumptions = NULL; } if (distances != NULL) { Detach(distances); delete distances; distances = NULL; } if (characters != NULL) { Detach(characters); delete characters; characters = NULL; } if (data != NULL) { Detach(data); delete data; data = NULL; } if (next_command == NULL) next_command = new char[COMMAND_MAXLEN + 1]; next_command[0] = '/0';}
开发者ID:rekepalli,项目名称:garli,代码行数:60,
|