Debugging Tools for Windows

GetSystemVersion

The GetSystemVersion method returns information that identifies the operating system on the computer that is running the current target.

HRESULT
  IDebugControl::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
    );

Parameters

PlatformId
Receives the platform ID. PlatformId is always VER_PLATFORM_WIN32_NT for NT-based Windows.
Major
Receives 0xF if the target's operating system is a free build, or 0xC if the operating system is a checked build.
Minor
Receives the build number for the target's operating system.
ServicePackString
Receives the string for the service pack level of the target computer. If ServicePackString is NULL, this information is not returned. If no service pack is installed, ServicePackString can be empty.
ServicePackStringSize
Specifies the size, in characters, of the buffer that ServicePackString specifies.
ServicePackStringUsed
Receives the size, in characters, of the string of the service pack level. If ServicePackStringUsed is NULL, this information is not returned.
ServicePackNumber
Receives the service pack level of the target's operating system.
BuildString
Receives the string that identifies the build of the system. If BuildString is NULL, this information is not returned.
BuildStringSize
Specifies the size, in characters, of the buffer that BuildString specifies.
BuildStringUsed
Receives the size, in characters, of the string that identifies the build. If BuildStringUsed is NULL, this information is not returned.

Return Value

S_OK
The method was successful.
S_FALSE
The method was successful. However, the ServicePackString buffer or the BuildString buffer were too small and the corresponding string was truncated.

This method may also return error values. See Return Values for more details.

Interface Version

GetSystemVersion is available in all versions of IDebugControl.

Comments

For more information, see Target Information.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h. The VER_PLATFORM_XXX values are defined in Ntddk.h.

See Also

GetSystemVersionString, GetSystemVersionValues

Build machine: CAPEBUILD