home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 April
/
Chip_2002-04_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
NT.ZIP
/
NTAllAccess.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2002-01-17
|
1KB
|
57 lines
// NTAllAccess
// Modifies a process's DACL information to allow any other process to end it
unit NTAllAccess;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TNTAllAccess = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
function Execute:Integer;
end;
const SECURITY_DESCRIPTOR_REVISION=1;
procedure Register;
implementation
function TNTAllAccess.Execute:Integer;
var SecurityDescriptor:TSecurityDescriptor;
begin
Result:=0;
If Not InitializeSecurityDescriptor(@SecurityDescriptor,SECURITY_DESCRIPTOR_REVISION) Then
Begin
Result:=GetLastError;
Exit;
End;
If Not SetSecurityDescriptorDACL(@SecurityDescriptor,True,nil,False) Then
Begin
Result:=GetLastError;
Exit;
End;
If Not SetKernelObjectSecurity(GetCurrentProcess,DACL_SECURITY_INFORMATION,@SecurityDescriptor) Then
Begin
Result:=GetLastError;
Exit;
End;
end;
procedure Register;
begin
RegisterComponents('NT Tools - Additional', [TNTAllAccess]);
end;
end.