• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ VersionInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中VersionInfo的典型用法代码示例。如果您正苦于以下问题:C++ VersionInfo类的具体用法?C++ VersionInfo怎么用?C++ VersionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VersionInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TEST

TEST(VersionInfo, getVersion) {
  VersionInfo version;
  jsonxx::Object versionJson = version.getVersion();
  
  ASSERT_EQ(1, versionJson.size());
  ASSERT_EQ(VERSION, versionJson.get<string>("version"));
}
开发者ID:jaanmurumets,项目名称:chrome-token-signing,代码行数:7,代码来源:VersionInfoTest.cpp


示例2: Q_ASSERT

void ResultsPage::initializePage()
{
    // Register this instance as the Qt message handler.
    Q_ASSERT(instance == NULL);
    instance = this;
    previousMessageHandler = qInstallMessageHandler(&ResultsPage::messageHandler);

    // Debug log the application version information.
    VersionInfo versionInfo;
    if (versionInfo.isValid()) {
        qDebug() << QApplication::applicationName()
                 << versionInfo.fileVersionString()
                 << versionInfo.fileInfo(QLatin1String("SpecialBuild"));
    }

    // Debug log the hook version information.
#ifdef Q_OS_WIN
    for (int index = 0; index < 2; ++index) {
        const QDir dir = (index == 0) ?
            FlowSyncHook::flowSyncDir() : FlowSyncHook::installableHookDir();
        const int version = FlowSyncHook::getVersion(dir);
        qDebug() << QDir::toNativeSeparators(dir.absolutePath())
                 << "hook version" << version;
    }
#endif

    // Once the application is ready, begin the processing.
    QTimer::singleShot(0, converter, SLOT(start()));
}
开发者ID:wgreven,项目名称:bipolar,代码行数:29,代码来源:resultspage.cpp


示例3: getDownloadInfo

void UpdateManager::getDownloadInfo()
{
	//string currentVersion,newVersion;
	//currentVersion=UpDateData::sharedInstance()->getVersion();
	//newVersion=UpDateData::sharedInstance()->getNewVersion();
	vector<VersionInfo> data;
	VersionInfo vi;
	UpDateData::sharedInstance()->getVersionDataVector(data);
	for(unsigned int i=0;i<data.size();++i)
	{
		vi=data[i];
		CCLog("getDownloadInfo-------------------------------------------name is %s,path is %s",vi.getName(),vi.getPath());
		
		
			if(getFileExtention(vi.getPath())==string("apk"))
			{
				downloadInfo.clear();
				haveApk=true;
#if(CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID)
//				Dependence::removeData();
#endif
			}
			downloadInfo.push_back(vi);
		
			
		
	}
	for(unsigned int i=0;i<downloadInfo.size();i++)
	{
		vi=downloadInfo[i];
		CCLog("really download is %s",vi.getName());
	}
	

}
开发者ID:ff78,项目名称:son,代码行数:35,代码来源:UpdateManager.cpp


示例4: generateApiTesterFile

/* Generate a test file that will be used in the frameworks/compile/slang/tests unit tests.
 * This file tests that all RenderScript APIs can be called for the specified API level.
 * To avoid the compiler agressively pruning out our calls, we use globals as inputs and outputs.
 *
 * Since some structures can't be defined at the global level, we use casts of simple byte
 * buffers to get around that restriction.
 *
 * This file can be used to verify the white list that's also generated in this file.  To do so,
 * run "llvm-nm -undefined-only -just-symbol-name" on the resulting bit code.
 */
