Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#3

Re: Betriebssysteminformationen mit NetServerGetInfo

  Alt 20. Mär 2006, 00:38
Unterscheidung zwischen XP Hone und XP Professional zum Beispiel.

Diese Informationen bekomme ich schon:
Delphi-Quellcode:
const
  SV_TYPE_WORKSTATION = $00000001; // A LAN Manager workstation
  SV_TYPE_SERVER = $00000002; // A LAN Manager server
  SV_TYPE_SQLSERVER = $00000004; // Any server running with Microsoft SQL Server
  SV_TYPE_DOMAIN_CTRL = $00000008; // Primary domain controller
  SV_TYPE_DOMAIN_BAKCTRL = $00000010; // Backup domain controller
  SV_TYPE_TIME_SOURCE = $00000020; // Server running the Timesource service
  SV_TYPE_AFP = $00000040; // Apple File Protocol server
  SV_TYPE_NOVELL = $00000080; // Novell server
  SV_TYPE_DOMAIN_MEMBER = $00000100; // LAN Manager 2.x domain member
  SV_TYPE_PRINTQ_SERVER = $00000200; // Server sharing print queue
  SV_TYPE_DIALIN_SERVER = $00000400; // Server running dial-in service
  SV_TYPE_XENIX_SERVER = $00000800; // Xenix server
  SV_TYPE_SERVER_UNIX = SV_TYPE_XENIX_SERVER; //
  SV_TYPE_NT = $00001000; // Windows Server 2003, Windows XP, Windows 2000, or Windows NT
  SV_TYPE_WFW = $00002000; // Server running Windows for Workgroups
  SV_TYPE_SERVER_MFPN = $00004000; // Microsoft File and Print for NetWare
  SV_TYPE_SERVER_NT = $00008000;
    // Windows Server 2003, Windows 2000 server, or Windows NT server that is not a domain controller
  SV_TYPE_POTENTIAL_BROWSER = $00010000; // Server that can run the browser service
  SV_TYPE_BACKUP_BROWSER = $00020000; // Server running a browser service as backup
  SV_TYPE_MASTER_BROWSER = $00040000; // Server running the master browser service
  SV_TYPE_DOMAIN_MASTER = $00080000; // Server running the domain master browser
  SV_TYPE_SERVER_OSF = $00100000; //
  SV_TYPE_SERVER_VMS = $00200000;
  SV_TYPE_WINDOWS = $00400000; // Windows95 and above
  SV_TYPE_DFS = $00800000; // Root of a DFS tree
  SV_TYPE_CLUSTER_NT = $01000000; // NT Cluster
  SV_TYPE_TERMINALSERVER = $02000000; // Terminal Server(Hydra)
  SV_TYPE_CLUSTER_VS_NT = $04000000; // NT Cluster Virtual Server Name
  SV_TYPE_DCE = $10000000; // IBM DSS (Directory and Security Services) or equivalent
  SV_TYPE_ALTERNATE_XPORT = $20000000; // return list for alternate transport
  SV_TYPE_LOCAL_LIST_ONLY = $40000000; // Return local list only
  SV_TYPE_DOMAIN_ENUM = DWORD($80000000); // Primary domain
  SV_TYPE_ALL = DWORD($FFFFFFFF); // handy for NetServerEnum2

function ServerTypeToStringArray(svType: DWORD): TStringDynArray;
const
  cStrings : array[0..30] of string = (
    'LAN Manager workstation',
    'LAN Manager server',
    'SQL Server',
    'Primary domain controller',
    'Backup domain controller',
    'Timesource service',
    'Apple File Protocol server',
    'Novell server',
    'LAN Manager 2.x domain member',
    'Server sharing print queue',
    'dial-in service',
    'Xenix server',
    '',
    '',
    'File and Print for NetWare',
    '',
    'can run the browser service',
    'browser service',
    'browser service as backup',
    'domain master browser',
    '',
    '',
    'Windows95 and above',
    'Root of a DFS tree',
    'NT Cluster',
    'Terminal Server(Hydra)',
    'NT Cluster Virtual Server Name',
    'IBM DSS',
    '',
    '',
    'Primary domain'
    );
var
  i : Integer;
begin
  for i := 0 to 31 do
  begin
    if Odd(svType) then
    begin
      setlength(result, length(result) + 1);
      result[High(result)] := cStrings[i];
      svType := svType shr 1;
    end;
  end;
end;
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat