home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip_2004-07_cd1.bin / program / delphi / download / nastroje / d234567 / PRODELD.ZIP / PROFINTC.PAS < prev    next >
Pascal/Delphi Source File  |  2003-11-02  |  22KB  |  586 lines

  1. //PROFILE-NO
  2. {$O-}
  3. {$D-}
  4. {$B-}
  5. {$Q-}
  6. {$I-}
  7. {$R-}
  8. {$X+}
  9. {$WARNINGS OFF}
  10.  
  11. unit Profintc;
  12.  
  13. interface
  14.  
  15. USES
  16.   QForms,
  17.   QDialogs, Windows, QGraphics, Types;
  18.  
  19. TYPE
  20.   TMyComp  = Int64;
  21.  
  22.   TMyLargeInteger = RECORD
  23.                     CASE Byte OF
  24.                      0 : ( LowPart  : DWord; HighPart : LongInt );
  25.                      1 : ( QuadPart : TMyComp );
  26.                   END;
  27.   TPLargeInteger = ^TMyLargeInteger;
  28.  
  29.   TObjFunction = FUNCTION ( CONST Text, Caption : PChar;
  30.                             Flags : Longint ) : Integer OF Object;
  31.  
  32. // Profiler-Measurement-Functions
  33. PROCEDURE ProfStop  ( l : DWord; h : Integer);    external 'PROFMEAS.DLL';
  34. FUNCTION  ProfEnter ( mptr : Pointer; prozNr : Integer ) : TPLargeInteger; external 'PROFMEAS.DLL';
  35. FUNCTION  ProfExit  ( lc   : DWord;   hc : Integer; prozNr : Integer ) : TPLargeInteger; external 'PROFMEAS.DLL';
  36. PROCEDURE ProfActivate;                           external 'PROFMEAS.DLL';
  37. PROCEDURE ProfDeActivate;                         external 'PROFMEAS.DLL';
  38. PROCEDURE ProfSetComment  ( comm   : PChar );     external 'PROFMEAS.DLL';
  39. PROCEDURE ProfAppendResults ( progEnd : Boolean );external 'PROFMEAS.DLL';
  40.  
  41. // Post-Mortem-Review-Functions
  42. PROCEDURE PomoEnter       ( prozNr : Word );      external 'PROFMEAS.DLL';
  43. PROCEDURE PomoExceStr     ( name   : pChar    );  external 'PROFMEAS.DLL';
  44. PROCEDURE PomoExce;
  45. PROCEDURE PomoExit        ( prozNr : Word );      external 'PROFMEAS.DLL';
  46.  
  47. // Function for Starting the Online-Operation windoe
  48. PROCEDURE ProfOnlineOperation;                    external 'ProfOnFo.DLL';
  49. PROCEDURE ProfCloseOnlineOperation;               external 'ProfOnFo.DLL';
  50.  
  51. // Functions to interrupt and continue measurement for calls which could set the
  52. //  Process idle. Use these calls to implement own Non-measured Calls. If METHODS
  53. //  can set a process idle, the only possibility is, to put these calls into your
  54. //  sources (included by an IFDEF-statement).
  55. //  USE 2 or more spaces between IFDEF and PROFILE, otherwise it will be deleted
  56. //  by the ProDelphi. Example:
  57. //  {$IFDEF     PROFILE } StopCounting;     {$ENDIF }
  58. //    ObjectReference.MethodThatMightSetProcessIdle;
  59. //  {$IFDEF     PROFILE } ContinueCounting; {$ENDIF }
  60.  
  61. // Normal procedures that set the process idle can be handled like the Sleep-
  62. //  function in this unit.
  63. PROCEDURE StopCounting;                           external 'PROFMEAS.DLL';
  64. PROCEDURE ContinueCounting;                       external 'PROFMEAS.DLL';
  65.  
  66. // Delphi-Functions that set process idle
  67. procedure ShowMessage(const Msg : AnsiString); overload;
  68.  
  69. procedure ShowMessage(const Msg : ShortString); overload;
  70.  
  71. procedure ShowMessage(const Msg : AnsiString; Params : array of const); overload;
  72.  
  73. procedure ShowMessage(const Msg : ShortString; Params : array of const); overload;
  74.  
  75. PROCEDURE ShowMessageFmt(const Msg : WideString; Params : array of const );
  76.           // If you need to compile the CLX-Lib, the next functions must be deleted,
  77.           // Sorry ! The USES statement for QDialogs has to be moved to the
  78.           // Implementation part !!!
  79.  
  80. procedure ShowMessagePos(const Msg : WideString; X, Y : Integer);
  81.  
  82. // CLX-Functions
  83. function MessageDlg(const Msg        : AnsiString;     DlgType : TMsgDlgType;
  84.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  85.                           DefaultBtn : TMsgDlgBtn = mbNone;
  86.                           Bitmap     : TBitmap = NIL) : Integer; overload;
  87.  
  88. function MessageDlg(const Msg        : ShortString;     DlgType : TMsgDlgType;
  89.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  90.                           DefaultBtn : TMsgDlgBtn = mbNone;
  91.                           Bitmap     : TBitmap = NIL) : Integer; overload;
  92.  
  93. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  94.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  95.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  96.                           Bitmap     : TBitmap = nil) : Integer; overload;
  97.  
  98. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  99.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  100.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  101.                           Bitmap     : TBitmap = nil) : Integer; overload;
  102.  
  103. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  104.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  105.                           HelpCtx    : Longint;      X, Y       : Integer;
  106.                           DefaultBtn : TMsgDlgBtn = mbNone;
  107.                           Bitmap     : TBitmap = nil) : Integer; overload;
  108.  
  109. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  110.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  111.                           HelpCtx    : Longint;      X, Y       : Integer;
  112.                           DefaultBtn : TMsgDlgBtn = mbNone;
  113.                           Bitmap     : TBitmap = nil) : Integer; overload;
  114.  
  115. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  116.                           DlgType    : TMsgDlgType;
  117.                           Button1, Button2, Button3   : TMsgDlgBtn;
  118.                           HelpCtx    : Longint;      X, Y       : Integer;
  119.                           DefaultBtn : TMsgDlgBtn = mbNone;
  120.                           Bitmap     : TBitmap = nil) : Integer; overload;
  121.  
  122. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  123.                           DlgType    : TMsgDlgType;
  124.                           Button1, Button2, Button3   : TMsgDlgBtn;
  125.                           HelpCtx    : Longint;      X, Y       : Integer;
  126.                           DefaultBtn : TMsgDlgBtn = mbNone;
  127.                           Bitmap     : TBitmap = nil) : Integer; overload;
  128.  
  129. function MessageDlgPos(const Msg         : WideString;     DlgType    : TMsgDlgType;
  130.                              Buttons     : TMsgDlgButtons; HelpCtx    : Longint;
  131.                              X, Y        : Integer;
  132.                              DefaultBtn  : TMsgDlgBtn = mbNone;
  133.                              Bitmap      : TBitmap = nil) : Integer;
  134.  
  135. //
  136. // Delphi-TApplication-Functions that set process idle (handled in DLL)
  137. PROCEDURE ProcessMessages;
  138. PROCEDURE HandleMessage;
  139.  
  140. FUNCTION  AMessageBox ( CONST Text : WideString; Caption : WideString = '';
  141.                         Buttons : TMessageButtons = [smbOK];
  142.                         Style   : TMessageStyle   = smsInformation;
  143.                         Default : TMessageButton  = smbOK;
  144.                         Escape  : TMessageButton  = smbCancel) : TMessageButton;
  145.  
  146.  
  147. // Windows-Functions that set process idle
  148. FUNCTION  DispatchMessage(CONST lpMsg  : TMsg) : Longint;
  149. FUNCTION  DialogBox( hInstance  : HINST; lpTemplate   : PChar;
  150.                      hWndParent : HWND;  lpDialogFunc : TFNDlgProc): Integer;
  151. FUNCTION  DialogBoxIndirect( hInstance  : HINST; const lpDialogTemplate : TDlgTemplate;
  152.                              hWndParent : HWND;        lpDialogFunc     : TFNDlgProc): Integer;
  153. FUNCTION  MessageBox ( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT ) : Integer;
  154. FUNCTION  MessageBoxEx( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT; lang : Word ) : Integer;
  155. FUNCTION  SignalObjectAndWait ( h1, h2 : THandle;
  156.                                 ms     : DWord;
  157.                                 al     : BOOL) : BOOL;
  158. FUNCTION  WaitForSingleObject ( h1     : THandle;
  159.                                 MS     : DWORD ) : DWORD;
  160. FUNCTION  WaitForSingleObjectEx ( h1   : THandle;
  161.                                   MS   : DWORD;
  162.                                   al   : BOOL ) : DWORD;
  163.  
  164. FUNCTION  WaitForMultipleObjects ( ct  : DWORD;
  165.                                    CONST pH : PWOHandleArray;
  166.                                    wait     : BOOL;
  167.                                    ms       : DWORD ) : DWORD;
  168. FUNCTION  WaitForMultipleObjectsEx ( ct  : DWORD;
  169.                                      CONST pH : PWOHandleArray;
  170.                                      wait     : BOOL;
  171.                                      ms       : DWORD;
  172.                                      al       : Boolean) : DWORD;
  173. FUNCTION  MsgWaitForMultipleObjects ( ct      : DWORD;
  174.                                       VAR pHandles;
  175.                                       wait    : BOOL;
  176.                                       ms      : DWORD;
  177.                                       wm      : DWORD ) : DWORD;
  178. FUNCTION  MsgWaitForMultipleObjectsEx ( ct     : DWORD;
  179.                                         VAR pHandles;
  180.                                         ms     : DWORD;
  181.                                         wm     : DWORD;
  182.                                         fl     : DWORD ) : DWORD;
  183. PROCEDURE Sleep   (zeit : DWORD );
  184. FUNCTION  SleepEx( zeit : DWORD; alertable : BOOL ) : DWORD;
  185. FUNCTION  WaitCommEvent ( hd  : THandle; VAR em : DWORD;
  186.                           lpo : POverlapped ) : BOOL;
  187. FUNCTION  WaitForInputIdle ( hp : THandle; ms : DWORD ) : DWORD;
  188. FUNCTION  WaitMessage : BOOL;
  189. FUNCTION  WaitNamedPipe ( np : PAnsiChar; ms : DWORD ) : BOOL;
  190.  
  191. IMPLEMENTATION
  192. USES
  193.   SysUtils;
  194.  
  195. TYPE
  196.   TObjProzedur = PROCEDURE OF Object;
  197.  
  198. // Profiler-Internal-Functions, DO NOT USE
  199. FUNCTION  ProfGlobalInit1 : Boolean;              external 'PROFMEAS.DLL';
  200. PROCEDURE ProfGlobalInit2 ( j : Integer );        external 'PROFMEAS.DLL';
  201. PROCEDURE ProfUnInitTimer;                        external 'PROFMEAS.DLL';
  202. FUNCTION  ProfIsInitialised : Integer;            external 'PROFMEAS.DLL';
  203. FUNCTION  ProfMustBeUnInitialised : Integer;      external 'PROFMEAS.DLL';
  204.  
  205. // Calibration - Function - DO NOT USE
  206. PROCEDURE CalcQPCTime802; external 'PROFCALI.DLL';
  207. PROCEDURE ProfSetDelphiVersion ( vers : Integer ); external 'PROFCALI.DLL';
  208.  
  209. // Check if CPU is intel-Compatible
  210. PROCEDURE PruefeKompatibilitaet;
  211. VAR
  212.   tsh, tsl : DWORD;
  213. BEGIN
  214.   Try
  215.     asm
  216.       DW 310FH;
  217.       mov tsh,edx
  218.       mov tsl,eax
  219.     end;
  220.   Except
  221.     Windows.MessageBox(0, 'This CPU is not Intel-Compatible', 'ProDelphi - ERROR', MB_OK);
  222.     halt(0);
  223.   End;
  224. END;
  225.  
  226. FUNCTION  AMessageBox ( CONST Text : WideString; Caption : WideString = '';
  227.                         Buttons : TMessageButtons = [smbOK];
  228.                         Style   : TMessageStyle   = smsInformation;
  229.                         Default : TMessageButton  = smbOK;
  230.                         Escape  : TMessageButton  = smbCancel) : TMessageButton;
  231. BEGIN
  232.   StopCounting;
  233.   Result := Application.MessageBox(Text,Caption,Buttons,Style,Default,Escape);
  234.   ContinueCounting;
  235. END;
  236.  
  237. procedure ShowMessage(const Msg : AnsiString);
  238. BEGIN
  239.   StopCounting;
  240.   QDialogs.ShowMessage(Msg);
  241.   ContinueCounting;
  242. END;
  243.  
  244. procedure ShowMessage(const Msg : ShortString);
  245. BEGIN
  246.   StopCounting;
  247.   QDialogs.ShowMessage(Msg);
  248.   ContinueCounting;
  249. END;
  250.  
  251. procedure ShowMessage(const Msg : AnsiString; Params : array of const);
  252. BEGIN
  253.   StopCounting;
  254.   QDialogs.ShowMessage(Msg, Params);
  255.   ContinueCounting;
  256. END;
  257.  
  258. procedure ShowMessage(const Msg : ShortString; Params : array of const);
  259. BEGIN
  260.   StopCounting;
  261.   QDialogs.ShowMessage(Msg, Params);
  262.   ContinueCounting;
  263. END;
  264.  
  265. procedure ShowMessagePos(const Msg : WideString; X, Y : Integer);
  266. BEGIN
  267.   StopCounting;
  268.   QDialogs.ShowMessagePos(Msg, X, Y);
  269.   ContinueCounting;
  270. END;
  271.  
  272. PROCEDURE ShowMessageFmt(const Msg : WideString; Params : array of const );
  273. BEGIN
  274.   StopCounting;
  275.   QDialogs.ShowMessageFmt(Msg, Params);
  276.   ContinueCounting;
  277. END;
  278.  
  279. function MessageDlg(const Msg        : AnsiString;     DlgType : TMsgDlgType;
  280.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  281.                           DefaultBtn : TMsgDlgBtn = mbNone;
  282.                           Bitmap     : TBitmap = nil) : Integer;
  283. BEGIN
  284.   StopCounting;
  285.   Result := QDialogs.MessageDlg(Msg, DlgType, Buttons, HelpCtx, DefaultBtn, Bitmap);
  286.   ContinueCounting;
  287. END;
  288.  
  289. function MessageDlg(const Msg        : ShortString;     DlgType : TMsgDlgType;
  290.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  291.                           DefaultBtn : TMsgDlgBtn = mbNone;
  292.                           Bitmap     : TBitmap = nil) : Integer;
  293. BEGIN
  294.   StopCounting;
  295.   Result := QDialogs.MessageDlg(Msg, DlgType, Buttons, HelpCtx, DefaultBtn, Bitmap);
  296.   ContinueCounting;
  297. END;
  298.  
  299. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  300.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  301.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  302.                           Bitmap     : TBitmap = nil) : Integer;
  303. BEGIN
  304.   StopCounting;
  305.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx,
  306.                                 DefaultBtn, Bitmap);
  307.   ContinueCounting;
  308. END;
  309.  
  310. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  311.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  312.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  313.                           Bitmap     : TBitmap = nil) : Integer;
  314. BEGIN
  315.   StopCounting;
  316.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx,
  317.                                 DefaultBtn, Bitmap);
  318.   ContinueCounting;
  319. END;
  320.  
  321. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  322.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  323.                           HelpCtx    : Longint;      X, Y       : Integer;
  324.                           DefaultBtn : TMsgDlgBtn = mbNone;
  325.                           Bitmap     : TBitmap = nil) : Integer;
  326. BEGIN
  327.   StopCounting;
  328.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx, X, Y,
  329.                                 DefaultBtn, Bitmap);
  330.   ContinueCounting;
  331. END;
  332.  
  333. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  334.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  335.                           HelpCtx    : Longint;      X, Y       : Integer;
  336.                           DefaultBtn : TMsgDlgBtn = mbNone;
  337.                           Bitmap     : TBitmap = nil) : Integer;
  338. BEGIN
  339.   StopCounting;
  340.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx, X, Y,
  341.                                 DefaultBtn, Bitmap);
  342.   ContinueCounting;
  343. END;
  344.  
  345. function MessageDlg(const Caption    : AnsiString;    const Msg : AnsiString;
  346.                           DlgType    : TMsgDlgType;
  347.                           Button1, Button2, Button3             : TMsgDlgBtn;
  348.                           HelpCtx    : Longint;       X, Y      : Integer;
  349.                           DefaultBtn : TMsgDlgBtn = mbNone;
  350.                           Bitmap     : TBitmap = nil) : Integer;
  351. BEGIN
  352.   StopCounting;
  353.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType,
  354.                                 Button1, Button2, Button3, HelpCtx, X, Y,
  355.                                 DefaultBtn, Bitmap);
  356.   ContinueCounting;
  357. END;
  358.  
  359. function MessageDlg(const Caption    : ShortString;    const Msg : ShortString;
  360.                           DlgType    : TMsgDlgType;
  361.                           Button1, Button2, Button3             : TMsgDlgBtn;
  362.                           HelpCtx    : Longint;       X, Y      : Integer;
  363.                           DefaultBtn : TMsgDlgBtn = mbNone;
  364.                           Bitmap     : TBitmap = nil) : Integer;
  365. BEGIN
  366.   StopCounting;
  367.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType,
  368.                                 Button1, Button2, Button3, HelpCtx, X, Y,
  369.                                 DefaultBtn, Bitmap);
  370.   ContinueCounting;
  371. END;
  372.  
  373. function MessageDlgPos(const Msg         : WideString;     DlgType    : TMsgDlgType;
  374.                              Buttons     : TMsgDlgButtons; HelpCtx    : Longint;
  375.                              X, Y        : Integer;
  376.                              DefaultBtn  : TMsgDlgBtn = mbNone;
  377.                              Bitmap      : TBitmap = nil) : Integer;
  378. BEGIN
  379.   StopCounting;
  380.   Result := QDialogs.MessageDlgPos(Msg, DlgType, Buttons, HelpCtx, X, Y, DefaultBtn, Bitmap);
  381.   ContinueCounting;
  382. END;
  383.  
  384. FUNCTION  DialogBox( hInstance  : HINST; lpTemplate   : PChar;
  385.                      hWndParent : HWND;  lpDialogFunc : TFNDlgProc): Integer;
  386. BEGIN
  387.   StopCounting;
  388.   Result := Windows.DialogBox(hInstance, lpTemplate, hWndParent, lpDialogFunc);
  389.   ContinueCounting;
  390. END;
  391.  
  392. FUNCTION  DialogBoxIndirect( hInstance  : HINST; const lpDialogTemplate : TDlgTemplate;
  393.                              hWndParent : HWND;        lpDialogFunc     : TFNDlgProc): Integer;
  394. BEGIN
  395.   StopCounting;
  396.   Result := Windows.DialogBoxIndirect(hInstance, lpDialogTemplate, hWndParent, lpDialogFunc);
  397.   ContinueCounting;
  398. END;
  399.  
  400. FUNCTION MessageBox ( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT ) : Integer;
  401. BEGIN
  402.   StopCounting;
  403.   Result := Windows.MessageBox(hWnd, lpText, lpCaption, uType);
  404.   ContinueCounting;
  405. END;
  406.  
  407. FUNCTION MessageBoxEx ( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT; lang : Word ) : Integer;
  408. BEGIN
  409.   StopCounting;
  410.   Result := Windows.MessageBoxEx(hWnd, lpText, lpCaption, uType, lang);
  411.   ContinueCounting;
  412. END;
  413.  
  414. FUNCTION DispatchMessage( CONST lpMsg: TMsg ) : Longint;
  415. BEGIN
  416.   StopCounting;
  417.   Result := Windows.DispatchMessage(lpMsg);
  418.   ContinueCounting;
  419. END;
  420.  
  421. PROCEDURE HandleMessage;
  422. BEGIN
  423.   StopCounting;
  424.   Application.HandleMessage;
  425.   ContinueCounting;
  426. END;
  427.  
  428. PROCEDURE ProcessMessages;
  429. BEGIN
  430.   StopCounting;
  431.   Application.ProcessMessages;
  432.   ContinueCounting;
  433. END;
  434.  
  435. PROCEDURE Sleep( zeit : DWORD );
  436. BEGIN
  437.   StopCounting;
  438.   Windows.Sleep(zeit);
  439.   ContinueCounting;
  440. END;
  441.  
  442. FUNCTION SleepEx( zeit : DWORD; alertable : BOOL ) : DWORD;
  443. BEGIN
  444.   StopCounting;
  445.   Result := Windows.SleepEx(zeit, alertable);
  446.   ContinueCounting;
  447. END;
  448.  
  449. FUNCTION SignalObjectAndWait ( h1, h2 : THandle;
  450.                                ms     : DWord;
  451.                                al     : BOOL) : BOOL;
  452. BEGIN
  453.   StopCounting;
  454.   Result := Windows.SignalObjectAndWait(h1, h2, ms, al);
  455.   ContinueCounting;
  456. END;
  457.  
  458. FUNCTION WaitForSingleObject ( h1     : THandle;
  459.                                MS     : DWORD ) : DWORD;
  460. BEGIN
  461.   StopCounting;
  462.   Result := Windows.WaitForSingleObject ( h1, MS );
  463.   ContinueCounting;
  464. END;
  465.  
  466. FUNCTION WaitForSingleObjectEx ( h1   : THandle;
  467.                                  MS   : DWORD;
  468.                                  al   : BOOL ) : DWORD;
  469. BEGIN
  470.   StopCounting;
  471.   Result := Windows.WaitForSingleObjectEx (h1, MS, al);
  472.   ContinueCounting;
  473. END;
  474.  
  475. FUNCTION WaitForMultipleObjects ( ct  : DWORD;
  476.                                   CONST pH : PWOHandleArray;
  477.                                   wait     : BOOL;
  478.                                   ms       : DWORD ) : DWORD;
  479. BEGIN
  480.   StopCounting;
  481.   Result := Windows.WaitForMultipleObjects(ct, pH, wait, ms);
  482.   ContinueCounting;
  483. END;
  484.  
  485. FUNCTION WaitForMultipleObjectsEx ( ct  : DWORD;
  486.                                     CONST pH : PWOHandleArray;
  487.                                     wait     : BOOL;
  488.                                     ms       : DWORD;
  489.                                     al       : Boolean ) : DWORD;
  490. BEGIN
  491.   StopCounting;
  492.   Result := Windows.WaitForMultipleObjectsEx(ct, pH, wait, ms, al);
  493.   ContinueCounting;
  494. END;
  495.  
  496. FUNCTION MsgWaitForMultipleObjects ( ct     : DWORD;
  497.                                      VAR pHandles;
  498.                                      wait   : BOOL;
  499.                                      ms     : DWORD;
  500.                                      wm     : DWORD ) : DWORD;
  501. BEGIN
  502.   StopCounting;
  503.   Result := Windows.MsgWaitForMultipleObjects(ct, pHandles, wait, ms, wm);
  504.   ContinueCounting;
  505. END;
  506.  
  507. FUNCTION MsgWaitForMultipleObjectsEx ( ct     : DWORD;
  508.                                        VAR pHandles;
  509.                                        ms     : DWORD;
  510.                                        wm     : DWORD;
  511.                                        fl     : DWORD ) : DWORD;
  512. BEGIN
  513.   StopCounting;
  514.   Result := Windows.MsgWaitForMultipleObjectsEx(ct, pHandles, ms, wm, fl);
  515.   ContinueCounting;
  516. END;
  517.  
  518. FUNCTION WaitCommEvent ( hd : THandle; VAR em : DWORD; lpo : POverlapped ) : BOOL;
  519. BEGIN
  520.   StopCounting;
  521.   Result := Windows.WaitCommEvent(hd, em, lpo);
  522.   ContinueCounting;
  523. END;
  524.  
  525. FUNCTION WaitForInputIdle ( hp : THandle; ms : DWORD ) : DWORD;
  526. BEGIN
  527.   StopCounting;
  528.   Result := Windows.WaitForInputIdle(hp, ms);
  529.   ContinueCounting;
  530. END;
  531.  
  532. FUNCTION WaitMessage : BOOL;
  533. BEGIN
  534.   StopCounting;
  535.   Result := Windows.WaitMessage;
  536.   ContinueCounting;
  537. END;
  538.  
  539. FUNCTION WaitNamedPipe ( np : PAnsiChar; ms : DWORD ) : BOOL;
  540. BEGIN
  541.   StopCounting;
  542.   Result := Windows.WaitNamedPipe(np, ms);
  543.   ContinueCounting;
  544. END;
  545.  
  546. PROCEDURE PomoExce;
  547. VAR
  548.   exname : Array[0..100] OF Char;
  549.   ExOb   : TObject;
  550. BEGIN
  551.   exname[0] := Char(0);
  552.   ExOb := ExceptObject;
  553.   IF Assigned(ExOb) THEN BEGIN
  554.     IF ExceptObject IS Exception THEN
  555.       StrPLCopy(exname, Exception(ExceptObject).Message, SizeOf(exname));
  556.   END;
  557.   PomoExceStr(exname);
  558. END;
  559.  
  560. INITIALIZATION
  561.   IF ProfIsInitialised = 1 THEN BEGIN
  562.     PruefeKompatibilitaet;
  563.     IF ProfGlobalInit1 = TRUE THEN BEGIN
  564. {$IFDEF VER140 }
  565.       ProfSetDelphiVersion( 6 );
  566. {$ELSE }
  567.    {$IFDEF VER150 }
  568.         ProfSetDelphiVersion( 7 );
  569.    {$ELSE }
  570.         ProfSetDelphiVersion( 8 );
  571.    {$ENDIF }
  572. {$ENDIF }
  573.       CalcQPCTime802;
  574.     END;
  575.     ProfGlobalInit2(0);
  576.     ProfSetComment('None');
  577.   END;
  578. FINALIZATION
  579.   IF ProfMustBeUnInitialised = 1 THEN BEGIN
  580.     ProfSetComment('At finishing application');
  581.     ProfAppendResults(TRUE);
  582.     ProfUnInitTimer;
  583.   END;
  584. end.
  585.  
  586.