久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='fwTfS'><style id='fwTfS'><dir id='fwTfS'><q id='fwTfS'></q></dir></style></legend>

    1. <i id='fwTfS'><tr id='fwTfS'><dt id='fwTfS'><q id='fwTfS'><span id='fwTfS'><b id='fwTfS'><form id='fwTfS'><ins id='fwTfS'></ins><ul id='fwTfS'></ul><sub id='fwTfS'></sub></form><legend id='fwTfS'></legend><bdo id='fwTfS'><pre id='fwTfS'><center id='fwTfS'></center></pre></bdo></b><th id='fwTfS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fwTfS'><tfoot id='fwTfS'></tfoot><dl id='fwTfS'><fieldset id='fwTfS'></fieldset></dl></div>

    2. <tfoot id='fwTfS'></tfoot>
      • <bdo id='fwTfS'></bdo><ul id='fwTfS'></ul>

      <small id='fwTfS'></small><noframes id='fwTfS'>

        檢測 Windows 10 版本

        Detecting Windows 10 version(檢測 Windows 10 版本)
        <legend id='UtSyL'><style id='UtSyL'><dir id='UtSyL'><q id='UtSyL'></q></dir></style></legend>

      1. <i id='UtSyL'><tr id='UtSyL'><dt id='UtSyL'><q id='UtSyL'><span id='UtSyL'><b id='UtSyL'><form id='UtSyL'><ins id='UtSyL'></ins><ul id='UtSyL'></ul><sub id='UtSyL'></sub></form><legend id='UtSyL'></legend><bdo id='UtSyL'><pre id='UtSyL'><center id='UtSyL'></center></pre></bdo></b><th id='UtSyL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UtSyL'><tfoot id='UtSyL'></tfoot><dl id='UtSyL'><fieldset id='UtSyL'></fieldset></dl></div>

            <bdo id='UtSyL'></bdo><ul id='UtSyL'></ul>
              <tbody id='UtSyL'></tbody>
          • <tfoot id='UtSyL'></tfoot>

            <small id='UtSyL'></small><noframes id='UtSyL'>

                  本文介紹了檢測 Windows 10 版本的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我的目標是在我的代碼中檢測 Windows 10,它必須跨平臺以及跨不同版本的 Windows(至少 7 和更高版本)工作.Windows 提供了 IsWindows10OrGreater() 來解決這個問題,但它還有另一個問題,這個函數在以前的 Windows 版本中不存在.

                  My objective is to detect Windows 10 in my code which has to work cross-platform as well as across different versions of Windows (atleast 7 & up). Windows provides IsWindows10OrGreater() to tackle this problem, but there's another issue with it, this function isn't present in previous windows versions.

                  您會發(fā)現無數關于此的博客和 SO 問題,以及像 this 和 getversion 等函數返回一些不同版本而不是正確版本的明顯瘋狂.

                  You'll find countless blogs and SO questions regarding this as well as the manifest madness where functions like this and getversion and others return some different version rather than the correct one.

                  例如在我的機器上 - 方法 IsWindows10OrGreater() 無法編譯(我必須安裝 Win10 SDK),并且 IsWindowsVersionOrGreater() 報告 6 作為主要版本.

                  For example on my machine - the method IsWindows10OrGreater() doesn't compile(I would've to install Win10 SDK), and IsWindowsVersionOrGreater() reports 6 as major version.

                  那么有沒有一種理智的多版本方法可以解決這個問題?

                  So is there a sane multi-version way I could solve this problem?

                  推薦答案

                  檢索真實操作系統(tǒng)版本的最直接方法是調用 RtlGetVersion.這是 GetVersionExVerifyVersionInfo 調用的,但不使用兼容性墊片.

                  The most straight-forward way to retrieve the true OS version is to call RtlGetVersion. It is what GetVersionEx and VerifyVersionInfo call, but doesn't employ the compatibility shims.

                  您可以使用 DDK(通過 #include <ntddk.h> 并從內核模式鏈接 NtosKrnl.lib,或從用戶模式鏈接 ntdll.lib),或者使用運行時動態(tài)鏈接,如下面的代碼片段所示:

                  You can either use the DDK (by #including <ntddk.h> and linking against NtosKrnl.lib from kernel mode, or ntdll.lib from user mode), or use runtime dynamic linking as in the following snippet:

                  typedef LONG NTSTATUS, *PNTSTATUS;
                  #define STATUS_SUCCESS (0x00000000)
                  
                  typedef NTSTATUS (WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
                  
                  RTL_OSVERSIONINFOW GetRealOSVersion() {
                      HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
                      if (hMod) {
                          RtlGetVersionPtr fxPtr = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion");
                          if (fxPtr != nullptr) {
                              RTL_OSVERSIONINFOW rovi = { 0 };
                              rovi.dwOSVersionInfoSize = sizeof(rovi);
                              if ( STATUS_SUCCESS == fxPtr(&rovi) ) {
                                  return rovi;
                              }
                          }
                      }
                      RTL_OSVERSIONINFOW rovi = { 0 };
                      return rovi;
                  }
                  

                  如果您需要其他信息,您可以傳遞 RTL_OSVERSIONINFOEXW 結構代替 RTL_OSVERSIONINFOW 結構(正確分配 dwOSVersionInfoSize 成員).

                  In case you need additional information you can pass an RTL_OSVERSIONINFOEXW structure in place of the RTL_OSVERSIONINFOW structure (properly assigning the dwOSVersionInfoSize member).

                  這會在 Windows 10 上返回預期結果,即使沒有附加清單也是如此.

                  This returns the expected result on Windows 10, even when there is no manifest attached.


                  順便說一句,根據可用的功能而不是操作系統(tǒng)版本提供不同的實現被普遍認為是更好的解決方案.


                  As an aside, it is commonly accepted as a better solution to provide different implementations based on available features rather than OS versions.

                  這篇關于檢測 Windows 10 版本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區(qū)別)

                • <tfoot id='YPcjD'></tfoot>

                    <small id='YPcjD'></small><noframes id='YPcjD'>

                      <bdo id='YPcjD'></bdo><ul id='YPcjD'></ul>
                          <legend id='YPcjD'><style id='YPcjD'><dir id='YPcjD'><q id='YPcjD'></q></dir></style></legend>
                              <tbody id='YPcjD'></tbody>

                          • <i id='YPcjD'><tr id='YPcjD'><dt id='YPcjD'><q id='YPcjD'><span id='YPcjD'><b id='YPcjD'><form id='YPcjD'><ins id='YPcjD'></ins><ul id='YPcjD'></ul><sub id='YPcjD'></sub></form><legend id='YPcjD'></legend><bdo id='YPcjD'><pre id='YPcjD'><center id='YPcjD'></center></pre></bdo></b><th id='YPcjD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YPcjD'><tfoot id='YPcjD'></tfoot><dl id='YPcjD'><fieldset id='YPcjD'></fieldset></dl></div>
                            主站蜘蛛池模板: 欧美极品在线观看 | 亚洲成人日韩 | 亚洲国产精久久久久久久 | 久久久久久久久久久久久久国产 | 日韩久久久久久 | 久久久久久国产精品 | 日韩三区在线观看 | 亚洲日本欧美日韩高观看 | 国产一区在线免费观看 | 中文精品视频 | 国产精品无码永久免费888 | 超碰精品在线观看 | 日韩一区二区在线视频 | 成人精品久久久 | 日韩电影免费观看中文字幕 | 亚洲乱码一区二区三区在线观看 | 欧美aⅴ在线观看 | 日日干日日射 | 亚洲精品久久久一区二区三区 | 久久黄网| 青青草综合 | 成人免费看黄网站在线观看 | 久久99蜜桃综合影院免费观看 | 国产福利免费视频 | 日韩精品一区二区三区视频播放 | 久草在线青青草 | 午夜影视网 | 99热热精品| 免费一级黄色电影 | 国产三级精品三级在线观看四季网 | 欧美一级欧美一级在线播放 | 91.色| 在线免费观看色 | 久热伊人 | 91在线精品视频 | 成人性视频免费网站 | 欧美二区在线 | 91精品国产91久久久久久 | 91精品一区二区三区久久久久 | 亚洲国产激情 | 国产91视频免费 |