static bool generateApiTesterFile(const string& slangTestDirectory, int apiLevel) {
    GeneratedFile file;
    if (!file.start(slangTestDirectory, "all" + to_string(apiLevel) + ".rs")) {
        return false;
    }

    /* This unusual comment is used by slang/tests/test.py to know which parameter to pass
     * to llvm-rs-cc when compiling the test.
     */
    file << "// -target-api " << apiLevel << " -Wno-deprecated-declarations\n";

    file.writeNotices();
    file << "#pragma version(1)\n";
    file << "#pragma rs java_package_name(com.example.renderscript.testallapi)\n\n";
    if (apiLevel < 23) {  // All rs_graphics APIs were deprecated in api level 23.
        file << "#include \"rs_graphics.rsh\"\n\n";
    }

    /* The code below emits globals and calls to functions in parallel.  We store
     * the calls in a stream so that we can emit them in the file in the proper order.
     */
    ostringstream calls;
    unsigned int variableNumber = 0;  // Used to generate unique names.
    for (auto f : systemSpecification.getFunctions()) {
        const Function* function = f.second;
        for (auto spec : function->getSpecifications()) {
            VersionInfo info = spec->getVersionInfo();
            if (!info.includesVersion(apiLevel)) {
                continue;
            }
            if (info.intSize == 32) {
                calls << "#ifndef __LP64__\n";
            } else if (info.intSize == 64) {
                calls << "#ifdef __LP64__\n";
            }
            for (auto permutation : spec->getPermutations()) {
                generateTestCall(&file, &calls, &variableNumber, *function, *permutation);
            }
            if (info.intSize != 0) {
                calls << "#endif\n";
            }
        }
    }
    file << "\n";

    // Modify the style of kernel as required by the API level.
    if (apiLevel >= 23) {
        file << "void RS_KERNEL test(int in, rs_kernel_context context) {\n";
    } else if (apiLevel >= 17) {
        file << "void RS_KERNEL test(int in) {\n";
    } else {
        file << "void root(const int* in) {\n";
    }
    file << calls.str();
    file << "}\n";

    return true;
}
开发者ID:cpflayan,项目名称:android_frameworks_rs-dt,代码行数:68,代码来源:GenerateStubsWhiteList.cpp


示例5: OpenProcess

bool SHMProcess::Private::validate(vector <VersionInfo *> & known_versions)
{
    // try to identify the DF version
    IMAGE_NT_HEADERS32 pe_header;
    IMAGE_SECTION_HEADER sections[16];
    HMODULE hmod = NULL;
    DWORD junk;
    HANDLE hProcess;
    bool found = false;
    identified = false;
    // open process, we only need the process open
    hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, process_ID );
    if (NULL == hProcess)
        return false;

    // try getting the first module of the process
    if(EnumProcessModules(hProcess, &hmod, 1 * sizeof(HMODULE), &junk) == 0)
    {
        CloseHandle(hProcess);
        // cout << "EnumProcessModules fail'd" << endl;
        return false;
    }
    // got base ;)
    uint32_t base = (uint32_t)hmod;

    // read from this process
    uint32_t pe_offset = self->readDWord(base+0x3C);
    self->read(base + pe_offset                   , sizeof(pe_header), (uint8_t *)&pe_header);
    self->read(base + pe_offset+ sizeof(pe_header), sizeof(sections) , (uint8_t *)&sections );

    // iterate over the list of memory locations
    vector<VersionInfo *>::iterator it;
    for ( it=known_versions.begin() ; it < known_versions.end(); it++ )
    {
        uint32_t pe_timestamp;
        try
        {
            pe_timestamp = (*it)->getPE();
        }
        catch(Error::MissingMemoryDefinition&)
        {
            continue;
        }
        if (pe_timestamp == pe_header.FileHeader.TimeDateStamp)
        {
            VersionInfo *m = new VersionInfo(**it);
            m->RebaseAll(base);
            memdescriptor = m;
            m->setParentProcess(self);
            identified = true;
            cerr << "identified " << m->getVersion() << endl;
            CloseHandle(hProcess);
            return true;
        }
    }
    return false;
}
开发者ID:jimhester,项目名称:dfhack,代码行数:57,代码来源:DFProcess-windows-SHM.cpp


示例6: main

int main(int argc, char *argv[]) {
    // Setup the primary Qt application object.
    QApplication app(argc, argv);
    app.setApplicationName(APPLICATION_NAME);
    app.setOrganizationName(ORGANISATION_NAME);
    app.setOrganizationDomain(ORGANISATION_DOMAIN);
    VersionInfo versionInfo;
    if (versionInfo.isValid()) {
        app.setApplicationVersion(versionInfo.fileVersionString());
    }

    // Default to the Oxygen theme, if no other theme is configured yet.
    if (QIcon::themeName().isEmpty()) {
        QIcon::setThemeName(QLatin1String("oxygen"));
    }

    // Try to load a localised translator.
    QTranslator translator;
    if (translator.load(QLocale::system().name(),app.applicationDirPath()+QLatin1String("/../i18n")))
        app.installTranslator(&translator);

#ifdef Q_OS_WIN
    // Install the hook now, if requested via the command line.
    if (app.arguments().contains(QLatin1Literal("-install-hook"))) {
        QErrorMessage::qtHandler(); // Expose any internal errors / warnings.
        const QDir fromDir = FlowSyncHook::installableHookDir();
        const QDir toDir = FlowSyncHook::flowSyncDir();
        if (!fromDir.exists(QLatin1String("Qt5Network.dll"))) {
            QMessageBox::warning(NULL, QString(),
                app.tr("Installable hook not found."));
            return 1;
        }
        if (!toDir.exists(QLatin1String("Qt5Network.dll"))) {
            QMessageBox::warning(NULL, QString(),
                app.tr("Failed to locate Polar FlowSync installation."));
            return 2;
        }
        const int fromVersion = FlowSyncHook::getVersion(fromDir);
        const int toVersion = FlowSyncHook::getVersion(toDir);
        if (fromVersion > toVersion) {
            if (!FlowSyncHook::install(fromDir, toDir)) {
                QMessageBox::warning(NULL, QString(),
                    app.tr("Failed to install hook DLL."));
                return 3;
            }
        }
        return 0;
    }
#endif

    // Instantiate the main window.
    MainWizard mainWizard;
    mainWizard.show();
    return app.exec();
}
开发者ID:gitter-badger,项目名称:bipolar,代码行数:55,代码来源:main.cpp


示例7:

Engravings::Engravings(DFContextShared * d_)
{
    d = new Private;
    d->d = d_;
    d->owner = d_->p;
    d->p_engr = 0;
    d->Inited = d->Started = false;
    VersionInfo * mem = d->d->offset_descriptor;
    d->engraving_vector = mem->getGroup("Engravings")->getAddress ("vector");
    d->Inited = true;
}
开发者ID:NonRealDeveloper,项目名称:dfhack,代码行数:11,代码来源:Engravings.cpp


示例8:

Constructions::Constructions(DFContextShared * d_)
{
    d = new Private;
    d->d = d_;
    d->owner = d_->p;
    d->p_cons = 0;
    d->Inited = d->Started = false;
    VersionInfo * mem = d->d->offset_descriptor;
    d->construction_vector = mem->getGroup("Constructions")->getAddress ("vector");
    d->Inited = true;
}
开发者ID:nickrart,项目名称:dfhack,代码行数:11,代码来源:Constructions.cpp


示例9: write_esxdl

void ESDLcompiler::write_esxdl()
{
    esxdlcontent.clear();

    VersionInfo * vi;
    for (vi=versions;vi;vi=vi->next)
    {
        vi->toString(esxdlcontent);
    }

    if(outputIncludes)
    {
        IncludeInfo * ii;
        for (ii=hcp->includes;ii;ii=ii->next)
        {
            ii->toString(esxdlcontent);
        }
    }

    EspMessageInfo * mi;
    for (mi=msgs;mi;mi=mi->next)
    {
        mi->toString(esxdlcontent);
    }

    EspServInfo *si;
    for (si=servs;si;si=si->next)
    {
        si->toString(esxdlcontent);
    }

    if (methods)
    {
        EspMethodInfo *sm;
        for (sm=methods;sm;sm=sm->next)
        {
            sm->toString(esxdlcontent);
        }
    }


    if (esxdlo > 0)
    {
        //Populate the file
        StringBuffer tmp;
        tmp.setf("<esxdl name=\"%s\">\n", name.str()).append(esxdlcontent.str()).append("</esxdl>");
        gOutfile = esxdlo;
        outs(tmp.str());
        gOutfile = -1;
    }
}
开发者ID:miguelvazq,项目名称:HPCC-Platform,代码行数:51,代码来源:esdlcomp.cpp


示例10: main

int main(int, char**)
{
#if ACKWARD_MAJOR_VERSION < 1
// probably not ready for prime-time!
#else
// Feel free to use this code to perform brain surgery while launching a space shuttle.
#endif

    // Get the current version info.
    VersionInfo info = versionInfo();

    // Return the major version.
    return info.majorVersion();
}
开发者ID:abingham,项目名称:ackward,代码行数:14,代码来源:Version.cpp


示例11: catch

Gui::Gui(DFContextShared * _d)
{

    d = new Private;
    d->d = _d;
    d->owner = _d->p;
    VersionInfo * mem = d->d->offset_descriptor;
    OffsetGroup * OG_Gui = mem->getGroup("GUI");
    try
    {
        d->current_menu_state_offset = OG_Gui->getAddress("current_menu_state");
        d->MenuStateInited = true;
    }
    catch(exception &){};
    try
    {
        d->view_screen_offset = OG_Gui->getAddress ("view_screen");
        d->ViewScreeInited = true;
    }
    catch(exception &){};
    OffsetGroup * OG_Position;
    try
    {
        OG_Position = mem->getGroup("Position");
        d->window_x_offset = OG_Position->getAddress ("window_x");
        d->window_y_offset = OG_Position->getAddress ("window_y");
        d->window_z_offset = OG_Position->getAddress ("window_z");
        d->cursor_xyz_offset = OG_Position->getAddress ("cursor_xyz");
        d->window_dims_offset = OG_Position->getAddress ("window_dims");
        d->Started = true;
    }
    catch(Error::All &){};
    try
    {
        OffsetGroup * OG_Hotkeys = mem->getGroup("Hotkeys");
        d->hotkey_start = OG_Hotkeys->getAddress("start");
        d->hotkey_mode_offset = OG_Hotkeys->getOffset ("mode");
        d->hotkey_xyz_offset = OG_Hotkeys->getOffset("coords");
        d->hotkey_size = OG_Hotkeys->getHexValue("size");
        d->StartedHotkeys = true;
    }
    catch(Error::All &){};
    try
    {
        d->screen_tiles_ptr_offset = OG_Position->getAddress ("screen_tiles_pointer");
        d->StartedScreen = true;
    }
    catch(Error::All &){};
}
开发者ID:NonRealDeveloper,项目名称:dfhack,代码行数:49,代码来源:Gui.cpp


示例12: sprintf

bool SHMProcess::Private::validate(vector <VersionInfo *> & known_versions)
{
    char exe_link_name [256];
    char target_name[1024];
    int target_result;
    // find the binary
    sprintf(exe_link_name,"/proc/%d/exe", process_ID);
    target_result = readlink(exe_link_name, target_name, sizeof(target_name)-1);
    if (target_result == -1)
    {
        perror("readlink");
        return false;
    }
    // make sure we have a null terminated string...
    // see http://www.opengroup.org/onlinepubs/000095399/functions/readlink.html
    target_name[target_result] = 0;

    md5wrapper md5;
    // get hash of the running DF process
    string hash = md5.getHashFromFile(target_name);
    vector<VersionInfo *>::iterator it;
    // cerr << exe_file << " " << hash <<  endl;
    // iterate over the list of memory locations
    for ( it=known_versions.begin() ; it < known_versions.end(); it++ )
    {
        try {
            if(hash == (*it)->getMD5()) // are the md5 hashes the same?
            {
                VersionInfo *m = new VersionInfo(**it);
                memdescriptor = m;
                m->setParentProcess(dynamic_cast<Process *>( self ));
                identified = true;
                // cerr << "identified " << m->getVersion() << endl;
                return true;
            }
        }
        catch (Error::AllMemdef&)
        {
            continue;
        }
    }
    return false;
}
开发者ID:potato,项目名称:dfhack,代码行数:43,代码来源:DFProcess-linux-SHM.cpp


示例13: main

int main(int argc, char **argv) {

  Gtk::Main kit(argc, argv);

  InputParser parser(cin);
  _log("Parsing input...");
  Object json = parser.readBody();

  if (json.has<string>("lang")) {
    l10nLabels.setLanguage(json.get<string>("lang"));
  }

  string response;

  if (json.get<string>("protocol") != "https:") {
    ExtensionDialog dialog;
    response = dialog.error(ONLY_HTTPS_ALLOWED).json();
  } else {
    string type = json.get<string>("type");

    if (type == "SIGN") {
      string hashFromStdIn = json.get<String>("hash");
      string certId = json.get<String>("id");
      _log("signing hash: %s, with certId: %s", hashFromStdIn.c_str(), certId.c_str());
      Signer signer(hashFromStdIn, certId);
      response = signer.sign().json();
    } else if (type == "CERT") {
      CertificateSelection cert;
      response = cert.getCert().json();
    } else if (type == "VERSION") {
      VersionInfo version;
      response = version.getVersion().json();
    }
  }
  int responseLength = response.size();
  unsigned char *responseLengthAsBytes = intToBytesLittleEndian(responseLength);
  cout.write((char *) responseLengthAsBytes, 4);
  _log("Response(%i) %s ", responseLength, response.c_str());
  cout << response << endl;
  free(responseLengthAsBytes);
  return EXIT_SUCCESS;
}
开发者ID:jaanmurumets,项目名称:chrome-token-signing,代码行数:42,代码来源:chrome-host.cpp


示例14: QWizard

MainWizard::MainWizard(QWidget *parent, Qt::WindowFlags flags): QWizard(parent,flags) {
    setWindowTitle(tr("%1 %2")
        .arg(QApplication::applicationName())
        .arg(QStringList(QApplication::applicationVersion().split(QLatin1Char('.')).mid(0, 3)).join(QLatin1Char('.'))));
    const VersionInfo versionInfo;
    const QString specialBuild = (versionInfo.isValid()) ?
        versionInfo.fileInfo(QLatin1String("SpecialBuild")) : QString();
    if (!specialBuild.isEmpty()) {
        setWindowTitle(windowTitle() + QLatin1Char(' ') + specialBuild);
    }

    setOption(QWizard::NoBackButtonOnLastPage);
    #if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
    setOption(QWizard::NoCancelButtonOnLastPage);
    #endif

    addPage(new InputsPage());
    addPage(new OutputsPage());
    addPage(new ResultsPage());
}
开发者ID:gitter-badger,项目名称:bipolar,代码行数:20,代码来源:mainwizard.cpp


示例15: catch

Units::Units()
{
    Core & c = Core::getInstance();
    d = new Private;
    d->owner = c.p;
    VersionInfo * minfo = c.vinfo;
    d->Inited = false;
    d->Started = false;
    d->IdMapReady = false;
    d->trans = c.getTranslation();
    d->trans->InitReadNames(); // FIXME: throws on error

    OffsetGroup *OG_Creatures = minfo->getGroup("Creatures");

    creatures = 0;
    try
    {
        creatures = (vector <df_unit *> *) OG_Creatures->getAddress ("vector");
        d->dwarf_race_index_addr = (void *) OG_Creatures->getAddress("current_race");
        d->dwarf_civ_id_addr = (void *) OG_Creatures->getAddress("current_civ");
    }
    catch(Error::All&){};
    d->Inited = true;
}
开发者ID:kaypy,项目名称:dfhack,代码行数:24,代码来源:Units.cpp


示例16: findSubstitute

/* For the given API level and bitness (e.g. 32 or 64 bit), try to find a
 * substitution for the provided type name, as would be done (mostly) by a
 * preprocessor.  Returns empty string if there's no substitution.
 */
static string findSubstitute(const string& typeName, int apiLevel, int intSize) {
    const auto& types = systemSpecification.getTypes();
    const auto type = types.find(typeName);
    if (type != types.end()) {
        for (TypeSpecification* spec : type->second->getSpecifications()) {
            // Verify this specification applies
            const VersionInfo info = spec->getVersionInfo();
            if (!info.includesVersion(apiLevel) || (info.intSize != 0 && info.intSize != intSize)) {
                continue;
            }
            switch (spec->getKind()) {
                case SIMPLE: {
                    /* For simple typedefs, replace it unless it's the special case of _RS_HANDLE
                     * which is a macro of a struct.
                     */
                    const string s = spec->getSimpleType();
                    if (s != "_RS_HANDLE") {
                        return s;
                    }
                    break;
                }
                case STRUCT: {
                    const string s = spec->getStructName();
                    if (!s.empty()) {
                        return s;
                    }
                    break;
                }
                case ENUM:
                    // Do nothing
                    break;
            }
        }
    }
    return "";
}
开发者ID:cpflayan,项目名称:android_frameworks_rs-dt,代码行数:40,代码来源:GenerateStubsWhiteList.cpp


示例17: updateLogoButtonText

    void updateLogoButtonText()
    {
        String text;

        if(layoutMode == NormalLayout)
        {
            VersionInfo currentVersion;
            if(String(DOOMSDAY_RELEASE_TYPE) == "Stable")
            {
                text = _E(b) + currentVersion.base();
            }
            else
            {
                text = _E(b) + currentVersion.base() + " " +
                       _E(l) + String("#%1").arg(currentVersion.build);
            }
        }
        else
        {
            // Remove the version number if we're short of space.
        }

        logo->setText(text);
    }
开发者ID:stefanbeeman,项目名称:end-of-days,代码行数:24,代码来源:taskbarwidget.cpp


示例18:

Gui::Gui()
{
    Core & c = Core::getInstance();
    d = new Private;
    d->owner = c.p;
    VersionInfo * mem = c.vinfo;
    // Setting up menu state
    df_menu_state = (uint32_t *) & df::global::ui->main.mode;

    d->window_x_offset = (int32_t *) mem->getAddress ("window_x");
    d->window_y_offset = (int32_t *) mem->getAddress ("window_y");
    d->window_z_offset = (int32_t *) mem->getAddress ("window_z");
    if(d->window_z_offset && d->window_y_offset && d->window_x_offset)
        d->Started = true;

    d->menu_width_offset = (uint8_t *) mem->getAddress("ui_menu_width");
    d->area_map_width_offset = (uint8_t *) mem->getAddress("ui_area_map_width");
    if (d->menu_width_offset && d->area_map_width_offset)
        d->StartedMenu = true;

    d->screen_tiles_ptr_offset = (void *) mem->getAddress ("screen_tiles_pointer");
    if(d->screen_tiles_ptr_offset)
        d->StartedScreen = true;
}
开发者ID:berenm,项目名称:dfhack,代码行数:24,代码来源:Gui.cpp


示例19: d

NormalProcess::NormalProcess(uint32_t pid, vector <VersionInfo *> & known_versions)
: d(new Private())
{
    HMODULE hmod = NULL;
    DWORD junk;
    HANDLE hProcess;
    bool found = false;

    IMAGE_NT_HEADERS32 pe_header;
    IMAGE_SECTION_HEADER sections[16];
    d->identified = false;
    // open process
    hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pid );
    if (NULL == hProcess)
        return;

    // try getting the first module of the process
    if(EnumProcessModules(hProcess, &hmod, 1 * sizeof(HMODULE), &junk) == 0)
    {
        CloseHandle(hProcess);
        // cout << "EnumProcessModules fail'd" << endl;
        return; //if enumprocessModules fails, give up
    }

    // got base ;)
    uint32_t base = (uint32_t)hmod;

    // temporarily assign this to allow some checks
    d->my_handle = hProcess;
    d->my_main_thread = 0;
    // read from this process
    try
    {
        uint32_t pe_offset = readDWord(base+0x3C);
        read(base + pe_offset                   , sizeof(pe_header), (uint8_t *)&pe_header);
        read(base + pe_offset+ sizeof(pe_header), sizeof(sections) , (uint8_t *)&sections );
        d->my_handle = 0;
    }
    catch (exception &)
    {
        CloseHandle(hProcess);
        d->my_handle = 0;
        return;
    }

    // see if there's a version entry that matches this process
    vector<VersionInfo*>::iterator it;
    for ( it=known_versions.begin() ; it < known_versions.end(); it++ )
    {
        // filter by OS
        if(VersionInfo::OS_WINDOWS != (*it)->getOS())
            continue;
        uint32_t pe_timestamp;
        // filter by timestamp, skip entries without a timestamp
        try
        {
            pe_timestamp = (*it)->getPE();
        }
        catch(Error::MissingMemoryDefinition&)
        {
            continue;
        }
        if (pe_timestamp != pe_header.FileHeader.TimeDateStamp)
            continue;

        // all went well
        {
            printf("Match found! Using version %s.\n", (*it)->getVersion().c_str());
            d->identified = true;
            // give the process a data model and memory layout fixed for the base of first module
            VersionInfo *m = new VersionInfo(**it);
            m->RebaseAll(base);
            // keep track of created memory_info object so we can destroy it later
            d->my_descriptor = m;
            m->setParentProcess(this);
            // process is responsible for destroying its data model
            d->my_pid = pid;
            d->my_handle = hProcess;
            d->identified = true;

            // TODO: detect errors in thread enumeration
            vector<uint32_t> threads;
            getThreadIDs( threads );
            d->my_main_thread = OpenThread(THREAD_ALL_ACCESS, FALSE, (DWORD) threads[0]);
            OffsetGroup * strGrp = m->getGroup("string")->getGroup("MSVC");
            d->STLSTR_buf_off = strGrp->getOffset("buffer");
            d->STLSTR_size_off = strGrp->getOffset("size");
            d->STLSTR_cap_off = strGrp->getOffset("capacity");
            found = true;
            break; // break the iterator loop
        }
    }
    // close handle of processes that aren't DF
    if(!found)
    {
        CloseHandle(hProcess);
    }
}
开发者ID:jimhester,项目名称:dfhack,代码行数:98,代码来源:DFProcess-windows.cpp


示例20:

bool VersionInfo::operator==(const VersionInfo &rhs) const
{
    return this->GetString() == rhs.GetString();    //only equal data produces equal strings
}
开发者ID:jamesturk,项目名称:zengine,代码行数:4,代码来源:VersionInfo.cpp



注:本文中的VersionInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VersionTuple类代码示例发布时间:2022-05-31
下一篇:
C++ Version类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap