Einzelnen Beitrag anzeigen

Dezipaitor

Registriert seit: 14. Apr 2003
Ort: Stuttgart
1.701 Beiträge
 
Delphi 7 Professional
 
#22

Re: überkreuzender Bezug von Units .. kleiner Workaround

  Alt 26. Sep 2007, 19:07
ICh habe auch so ein "überkreuzender Bezug"-Problem:

Delphi-Quellcode:
unit Descriptor;
uses Token,...;

TSecurityDescriptor = Class(TObject)
...
{@Name combines a parent and a creator security descriptor into a new security descriptor.
For detailed information see MSDN [url]http://msdn2.microsoft.com/en-us/library/aa446581.aspx[/url]

@param(ObjectType A Pointer to a GUID that defines the type. Set to nil if it does not exist.)
@param(GenericMap Defines the generic map class which maps generic access rights to specific access rights.)
@param(Token defines the token instance which is used to check for access. Can be nil to use
process or thread token.)
}

constructor CreatePrivateObjectSecurity(
      const ParentSecurityDescriptor: TJwSecurityDescriptor;
      const CreatorSecurityDescriptor: TJwSecurityDescriptor;
      const ObjectType : PGUID;
      const IsDirectoryObject : Boolean;
      const AutoInheritFlags : Cardinal;
      const GenericMap : TJwSecurityGenericMappingClass;
      const Token : TSecurityToken = nil); //Fehler
...

end.

unit ...Token;
uses Descriptor,...;

TSecurityToken = Class(TObject)
...
{Sicherheitsdeskriptor für das Token}
property SecurityDescriptor : TSecurityDescriptor read GetSecurityDescriptor write SetSecurityDescriptor;
...
Im Moment verwende ich folgende Deklaration:
Delphi-Quellcode:
constructor CreatePrivateObjectSecurity(
      const ParentSecurityDescriptor: TJwSecurityDescriptor;
      const CreatorSecurityDescriptor: TJwSecurityDescriptor;
      const ObjectType : PGUID;
      const IsDirectoryObject : Boolean;
      const AutoInheritFlags : Cardinal;
      const GenericMap : TJwSecurityGenericMappingClass;
      const Token : TObject = nil); //Ok
Dabei wird Token auf den Typ überprüft :

Delphi-Quellcode:
if not (Token is TSecurityToken) then
  raise
Was könnte man da Vernünftiges machen?
Christian
Windows, Tokens, Access Control List, Dateisicherheit, Desktop, Vista Elevation?
Goto: JEDI API LIB & Windows Security Code Library (JWSCL)
  Mit Zitat antworten Zitat