OperatingSystem::OperatingSystem() { lastProcessId_ = 0; addLibrary("kernel32.dll"); addLibrary("openAL32.dll"); addLibrary("foundation.dll"); addProcess("explorer.exe"); addProcess("winlogon.exe"); addProcess("taskeng.exe"); addProcess("test.exe"); /*auto proc = processes_[1]; proc->createNewThread(); proc->createNewThread(); proc->loadLibrary(getLibraryByName("kernel32.dll")); proc->killThread(2); if (!proc->killThread(0)) { delete proc; processes_.erase(1); } killProcess("test.exe");*/ // <--- ето работаит auto proc = processes_[0]; proc->loadLibrary(getLibraryByName("kernel32.dll")); deleteLibrary("kernel32.dll"); }
void baseProject::addAddon(ofAddon & addon){ for(int i=0;i<(int)addons.size();i++){ if(addons[i].name==addon.name) return; } addons.push_back(addon); for(int i=0;i<(int)addon.includePaths.size();i++){ ofLogVerbose() << "adding addon include path: " << addon.includePaths[i]; addInclude(addon.includePaths[i]); } for(int i=0;i<(int)addon.libs.size();i++){ ofLogVerbose() << "adding addon libs: " << addon.libs[i]; addLibrary(addon.libs[i]); } for(int i=0;i<(int)addon.cflags.size();i++){ ofLogVerbose() << "adding addon cflags: " << addon.cflags[i]; addCFLAG(addon.cflags[i]); } for(int i=0;i<(int)addon.ldflags.size();i++){ ofLogVerbose() << "adding addon ldflags: " << addon.ldflags[i]; addLDFLAG(addon.ldflags[i]); } for(int i=0;i<(int)addon.srcFiles.size(); i++){ ofLogVerbose() << "adding addon srcFiles: " << addon.srcFiles[i]; addSrc(addon.srcFiles[i],addon.filesToFolders[addon.srcFiles[i]]); } }
void visualStudioProject::addAddon(ofAddon & addon){ for(int i=0;i<(int)addon.includePaths.size();i++){ addInclude(addon.includePaths[i]); } for(int i=0;i<(int)addon.libs.size();i++){ addLibrary(addon.libs[i]); } for(int i=0;i<(int)addon.srcFiles.size();i++){ addSrc(addon.srcFiles[i],addon.filesToFolders[addon.srcFiles[i]]); } }
int NProj::run(void) { if (NFile::exists("CMakeLists.txt") && !m_force) { throw NException("There's already a CMakeLists.txt file in this" " project. Remove it before running nproj", NException::TOOLS); } m_output.setFileName("CMakeLists.txt"); m_output.open(NIODevice::Truncate); setupHeader(); addModules(); addExecutable(); addLibrary(); m_output.closeDevice(); return 0; }
KSocksConfig::KSocksConfig(QWidget *parent) : KCModule(parent, "kcmkio") { KAboutData *about = new KAboutData(I18N_NOOP("kcmsocks"), I18N_NOOP("KDE SOCKS Control Module"), 0, 0, KAboutData::License_GPL, I18N_NOOP("(c) 2001 George Staikos")); about->addAuthor("George Staikos", 0, "*****@*****.**"); setAboutData( about ); QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); base = new SocksBase(this); layout->add(base); connect(base->_c_enableSocks, SIGNAL(clicked()), this, SLOT(enableChanged())); connect(base->bg, SIGNAL(clicked(int)), this, SLOT(methodChanged(int))); // The custom library connect(base->_c_customPath, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(chooseCustomLib(KURLRequester *))); connect(base->_c_customPath, SIGNAL(textChanged(const QString&)), this, SLOT(customPathChanged(const QString&))); // Additional libpaths connect(base->_c_newPath, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(chooseCustomLib(KURLRequester *))); connect(base->_c_newPath, SIGNAL(returnPressed(const QString&)), this, SLOT(addThisLibrary(const QString&))); connect(base->_c_newPath, SIGNAL(textChanged(const QString&)), this, SLOT(libTextChanged(const QString&))); connect(base->_c_add, SIGNAL(clicked()), this, SLOT(addLibrary())); connect(base->_c_remove, SIGNAL(clicked()), this, SLOT(removeLibrary())); connect(base->_c_libs, SIGNAL(selectionChanged()), this, SLOT(libSelection())); // The "Test" button connect(base->_c_test, SIGNAL(clicked()), this, SLOT(testClicked())); // The config backend load(); }
void visualStudioProject::addAddon(ofAddon & addon){ for(int i=0;i<(int)addons.size();i++){ if(addons[i].name==addon.name) return; } addons.push_back(addon); for(int i=0;i<(int)addon.includePaths.size();i++){ ofLogVerbose() << "adding addon include path: " << addon.includePaths[i]; addInclude(addon.includePaths[i]); } // divide libs into debug and release libs // the most reliable would be to have seperate // folders for debug and release libs // i'm gonna start with a ghetto approach of just // looking for duplicate names except for a d.lib // at the end -> this is not great as many // libs compile with the d somewhere in the middle of the name... vector <string> debugLibs; vector <string> releaseLibs; vector <string> possibleReleaseOrDebugOnlyLibs; for(int i = 0; i < addon.libs.size(); i++){ size_t found = 0; // get the full lib name #ifdef TARGET_WIN32 found = addon.libs[i].find_last_of("\\"); #else found = addon.libs[i].find_last_of("/"); #endif string libName = addon.libs[i].substr(found+1); // get the first part of a lib name ie., libodd.lib -> libodd OR liboddd.lib -> liboddd found = libName.find_last_of("."); string firstPart = libName.substr(0,found); // check this lib name against every other lib name for(int j = 0; j < addon.libs.size(); j++){ // check if this lib name is contained within another lib name and is not the same name if(ofIsStringInString(addon.libs[j], firstPart) && addon.libs[i] != addon.libs[j]){ // if it is then add respecitive libs to debug and release if(!isInVector(addon.libs[j], debugLibs)){ //cout << "adding to DEBUG " << addon.libs[j] << endl; debugLibs.push_back(addon.libs[j]); } if(!isInVector(addon.libs[i], releaseLibs)){ //cout << "adding to RELEASE " << addon.libs[i] << endl; releaseLibs.push_back(addon.libs[i]); } // stop searching break; }else{ // if we only have a release or only have a debug lib // we'll want to add it to both releaseLibs and debugLibs // NB: all debug libs will get added to this vector, // but we catch that once all pairs have been added // since we cannot guarantee the order of parsing libs // although this is innefficient it fixes issues on linux if(!isInVector(addon.libs[i], possibleReleaseOrDebugOnlyLibs)){ possibleReleaseOrDebugOnlyLibs.push_back(addon.libs[i]); } // keep searching... } } } for(int i=0;i<(int)possibleReleaseOrDebugOnlyLibs.size();i++){ if(!isInVector(possibleReleaseOrDebugOnlyLibs[i], debugLibs) && !isInVector(possibleReleaseOrDebugOnlyLibs[i], releaseLibs)){ ofLogVerbose() << "RELEASE ONLY LIBS FOUND " << possibleReleaseOrDebugOnlyLibs[i] << endl; debugLibs.push_back(possibleReleaseOrDebugOnlyLibs[i]); releaseLibs.push_back(possibleReleaseOrDebugOnlyLibs[i]); } } for(int i=0;i<(int)debugLibs.size();i++){ ofLogVerbose() << "adding addon debug libs: " << debugLibs[i]; addLibrary(debugLibs[i], DEBUG_LIB); } for(int i=0;i<(int)releaseLibs.size();i++){ ofLogVerbose() << "adding addon release libs: " << releaseLibs[i]; addLibrary(releaseLibs[i], RELEASE_LIB); } for(int i=0;i<(int)addon.srcFiles.size(); i++){ ofLogVerbose() << "adding addon srcFiles: " << addon.srcFiles[i]; addSrc(addon.srcFiles[i],addon.filesToFolders[addon.srcFiles[i]]); } }
error System::addLibraryString( const char* buffer, size_t buffersize ) { return addLibrary("fxstring",buffer, buffersize); }
error System::addLibraryFile( const char* filename ) { return addLibrary("fxfile",filename,strlen(filename)); }