Delphi-Quellcode:
{
The security identifier (SID) structure is a variable-length structure used to uniquely identify users or groups.
@ClassName encapsulates a SID structures and provides functions to create, read and convert SID data.
Once an instance is created the SID data cannot be changed. Therefore there is no Assign function to copy data.
MSDN on [url]http://msdn2.microsoft.com/en-us/library/aa379594.aspx[/url]
[url]http://msdn2.microsoft.com/en-us/library/aa379597.aspx[/url]
}
TSecurityID =
class(TObject)
private
{}
fWellKnownSidType : TWellKnownSidType;
{}
fSID : PSid;
{@Name contains the values of the properties of the instance for debugging purposes.}
fDbgData :
String;
{@Name disables the raising of exceptions in the following methods :
+GetAccountSidString
It is used for debugging purposes (hiding internal exceptions) only.
}
fDbgDisableException : Boolean;
{@Name updates the variable @link(fDbgData) for debugging purposes.
It is called in the constructors of @classname.
}
procedure UpdateDbgData;
virtual;
public
{@Name allocates memory for a SID and returns the pointer to it.
The size of allocated memory is always the maximum possible size of a
SID. The constant SECURITY_MAX_SID_SIZE is used.
The data must be freed by @link(FreeSID).
@return(@Name returns a pointer to the newly created SID)
@raises(ESMNotEnoughMemory will be raised if not enough memory is available)
}
class function NewSID : PSid;
{@Name frees a SID allocated by @Link(NewSID).
@param(SID contains the sid memory to be freed. If the variable is nil nohting will happen.
The parameter will be nil after a succesfull call)
}
class procedure FreeSID(
var SID : PSID);
{@Name creates a new SID initilized sid. The values are copied from this SID instance.
The SID must be freed by @link(FreeSID).
}
function CreateCopyOfSID : PSID;
....
....
Im allgemeinen sieht man, dass ich doch mehr oder weniger viel kommentiere.
Jedoch beachte man die leeren Kommentarklammern gleich nach TSecurityID = class(TObject) .
Ein schlimmes Vergehen meine Ansicht nach! Die Frage ist jedoch, ob die Kommentierung von geschützten Klasseninhalten notwendig sind, wenn dieselben noch veröffentlicht und kommentiert auftauchen ?
Delphi-Quellcode:
...
public
{@Name contains a pointer to the internal SID structure.
The SID structure must not be freed by CloseHandle otherwise the behavior of the instance is undefined.
}
property SID : PSid read fSid;
{@Name returns the SID type as a well known sid type.
The value is the parameter value given in CreateWellKnownSid as parameter WellKnownSidType.
Otherwise the value is always WinNullSid;
}
property WellKnownSidType : TWellKnownSidType read GetWellKnownSidType;
...
Zitat von
Relicted:
Delphi-Quellcode:
{2006-03-02, warum immer wieder vom Anfang ?????}
{2006-03-15, weil ich zu dem zeitpunktals ich die routine geschrieben habe einen promillewert von 2,5 hatte und mir
daher dec ned eingefallen ist glaub ich :-p }
Würde mich mal interessieren.
Schreibst du diese Art von Programmen nur für dich persönlich, oder für Auftraggeber?