共用方式為


IDebugControl2::GetSystemVersion 方法 (dbgeng.h)

GetSystemVersion 方法會傳回資訊,識別執行目前目標之電腦上的作系統。

語法

HRESULT GetSystemVersion(
  [out]           PULONG PlatformId,
  [out]           PULONG Major,
  [out]           PULONG Minor,
  [out, optional] PSTR   ServicePackString,
  [in]            ULONG  ServicePackStringSize,
  [out, optional] PULONG ServicePackStringUsed,
  [out]           PULONG ServicePackNumber,
  [out, optional] PSTR   BuildString,
  [in]            ULONG  BuildStringSize,
  [out, optional] PULONG BuildStringUsed
);

參數

[out] PlatformId

接收平台標識碼。 PlatformId 一律會針對 NT 型 Windows VER_PLATFORM_WIN32_NT。

[out] Major

如果目標的作系統是 免費組建,則會收到0xF,如果作系統 是已檢查的組建,則會收到0xC。

[out] Minor

接收目標作系統的組建編號。

[out, optional] ServicePackString

接收目標電腦的 Service Pack 層級字串。 如果 ServicePackStringNULL,則不會傳回此資訊。 如果未安裝 Service Pack,ServicePackString 可以是空的。

[in] ServicePackStringSize

指定 servicePackString 所指定之緩衝區的大小,以字元為單位。 此大小包含 『\0』 終止字元的空間。

[out, optional] ServicePackStringUsed

接收 Service Pack 層級字串的大小,以字元為單位。 此大小包含 『\0』 終止字元的空間。 如果 ServicePackStringUsedNULL,則不會傳回此資訊。

[out] ServicePackNumber

接收目標作系統的 Service Pack 層級。

[out, optional] BuildString

接收識別系統組建的字串。 如果 BuildStringNULL,則不會傳回此資訊。

[in] BuildStringSize

指定 buildString 所指定之緩衝區的大小,以字元為單位。 此大小包含 『\0』 終止字元的空間。

[out, optional] BuildStringUsed

接收識別組建之字串的大小,以字元為單位。 此大小包含 『\0』 終止字元的空間。 如果 BuildStringUsedNULL,則不會傳回此資訊。

傳回值

這個方法也可能傳回錯誤值。 如需詳細資訊,請參閱 傳回值

傳回碼 描述
S_OK
方法成功。
S_FALSE
方法成功。 不過,ServicePackString 緩衝區或 BuildString 緩衝區太小,而且對應的字元串已截斷。

言論

如需詳細資訊,請參閱 目標資訊

要求

要求 價值
目標平臺 桌面
標頭 dbgeng.h (include Dbgeng.h, Ntddk.h)

另請參閱

GetSystemVersionString

GetSystemVersionValues

IDebugControl

IDebugControl2

IDebugControl3