WQeiß jemand, wie man mit
NetServerGetInfo noch detailiertere Betriebssysteminformationen bekommt?
Bei mir sieht das bisher so aus:
Delphi-Quellcode:
function GetRemoteOS(const Computer: WideString; var Version: string): DWORD;
var
res : DWORD;
s : string;
si : Pointer;
Major : DWORD;
Minor : DWORD;
begin
si := nil;
s := '';
res := NetServerGetInfo(PWideChar(Computer), 101, @si);
if res = NERR_Success then
begin
Major := PSERVER_INFO_101(si)^.sv101_version_major;
Minor := PSERVER_INFO_101(si)^.sv101_version_minor;
if (Major = 4) and (Minor = 0) then
begin
s := 'Windows NT 4.0';
end
else if (Major = 5) and (Minor = 0) then
begin
s := 'Windows 2000';
end
else if (Major = 5) and (Minor = 1) then
begin
s := 'Windows XP';
end
else if (Major = 5) and (Minor = 2) then
begin
s := 'Windows 2003 Server Family';
end;
end;
Version := s;
NetApiBufferFree(si);
result := res;
end;