Unit NTObj

Unit: NTObj Version: 1.11 Purpose: Components around NT objects Author: Peter Sawatzki (ps) Buchenhof 3, 58091 Hagen, Germany CompuServe: 100031,3002 Date: Author: 04/16/96 ps first version for Delphi 2.0 04/20/96 ps add wait functions 05/12/97 ps add process/task components 07/23/97 ps change ReportEvent call for Delphi 3.0 08/28/97 ps add GetLastErrorText Copyright © 1996, 1997 Peter Sawatzki. All Rights Reserved.

Classes

TCriticalThread - -because Borlands TThread class post messages to an invisible window to synchronize threads, it is unusable for TService implementation.
TEvent -
TEventLog -
TExpandRegistry - -TExpandRegistry class for Delphi 2 that can write REG_EXPAND_SZ strings
TKernelObject -
TMutex -
TSemaphore -

Functions

CreateWrapper - -the following code creates a Wrapper that can call a certain instance
GetLastErrorText -
InitializeMainThread -
ReturnAddr - - TExpandRegistry
WaitForAllInList -
WaitForAllObjects - - wait for ALL of the passed objects
WaitForList -
WaitForObjects - - functions to wait on objects or list of objects.
WaitForOneInList -
WaitForOneObject - - wait for one of the passed objects

Types

TEventLogType
TWrapper

Constants

Variables


Functions


Function CreateWrapper (Instance, Proc: Pointer): TWrapper;

-the following code creates a Wrapper that can call a certain instance

Function GetLastErrorText: String;


Procedure InitializeMainThread;


Function ReturnAddr: Pointer;

- TExpandRegistry

Function WaitForAllInList(Value: TList; Milliseconds: DWord): DWord;


Function WaitForAllObjects(Const Values: Array Of TObject; Milliseconds: DWord): DWord;

- wait for ALL of the passed objects

Function WaitForList(Value: TList; WaitAll: Bool; Milliseconds: DWord): DWord;


Function WaitForObjects (Const Values: Array Of TObject; WaitAll: Bool; Milliseconds: DWord): DWord;

- functions to wait on objects or list of objects. Currently the functions can wait for TThread and TEvent objects. Passing other objects is a nop (i.e. is like passing an event that is never signaled

Function WaitForOneInList(Value: TList; Milliseconds: DWord): DWord;


Function WaitForOneObject(Const Values: Array Of TObject; Milliseconds: DWord): DWord;

- wait for one of the passed objects

Types


TEventLogType = (elSuccess, elInformation, elWarning, elError, elException);

TWrapper = record
PopEAx : Byte;
PushImm : Byte;
InstPtr : Pointer;
PushEAx : Byte;
MovEAxImm : Byte;
ProcPtr : Pointer;
JmpEAx : Word;
end;
- Wrappers to map callbacks to a instance.method} {$Align Off

Constants


Variables