home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 April
/
Chip_2002-04_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
NT.ZIP
/
NTGlobalGetInfo.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-06-20
|
2KB
|
67 lines
unit NTGlobalGetInfo;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TNTGlobalGetInfo = class(TComponent)
private
{ Private declarations }
FServer:String;
FGroupName:String;
FName:String;
FComment:String;
FGroupID:DWORD;
FAttr:DWORD;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Server:String read FServer write FServer;
property GroupName:String read FGroupName write FGroupName;
property Name:String read FName;
property Comment:String read FComment;
property GroupID:DWORD read FGroupID;
property Attributes:DWORD read FAttr;
function Execute:LongInt;
end;
Type GROUP_INFO_2=record
grpi2_name:LPWSTR; grpi2_comment:LPWSTR; grpi2_group_id:DWORD; grpi2_attributes:DWORD;End;
function NetLocalGroupGetInfo(Server:PWideChar;GroupName:PWideChar;Level:DWORD;BufPtr:Pointer):LongInt; stdcall; external 'netapi32.dll';
procedure Register;
implementation
function TNTGlobalGetInfo.Execute:LongInt;
var
tServer:Array[0..255] Of WideChar;
tGroup:Array[0..255] Of WideChar;
MyPtr:Pointer;
MyInfo:GROUP_INFO_2;
begin
StringToWideChar(FServer,@tServer,255);
StringToWideChar(FGroupName,@tGroup,255);
Result:=NetLocalGroupGetInfo(@tServer,@tGroup,2,@MyPtr);
If MyPtr<>nil Then
Begin
MyInfo:=GROUP_INFO_2(MyPtr^);
FName:=WideCharToString(MyInfo.grpi2_name);
FComment:=WideCharToString(MyInfo.grpi2_comment);
FGroupID:=MyInfo.grpi2_group_id;
FAttr:=MyInfo.grpi2_attributes;
End;
end;
procedure Register;
begin
RegisterComponents('NT Tools - Global', [TNTGlobalGetInfo]);
end;
end.