简体   繁体   English

在哪里可以找到有关使用 Microsoft Windows SLAPI 的更多信息?

[英]Where can I find more information on using Microsoft Windows SLAPI?

In particular, I'm trying to find out how to use it to differentiate between server and server core editions of Windows.特别是,我试图找出如何使用它来区分 Windows 的服务器和服务器核心版本。 The SLGetWindowsInformation() looks simple enough to use, but I don't know what info names are available. SLGetWindowsInformation()看起来使用起来很简单,但我不知道有哪些信息名称可用。

SLAPI = Software Licensing API SLAPI =软件许可 API

Maybe this and this will help.也许会有所帮助。

If you don't want to use GetProductInfo() you can call SLQueryInformationDWORD and specify Kernel-ProductInfo for the name parameter.如果您不想使用 GetProductInfo(),您可以调用SLQueryInformationDWORD并为 name 参数指定 Kernel-ProductInfo。 The returned values are the same as GetProductInfo():D (at least on my testsystem)返回的值与 GetProductInfo():D 相同(至少在我的测试系统上)

You can check this using the GetProductInformation API for that, just check the pdwReturnedProductType parameter for one of the server core values.您可以使用GetProductInformation API 对此进行检查,只需检查 pdwReturnedProductType 参数以获取服务器核心值之一。

Example code (Delphi but not hard to translate to c(++)):示例代码(Delphi 但不难翻译成 c(++)):

function IsServerCore: Boolean;
var
  osvi: OSVERSIONINFOEX;
  dwPT: DWORD;
begin
  ZeroMemory(@osvi, SizeOf(osvi));
  osvi.dwOSVersionInfoSize := SizeOf(osvi);
  Win32Check(GetVersionEx(osvi));

  Win32Check(GetProductInfo(osvi.dwMajorVersion, osvi.dwMinorVersion,
    osvi.wServicePackMajor, osvi.wServicePackMinor, dwPT));

  case dwPT of
    PRODUCT_DATACENTER_SERVER_CORE,
    PRODUCT_STANDARD_SERVER_CORE,
    PRODUCT_ENTERPRISE_SERVER_CORE,
    PRODUCT_WEB_SERVER_CORE,
    PRODUCT_DATACENTER_SERVER_CORE_V,
    PRODUCT_STANDARD_SERVER_CORE_V,
    PRODUCT_ENTERPRISE_SERVER_CORE_V,
    PRODUCT_STORAGE_EXPRESS_SERVER_CORE,
    PRODUCT_STORAGE_STANDARD_SERVER_CORE,
    PRODUCT_STORAGE_WORKGROUP_SERVER_CORE,
    PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE,
    PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE,
    PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE,
    PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: Result := True
  else
    Result := False;
  end;
end;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在哪里可以找到有关D_GLIBCXX_DEBUG和DNDEBUG标志的更多信息? - Where can I find more information about D_GLIBCXX_DEBUG and DNDEBUG flags? 在哪里可以找到 Windows (VFW) 的视频 - Where can I find Video for Windows (VFW) 我在哪里可以找到有关C ++ [[deprecated]]属性的信息 - Where can I find information on the C++ [[deprecated]] attribute 在哪里可以找到适用于 Windows 的 64 位 libsmi? - Where can I find libsmi 64bit for windows? 在哪里可以找到Windows Mobile的灵活日志记录库? - Where can I find a flexible logging library for Windows Mobile? 哪里可以找到有关C ++ 11,std新功能和Tr1的可靠信息? - Where can I find reliable information on C++11, std new features and Tr1? 我在哪里可以找到有关C ++ / STL方法异常保证的信息? - Where can I find information about C++/STL method Exception guarantees? 在Mac上的哪里可以找到使用GCC编译器的最新版本? - Where can I find a version of current using GCC compiler on Mac? 不止一个重载 function 实例与参数列表匹配,我找不到错误发生的位置 - More than one instance of overloaded function matches the argument list and I can't find where the error happens 使用矢量时找不到错误发生的位置 - I can't find where the error occurred when using vector
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM