home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 April
/
Chip_2002-04_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
NT.ZIP
/
NTServerSetInfo.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-06-20
|
2KB
|
67 lines
unit NTServerSetInfo;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TNTServerSetInfo = class(TComponent)
private
{ Private declarations }
FServer:String;
FPlatformID:DWORD;
FName:String;
FMajor:DWORD;
FMinor:DWORD;
FType:DWORD;
FComment:String;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Server:String read FServer write FServer;
property PlatformID:DWORD read FPlatformID write FPlatformID default 0;
property Name:String read FName write FName;
property MajorVersion:DWORD read FMajor write FMajor default 0;
property MinorVersion:DWORD read FMinor write FMinor default 0;
property ServerType:DWORD read FType write FType default 0;
property Comment:String read FComment write FComment;
function Execute:LongInt;
end;
Type SERVER_INFO_101=record
sv101_platform_id:DWORD; sv101_name:LPWSTR; sv101_version_major:DWORD; sv101_version_minor:DWORD; sv101_type:DWORD; sv101_comment:LPWSTR;End;
function NetServerSetInfo(Server:PChar;Level:DWORD;Buf:PChar;Parm_Error:LPDWORD):LongInt; stdcall; external 'netapi32.dll';
procedure Register;
implementation
function TNTServerSetInfo.Execute:LongInt;
var MyInfo:SERVER_INFO_101;
tServer:Array[0..255] Of WideChar;
tName:Array[0..255] Of WideChar;
tComment:Array[0..255] Of WideChar;
begin
StringToWideChar(FServer,@tServer,255);
StringToWideChar(FName,@tName,255);
StringToWideChar(FComment,@tComment,255);
MyInfo.sv101_platform_id:=FPlatFormID;
MyInfo.sv101_name:=@tName;
MyInfo.sv101_version_major:=FMajor;
MyInfo.sv101_version_minor:=FMinor;
MyInfo.sv101_type:=FType;
MyInfo.sv101_comment:=@tComment;
Result:=NetServerSetInfo(@tServer,101,@MyInfo,nil);
end;
procedure Register;
begin
RegisterComponents('NT Tools - Server', [TNTServerSetInfo]);
end;
end.