这篇教程C++ GetNativeSystemInfo函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetNativeSystemInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetNativeSystemInfo函数的具体用法?C++ GetNativeSystemInfo怎么用?C++ GetNativeSystemInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetNativeSystemInfo函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Java_net_rubygrapefruit_platform_internal_jni_NativeLibraryFunctions_getSystemInfoJNIEXPORT void JNICALLJava_net_rubygrapefruit_platform_internal_jni_NativeLibraryFunctions_getSystemInfo(JNIEnv *env, jclass target, jobject info, jobject result) { jclass infoClass = env->GetObjectClass(info); OSVERSIONINFOEX versionInfo; versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if (GetVersionEx((OSVERSIONINFO*)&versionInfo) == 0) { mark_failed_with_errno(env, "could not get version info", result); return; } SYSTEM_INFO systemInfo; GetNativeSystemInfo(&systemInfo); jstring arch = NULL; if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { arch = env->NewStringUTF("amd64"); } else if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) { arch = env->NewStringUTF("x86"); } else if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) { arch = env->NewStringUTF("ia64"); } else { arch = env->NewStringUTF("unknown"); } jmethodID method = env->GetMethodID(infoClass, "windows", "(IIIZLjava/lang/String;)V"); env->CallVoidMethod(info, method, versionInfo.dwMajorVersion, versionInfo.dwMinorVersion, versionInfo.dwBuildNumber, versionInfo.wProductType == VER_NT_WORKSTATION, arch);}
开发者ID:breskeby,项目名称:native-platform,代码行数:29,
示例2: winIs64BitSystemQTCREATOR_UTILS_EXPORT bool winIs64BitSystem(){ SYSTEM_INFO systemInfo; GetNativeSystemInfo(&systemInfo); return systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64;}
开发者ID:Andersbakken,项目名称:rparser,代码行数:7,
示例3: sysctl/**@Status Caveat@Notes Only HW_AVAILCPU is supported*/extern "C" int sysctl(const int* name, u_int namelen, void* oldp, size_t* oldlenp, const void* newp, size_t newlen) { if (namelen < 2 || name == nullptr) { errno = EINVAL; return -1; } if (namelen != 2 || name[0] != CTL_HW || name[1] != HW_AVAILCPU) { UNIMPLEMENTED_WITH_MSG("sysctl only supports querying HW_AVAILCPU"); errno = EOPNOTSUPP; return -1; } if (*oldlenp < sizeof(int)) { *oldlenp = sizeof(int); errno = ENOMEM; return -1; } SYSTEM_INFO systemInfo; GetNativeSystemInfo(&systemInfo); *static_cast<int*>(oldp) = systemInfo.dwNumberOfProcessors; *oldlenp = sizeof(int); return 0;}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:33,
示例4: GetNativeSystemInfo NTSTATUS ProcessCore::Init() { // Detect x86 OS SYSTEM_INFO info = {{0}}; GetNativeSystemInfo(&info); if(info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) { _native.reset(new x86Native(_hProcess)); } else { // Detect wow64 barrier BOOL wowSrc = FALSE; IsWow64Process(GetCurrentProcess(), &wowSrc); if(wowSrc == TRUE) _native.reset(new NativeWow64(_hProcess)); else _native.reset(new Native(_hProcess)); } // Get DEP info // For native x64 processes DEP is always enabled if(_native->GetWow64Barrier().targetWow64 == false) { _dep = true; } else { DWORD flags = 0; BOOL perm = 0; if(SAFE_CALL(GetProcessDEPPolicy, _hProcess, &flags, &perm)) _dep = (flags & PROCESS_DEP_ENABLE) != 0; } return STATUS_SUCCESS; }
开发者ID:MarkHC,项目名称:Blackbone,代码行数:27,
示例5: GetNativeSystemInfoint Engine::GetPrcessorInfo(){ SYSTEM_INFO stInfo; //GetSystemInfo(&stInfo); GetNativeSystemInfo(&stInfo); switch (stInfo.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_INTEL: //printf("Processor Architecture: Intel x86/n"); return 0; break; case PROCESSOR_ARCHITECTURE_IA64: //printf("Processor Type: Intel x64/n"); return 6; break; case PROCESSOR_ARCHITECTURE_AMD64: //printf("Processor Type: AMD 64/n"); return 9; break; default: //printf("Unknown processor architecture/n"); return -1; }}
开发者ID:SLAUC91,项目名称:AntiCheat,代码行数:25,
示例6: load_driver_ virtual int load_driver_() { SYSTEM_INFO sys_info; ZeroMemory(&sys_info, sizeof(sys_info)); GetCurrentDirectory(MAX_PATH - 10, driver_filename); GetNativeSystemInfo(&sys_info); switch(sys_info.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_AMD64: wcscat_s(driver_filename, MAX_PATH, L"//winpmem_64.sys"); if(GetFileAttributes(driver_filename) == INVALID_FILE_ATTRIBUTES) { std::cout << "ERROR: winpmem_64.sys not found in current directory. Download it from https://volatility.googlecode.com/svn-history/r2813/branches/scudette/tools/windows/winpmem/binaries/winpmem_64.sys ." << std::endl; std::cout << "ERROR: Memory bandwidth statistics will not be available." << std::endl; } break; case PROCESSOR_ARCHITECTURE_INTEL: wcscat_s(driver_filename, MAX_PATH, L"//winpmem_32.sys"); if(GetFileAttributes(driver_filename) == INVALID_FILE_ATTRIBUTES) { std::cout << "ERROR: winpmem_32.sys not found in current directory. Download it from https://volatility.googlecode.com/svn-history/r2813/branches/scudette/tools/windows/winpmem/binaries/winpmem_32.sys ." << std::endl; std::cout << "ERROR: Memory bandwidth statistics will not be available." << std::endl; } break; default: return -1; } return 1; }
开发者ID:rafikn,项目名称:bpw-intelPCM,代码行数:31,
示例7: mainint main(int argc, char *argv[]){ uv_setup_args(argc, argv); // no-op on Windows#elsestatic void lock_low32() {#if defined(_P64) && defined(JL_DEBUG_BUILD) // block usage of the 32-bit address space on win64, to catch pointer cast errors char *const max32addr = (char*)0xffffffffL; SYSTEM_INFO info; MEMORY_BASIC_INFORMATION meminfo; GetNativeSystemInfo(&info); memset(&meminfo, 0, sizeof(meminfo)); meminfo.BaseAddress = info.lpMinimumApplicationAddress; while ((char*)meminfo.BaseAddress < max32addr) { VirtualQuery(meminfo.BaseAddress, &meminfo, sizeof(meminfo)); if (meminfo.State == MEM_FREE) { // reserve all free pages in the first 4GB of memory char *first = (char*)meminfo.BaseAddress; char *last = first + meminfo.RegionSize; char *p; if (last > max32addr) last = max32addr; // adjust first up to the first allocation granularity boundary // adjust last down to the last allocation granularity boundary first = (char*)(((long long)first + info.dwAllocationGranularity - 1) & ~(info.dwAllocationGranularity - 1)); last = (char*)((long long)last & ~(info.dwAllocationGranularity - 1)); if (last != first) { p = VirtualAlloc(first, last - first, MEM_RESERVE, PAGE_NOACCESS); // reserve all memory in between assert(p == first); } } meminfo.BaseAddress += meminfo.RegionSize; }#endif}
开发者ID:mpf,项目名称:julia,代码行数:34,
示例8: GetNativeSystemInfo WitchSystemInfo::ProcessorArchitecture WitchSystemInfo::architecture() { static WitchSystemInfo::ProcessorArchitecture arch; if(arch) return arch; #if WITCHENGINE_PLATFORM == WITCHENGINE_PLATFORM_WIN32 || WITCHENGINE_PLATFORM == WITCHENGINE_PLATFORM_WIN64 SYSTEM_INFO sysinfo; GetNativeSystemInfo(&sysinfo); if(sysinfo.wProcessorArchitecture == 9) { arch = WitchSystemInfo::PA_AMD64; } else if(sysinfo.wProcessorArchitecture == 6) { arch = WitchSystemInfo::PA_IA64; } else if(sysinfo.wProcessorArchitecture == 0) { arch = WitchSystemInfo::PA_INTEL; } else { arch = WitchSystemInfo::PA_UNKNOWN; }#endif return arch; }
开发者ID:DaStangerGames,项目名称:WitchEngine,代码行数:32,
示例9: sizeofCStdString CSysInfo::GetUAWindowsVersion(){ OSVERSIONINFOEX osvi = {}; osvi.dwOSVersionInfoSize = sizeof(osvi); CStdString strVersion = "Windows NT"; if (GetVersionEx((OSVERSIONINFO *)&osvi)) { strVersion += StringUtils::Format(" %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); } SYSTEM_INFO si = {}; GetSystemInfo(&si); BOOL bIsWow = FALSE; if (IsWow64Process(GetCurrentProcess(), &bIsWow)) { if (bIsWow) { strVersion.append(";WOW64"); GetNativeSystemInfo(&si); // different function to read the info under Wow } } if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) strVersion.append(";Win64;x64"); else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64) strVersion.append(";Win64;IA64"); return strVersion;}
开发者ID:darkblaze101,项目名称:xbmc,代码行数:32,
示例10: Version /// <summary>Identify the windows version</summary> WindowsVersion::WindowsVersion() : Version(OS::Future) { // Prepare ZeroMemory((OSVERSIONINFO*)this, sizeof(OSVERSIONINFO)); dwOSVersionInfoSize = sizeof(OSVERSIONINFO); // Query windows version if (GetVersionEx(this)) { switch (dwMajorVersion) { // [WINDOWS NT 5] Windows 2000 or Windows XP case 5: switch (dwMinorVersion) { case 0: Version = OS::Win2000; break; case 1: Version = OS::WinXP; break; case 2: Version = OS::Server2003; break; } break; // [WINDOWS NT 6] Windows Vista, 7, or newer case 6: switch (dwMinorVersion) { case 0: Version = OS::Vista; break; case 1: Version = OS::Win7; break; default: Version = OS::Future; break; } break; } } // Set name switch (Version) { case OS::Win2000: Name = L"Windows 2000"; break; case OS::WinXP: Name = L"Windows XP"; break; case OS::Server2003: Name = L"Windows Server 2003"; break; case OS::Vista: Name = L"Windows Vista"; break; case OS::Win7: Name = L"Windows 7"; break; case OS::Future: Name = L"Windows Future"; break; } // Set Full name FullName = VString(L"%s %s (v%d.%d)", Name.c_str(), szCSDVersion, dwMajorVersion, dwMinorVersion); // Query architecture SYSTEM_INFO si; GetNativeSystemInfo(&si); switch (si.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_AMD64: Architecture = L"x64"; break; case PROCESSOR_ARCHITECTURE_IA64: Architecture = L"Itanium"; break; case PROCESSOR_ARCHITECTURE_INTEL: Architecture = L"x86"; break; default: case PROCESSOR_ARCHITECTURE_UNKNOWN: Architecture = L"Unknown"; break; } }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:60,
示例11: _time32/* Create a YAML file describing the image encoded into a null terminated string. Caller will own the memory. */char *store_metadata_(struct PmemMemoryInfo *info){ SYSTEM_INFO sys_info; struct tm newtime; __time32_t aclock; char time_buffer[32]; errno_t errNum; char *arch = NULL; _time32(&aclock); // Get time in seconds. _gmtime32_s(&newtime, &aclock); // Convert time to struct tm form. // Print local time as a string. errNum = asctime_s(time_buffer, 32, &newtime); if (errNum) { time_buffer[0] = 0; } // Get basic architecture information (Note that we always write ELF64 core // dumps - even on 32 bit platforms). ZeroMemory(&sys_info, sizeof(sys_info)); GetNativeSystemInfo(&sys_info); switch (sys_info.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_AMD64: arch = "AMD64"; break; case PROCESSOR_ARCHITECTURE_INTEL: arch = "I386"; break; default: arch = "Unknown"; } char *buffer = (char *)malloc(1000); _snprintf_s(buffer, 1000, _TRUNCATE, // A YAML File describing metadata about this image. "# PMEM/n" "---/n" // The start of the YAML file. "acquisition_tool: 'WinPMEM " PMEM_VERSION "'/n" "acquisition_timestamp: %s/n" "CR3: %#llx/n" "NtBuildNumber: %#llx/n" "NtBuildNumberAddr: %#llx/n" "KernBase: %#llx/n" "Arch: %s/n" ".../n", // This is the end of a YAML file. time_buffer, info->CR3.QuadPart, info->NtBuildNumber.QuadPart, info->NtBuildNumberAddr.QuadPart, info->KernBase.QuadPart, arch ); return buffer;};
开发者ID:AnwarMohamed,项目名称:metasploit-payloads,代码行数:62,
示例12: vlc_GetCPUCount/*** CPU ***/unsigned vlc_GetCPUCount (void){ SYSTEM_INFO systemInfo; GetNativeSystemInfo(&systemInfo); return systemInfo.dwNumberOfProcessors;}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:9,
示例13: cpu_countintcpu_count(){ SYSTEM_INFO si; GetNativeSystemInfo( &si ); return (int)si.dwNumberOfProcessors;}
开发者ID:applideveloper,项目名称:streem,代码行数:8,
示例14: GetNativeSystemInfo/// <summary>/// Capture stack frames/// </summary>/// <param name="ip">Current instruction pointer</param>/// <param name="sp">Current stack pointer</param>/// <param name="results">Found frames.</param>/// <param name="depth">Frame depth limit</param>/// <returns>Number of found frames</returns>size_t TraceHook::StackBacktrace( uintptr_t ip, uintptr_t sp, vecStackFrames& results, uintptr_t depth /*= 10 */ ){ SYSTEM_INFO sysinfo = { 0 }; uintptr_t stack_base = (uintptr_t)((PNT_TIB)NtCurrentTeb())->StackBase; GetNativeSystemInfo( &sysinfo ); // Store exception address results.emplace_back( std::make_pair( 0, ip ) ); // Walk stack for (uintptr_t stackPtr = sp; stackPtr < stack_base && results.size() <= depth; stackPtr += sizeof(void*)) { uintptr_t stack_val = *(uintptr_t*)stackPtr; MEMORY_BASIC_INFORMATION meminfo = { 0 }; // Decode value uintptr_t original = stack_val & HIGHEST_BIT_UNSET; // Invalid value if ( original < (uintptr_t)sysinfo.lpMinimumApplicationAddress || original > (uintptr_t)sysinfo.lpMaximumApplicationAddress) { continue; } // Check if memory is executable if (VirtualQuery( (LPVOID)original, &meminfo, sizeof(meminfo) ) != sizeof(meminfo)) continue; if ( meminfo.Protect != PAGE_EXECUTE_READ && meminfo.Protect != PAGE_EXECUTE_WRITECOPY && meminfo.Protect != PAGE_EXECUTE_READWRITE) { continue; } // Detect 'call' instruction for (uintptr_t j = 1; j < 8; j++) { DISASM info = { 0 }; info.EIP = original - j; #ifdef _M_AMD64 info.Archi = 64; #endif if (Disasm( &info ) > 0 && info.Instruction.BranchType == CallType) { results.emplace_back( std::make_pair( stackPtr, stack_val ) ); break; } } } return results.size();}
开发者ID:Jeswang,项目名称:mono-assembly-injector,代码行数:66,
示例15: iam32on64int iam32on64 (){ SYSTEM_INFO sysinfo_32, sysinfo_64; sysinfo_32.wProcessorArchitecture = 0; sysinfo_64.wProcessorArchitecture = 0; GetNativeSystemInfo (&sysinfo_64); GetSystemInfo (&sysinfo_32); return sysinfo_64.wProcessorArchitecture != sysinfo_32.wProcessorArchitecture && sysinfo_64.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;}
开发者ID:LRN,项目名称:mimerun,代码行数:9,
示例16: get_app_modestatic app_mode_t get_app_mode() { SYSTEM_INFO sys_info; GetNativeSystemInfo(&sys_info); if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) { return MODE_X86; } else if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { return MODE_X64; } return MODE_UNKNOWN;}
开发者ID:mikolas,项目名称:OpenAM,代码行数:10,
示例17: GetSystemCPUVOID GetSystemCPU(WCHAR *szBuffer){ SYSTEM_INFO archInfo; ISWOW64PROC fnIsWow64Process; BOOL isWow64 = FALSE; /* Find out if the program is running through WOW64 or not. Apparently, IsWow64Process() is not available on all versions of Windows, so the function has to be imported at runtime. If the function cannot be found, then assume the program is not running in WOW64. */ fnIsWow64Process = (ISWOW64PROC)GetProcAddress( GetModuleHandleW(L"kernel32"), "IsWow64Process"); if (fnIsWow64Process != NULL) fnIsWow64Process(GetCurrentProcess(), &isWow64); /* If the program is compiled as 32-bit, but is running in WOW64, it will automatically report as 32-bit regardless of the actual system architecture. It detects whether or not the program is using WOW64 or not, and then uses GetNativeSystemInfo(). If it is, it will properly report the actual system architecture to the user. */ if (isWow64) GetNativeSystemInfo(&archInfo); else GetSystemInfo(&archInfo); /* Now check to see what the system architecture is */ if(archInfo.wProcessorArchitecture != PROCESSOR_ARCHITECTURE_UNKNOWN) { switch(archInfo.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_INTEL: { wsprintfW(szBuffer, L"32-bit"); break; } case PROCESSOR_ARCHITECTURE_AMD64: { wsprintfW(szBuffer, L"64-bit"); break; } case PROCESSOR_ARCHITECTURE_IA64: { wsprintfW(szBuffer, L"Itanium"); break; } case PROCESSOR_ARCHITECTURE_ARM: { wsprintfW(szBuffer, L"ARM"); break; } default:break; } }}
开发者ID:AmineKhaldi,项目名称:reactos,代码行数:55,
示例18: mainvoid main(){ GetNativeSystemInfo(&sysInfo); // 64bit dectectOS();// if(sysInfo.dwOemId) {printf("/nOEM ID : %s", sysInfo.dwOemId);} idProcessorArchitecture(); // get CPU ARCHITECTURE printf("/nNumber of Logical Processors : %d", sysInfo.dwNumberOfProcessors); currentSystemMemoryInformation();}
开发者ID:dspecht,项目名称:psychic-octo-nemesis,代码行数:11,
示例19: is64BOOL is64(){ SYSTEM_INFO si; GetNativeSystemInfo(&si); if (si.wProcessorArchitecture && PROCESSOR_ARCHITECTURE_INTEL) return FALSE; else return TRUE;}
开发者ID:AdamBien,项目名称:Payara,代码行数:11,
示例20: is64bool is64(){ SYSTEM_INFO si; GetNativeSystemInfo(&si); if (si.wProcessorArchitecture && PROCESSOR_ARCHITECTURE_INTEL) return false; else return true;}
开发者ID:AdamBien,项目名称:Payara,代码行数:11,
示例21: GetOSBit/********************************************************************************* 函 数 名 : GetOSBit* 功能描述 : 取得操作系统位数* 参数列表 : 无* 说 明 : * 返回结果 : 如果成功,返回操作系统位数, 否则返回0********************************************************************************/ULONG GetOSBit(VOID){ SYSTEM_INFO si = {0} ; GetNativeSystemInfo(&si) ; if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64 ) { return 64; } return 32;}
开发者ID:CyDoor,项目名称:InjectCode,代码行数:20,
示例22: is64BitWindowsSystemQTCREATOR_UTILS_EXPORT bool is64BitWindowsSystem(){#ifdef Q_OS_WIN SYSTEM_INFO systemInfo; GetNativeSystemInfo(&systemInfo); return systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64;#else return false;#endif}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:11,
示例23: get_cpu_countstatic int get_cpu_count(){ int core_count = 16;#if HAVE_UNISTD_H && !defined(__OS2__)#if defined(_SC_NPROCESSORS_ONLN) core_count = sysconf(_SC_NPROCESSORS_ONLN);#elif defined(_SC_NPROC_ONLN) core_count = sysconf(_SC_NPROC_ONLN);#endif#elif defined(_WIN32) {#if _WIN32_WINNT >= 0x0501 SYSTEM_INFO sysinfo; GetNativeSystemInfo(&sysinfo);#else PGNSI pGNSI; SYSTEM_INFO sysinfo; /* Call GetNativeSystemInfo if supported or * GetSystemInfo otherwise. */ pGNSI = (PGNSI) GetProcAddress( GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); if (pGNSI != NULL) pGNSI(&sysinfo); else GetSystemInfo(&sysinfo);#endif core_count = sysinfo.dwNumberOfProcessors; }#elif defined(__OS2__) { ULONG proc_id; ULONG status; core_count = 0; for (proc_id = 1; ; proc_id++) { if (DosGetProcessorStatus(proc_id, &status)) break; if (status == PROC_ONLINE) core_count++; } }#else /* other platforms */#endif return core_count > 0 ? core_count : 1;}
开发者ID:93i,项目名称:godot,代码行数:53,
示例24: _hProcessNative::Native( HANDLE hProcess, bool x86OS /*= false*/ ) : _hProcess( hProcess ){ SYSTEM_INFO info = { { 0 } }; GetNativeSystemInfo( &info ); _pageSize = info.dwPageSize; // x86 OS, emulate WOW64 processes if (x86OS) { _wowBarrier.sourceWow64 = true; _wowBarrier.targetWow64 = true; _wowBarrier.type = wow_32_32; _wowBarrier.x86OS = true; } else { BOOL wowSrc = FALSE, wowTgt = FALSE; IsWow64Process( GetCurrentProcess(), &wowSrc ); IsWow64Process( _hProcess, &wowTgt ); _wowBarrier.sourceWow64 = (wowSrc == TRUE); _wowBarrier.targetWow64 = (wowTgt == TRUE); if (wowSrc == TRUE && wowTgt == TRUE) _wowBarrier.type = wow_32_32; else if (wowSrc == FALSE && wowTgt == FALSE) _wowBarrier.type = wow_64_64; else if (wowSrc == TRUE) _wowBarrier.type = wow_32_64; else _wowBarrier.type = wow_64_32; } HMODULE hNtdll = GetModuleHandleW( L"ntdll.dll" ); HMODULE hKernel32 = GetModuleHandleW( L"kernel32.dll" ); DynImport::load( "NtQueryInformationProcess", hNtdll ); DynImport::load( "NtSetInformationProcess", hNtdll ); DynImport::load( "NtQueryInformationThread", hNtdll ); DynImport::load( "NtDuplicateObject", hNtdll ); DynImport::load( "NtQueryObject", hNtdll ); DynImport::load( "NtQuerySection", hNtdll ); DynImport::load( "RtlCreateActivationContext", hNtdll ); DynImport::load( "NtQueryVirtualMemory", hNtdll ); DynImport::load( "NtCreateThreadEx", hNtdll ); DynImport::load( "NtLockVirtualMemory", hNtdll ); DynImport::load( "NtSuspendProcess", hNtdll ); DynImport::load( "NtResumeProcess", hNtdll ); DynImport::load( "Wow64GetThreadContext", hKernel32 ); DynImport::load( "Wow64SetThreadContext", hKernel32 ); DynImport::load( "Wow64SuspendThread", hKernel32 ); }
开发者ID:Coldreader88,项目名称:Blackbone,代码行数:53,
示例25: GetCurrentProcessPerformanceMonitor::PerformanceMonitor(){ HANDLE thisProcessHande = GetCurrentProcess(); SYSTEM_INFO sysInfo; BOOL runningInWow64 = false; IsWow64Process(thisProcessHande, &runningInWow64); if(runningInWow64){ GetNativeSystemInfo(&sysInfo); } else{ GetSystemInfo(&sysInfo); } this->processorsCount = sysInfo.dwNumberOfProcessors;}
开发者ID:CassianoViana,项目名称:JamTaba,代码行数:13,
示例26: NaClOsIs64BitWindows/* * Returns 1 if the operating system is a 64-bit version of * Windows. */int NaClOsIs64BitWindows() { SYSTEM_INFO system_info; GetNativeSystemInfo(&system_info); if (PROCESSOR_ARCHITECTURE_AMD64 == system_info.wProcessorArchitecture) { /* * The installed operating system processor architecture is x86-64. * This assumes the caller already knows it's a supported architecture. */ return 1; } return 0;}
开发者ID:eseidel,项目名称:native_client_patches,代码行数:17,
示例27: GetNativeSystemInfoconst std::string& CSysInfo::GetKernelCpuFamily(void){ static std::string kernelCpuFamily; if (kernelCpuFamily.empty()) {#ifdef TARGET_WINDOWS SYSTEM_INFO si; GetNativeSystemInfo(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) kernelCpuFamily = "x86"; else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM) kernelCpuFamily = "ARM";#elif defined(TARGET_DARWIN) const NXArchInfo* archInfo = NXGetLocalArchInfo(); if (archInfo) { const cpu_type_t cpuType = (archInfo->cputype & ~CPU_ARCH_ABI64); // get CPU family without 64-bit ABI flag if (cpuType == CPU_TYPE_I386) kernelCpuFamily = "x86"; else if (cpuType == CPU_TYPE_ARM) kernelCpuFamily = "ARM"; else if (cpuType == CPU_TYPE_POWERPC) kernelCpuFamily = "PowerPC";#ifdef CPU_TYPE_MIPS else if (cpuType == CPU_TYPE_MIPS) kernelCpuFamily = "MIPS";#endif // CPU_TYPE_MIPS }#elif defined(TARGET_POSIX) struct utsname un; if (uname(&un) == 0) { std::string machine(un.machine); if (machine.compare(0, 3, "arm", 3) == 0 || machine.compare(0, 7, "aarch64", 7) == 0) kernelCpuFamily = "ARM"; else if (machine.compare(0, 4, "mips", 4) == 0) kernelCpuFamily = "MIPS"; else if (machine.compare(0, 4, "i686", 4) == 0 || machine == "i386" || machine == "amd64" || machine.compare(0, 3, "x86", 3) == 0) kernelCpuFamily = "x86"; else if (machine.compare(0, 4, "s390", 4) == 0) kernelCpuFamily = "s390"; else if (machine.compare(0, 3, "ppc", 3) == 0 || machine.compare(0, 5, "power", 5) == 0) kernelCpuFamily = "PowerPC"; }#endif if (kernelCpuFamily.empty()) kernelCpuFamily = "unknown CPU family"; } return kernelCpuFamily;}
开发者ID:0xheart0,项目名称:xbmc,代码行数:51,
示例28: initialize_hardware_concurrency_infostatic void initialize_hardware_concurrency_info () {#if __TBB_WIN8UI_SUPPORT // For these applications processor groups info is unavailable // Setting up a number of processors for one processor group theProcessorGroups[0].numProcs = theProcessorGroups[0].numProcsRunningTotal = std::thread::hardware_concurrency();#else /* __TBB_WIN8UI_SUPPORT */ dynamic_link( "Kernel32.dll", ProcessorGroupsApiLinkTable, sizeof(ProcessorGroupsApiLinkTable)/sizeof(dynamic_link_descriptor) ); SYSTEM_INFO si; GetNativeSystemInfo(&si); DWORD_PTR pam, sam, m = 1; GetProcessAffinityMask( GetCurrentProcess(), &pam, &sam ); int nproc = 0; for ( size_t i = 0; i < sizeof(DWORD_PTR) * CHAR_BIT; ++i, m <<= 1 ) { if ( pam & m ) ++nproc; } __TBB_ASSERT( nproc <= (int)si.dwNumberOfProcessors, NULL ); // By default setting up a number of processors for one processor group theProcessorGroups[0].numProcs = theProcessorGroups[0].numProcsRunningTotal = nproc; // Setting up processor groups in case the process does not restrict affinity mask and more than one processor group is present if ( nproc == (int)si.dwNumberOfProcessors && TBB_GetActiveProcessorCount ) { // The process does not have restricting affinity mask and multiple processor groups are possible ProcessorGroupInfo::NumGroups = (int)TBB_GetActiveProcessorGroupCount(); __TBB_ASSERT( ProcessorGroupInfo::NumGroups <= MaxProcessorGroups, NULL ); // Fail safety bootstrap. Release versions will limit available concurrency // level, while debug ones would assert. if ( ProcessorGroupInfo::NumGroups > MaxProcessorGroups ) ProcessorGroupInfo::NumGroups = MaxProcessorGroups; if ( ProcessorGroupInfo::NumGroups > 1 ) { TBB_GROUP_AFFINITY ga; if ( TBB_GetThreadGroupAffinity( GetCurrentThread(), &ga ) ) ProcessorGroupInfo::HoleIndex = ga.Group; int nprocs = 0; for ( WORD i = 0; i < ProcessorGroupInfo::NumGroups; ++i ) { ProcessorGroupInfo &pgi = theProcessorGroups[i]; pgi.numProcs = (int)TBB_GetActiveProcessorCount(i); __TBB_ASSERT( pgi.numProcs <= (int)sizeof(DWORD_PTR) * CHAR_BIT, NULL ); pgi.mask = pgi.numProcs == sizeof(DWORD_PTR) * CHAR_BIT ? ~(DWORD_PTR)0 : (DWORD_PTR(1) << pgi.numProcs) - 1; pgi.numProcsRunningTotal = nprocs += pgi.numProcs; } __TBB_ASSERT( nprocs == (int)TBB_GetActiveProcessorCount( TBB_ALL_PROCESSOR_GROUPS ), NULL ); } }#endif /* __TBB_WIN8UI_SUPPORT */ PrintExtraVersionInfo("Processor groups", "%d", ProcessorGroupInfo::NumGroups); if (ProcessorGroupInfo::NumGroups>1) for (int i=0; i<ProcessorGroupInfo::NumGroups; ++i) PrintExtraVersionInfo( "----- Group", "%d: size %d", i, theProcessorGroups[i].numProcs);}
开发者ID:Havoc,项目名称:mangos-boost,代码行数:51,
示例29: _WIN32 indicates 64-bit or 32-bit Windows _MSC_VER indicates Microsoft C compiler !WIN_KERNEL_BUILD indicates Windows user-mode*/ unsigned int abstraction_cpu_count (
开发者ID:debashish216,项目名称:lte-testbed-news,代码行数:7,
注:本文中的GetNativeSystemInfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetNetMode函数代码示例 C++ GetNameLink函数代码示例 |