jwapdh.pas 93 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093
  1. {******************************************************************************}
  2. { }
  3. { Performance Data Helper API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: pdh.h, released June 2000. The original Pascal }
  9. { code is: Pdh.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaPdh.pas,v 1.12 2005/09/08 07:49:25 marquardt Exp $
  43. unit JwaPdh;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "pdh.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows;
  52. type
  53. PDH_STATUS = DWORD;
  54. {$EXTERNALSYM PDH_STATUS}
  55. const
  56. // version info
  57. PDH_CVERSION_WIN40 = DWORD($0400);
  58. {$EXTERNALSYM PDH_CVERSION_WIN40}
  59. PDH_CVERSION_WIN50 = DWORD($0500);
  60. {$EXTERNALSYM PDH_CVERSION_WIN50}
  61. // v1.1 revision of PDH -- basic log functions
  62. // v1.2 of the PDH -- adds variable instance counters
  63. // v1.3 of the PDH -- adds log service control & stubs for NT5/PDH v2 fn's
  64. // v2.0 of the PDH -- is the NT v 5.0 B2 version
  65. PDH_VERSION = DWORD((PDH_CVERSION_WIN50) + $0003);
  66. {$EXTERNALSYM PDH_VERSION}
  67. // define severity masks
  68. function IsSuccessSeverity(ErrorCode: Longint): Boolean;
  69. {$EXTERNALSYM IsSuccessSeverity}
  70. function IsInformationalSeverity(ErrorCode: Longint): Boolean;
  71. {$EXTERNALSYM IsInformationalSeverity}
  72. function IsWarningSeverity(ErrorCode: Longint): Boolean;
  73. {$EXTERNALSYM IsWarningSeverity}
  74. function IsErrorSeverity(ErrorCode: Longint): Boolean;
  75. {$EXTERNALSYM IsErrorSeverity}
  76. const
  77. MAX_COUNTER_PATH = 256; // Maximum counter path length
  78. {$EXTERNALSYM MAX_COUNTER_PATH}
  79. PDH_MAX_COUNTER_NAME = 1024; // Maximum counter name length.
  80. {$EXTERNALSYM PDH_MAX_COUNTER_NAME}
  81. PDH_MAX_INSTANCE_NAME = 1024; // Maximum counter instance name length.
  82. {$EXTERNALSYM PDH_MAX_INSTANCE_NAME}
  83. PDH_MAX_COUNTER_PATH = 2048; // Maximum full counter path length.
  84. {$EXTERNALSYM PDH_MAX_COUNTER_PATH}
  85. PDH_MAX_DATASOURCE_PATH = 1024; // MAximum full counter log name length.
  86. {$EXTERNALSYM PDH_MAX_DATASOURCE_PATH}
  87. // data type definitions
  88. type
  89. PDH_HCOUNTER = HANDLE;
  90. {$EXTERNALSYM PDH_HCOUNTER}
  91. PDH_HQUERY = HANDLE;
  92. {$EXTERNALSYM PDH_HQUERY}
  93. PDH_HLOG = HANDLE;
  94. {$EXTERNALSYM PDH_HLOG}
  95. HCOUNTER = PDH_HCOUNTER;
  96. {$EXTERNALSYM HCOUNTER}
  97. HQUERY = PDH_HQUERY;
  98. {$EXTERNALSYM HQUERY}
  99. HLOG = PDH_HLOG;
  100. {$EXTERNALSYM HLOG}
  101. const
  102. INVALID_HANDLE_VALUE = HANDLE(LONG_PTR(-1));
  103. {$EXTERNALSYM INVALID_HANDLE_VALUE}
  104. H_REALTIME_DATASOURCE = NULL;
  105. {$EXTERNALSYM H_REALTIME_DATASOURCE}
  106. H_WBEM_DATASOURCE = INVALID_HANDLE_VALUE;
  107. {$EXTERNALSYM H_WBEM_DATASOURCE}
  108. type
  109. PPDH_RAW_COUNTER = ^PDH_RAW_COUNTER;
  110. {$EXTERNALSYM PPDH_RAW_COUNTER}
  111. _PDH_RAW_COUNTER = record
  112. CStatus: DWORD;
  113. TimeStamp: FILETIME;
  114. FirstValue: LONGLONG;
  115. SecondValue: LONGLONG;
  116. MultiCount: DWORD;
  117. end;
  118. {$EXTERNALSYM _PDH_RAW_COUNTER}
  119. PDH_RAW_COUNTER = _PDH_RAW_COUNTER;
  120. {$EXTERNALSYM PDH_RAW_COUNTER}
  121. TPdhRawCounter = PDH_RAW_COUNTER;
  122. PPdhRawCounter = PPDH_RAW_COUNTER;
  123. PPDH_RAW_COUNTER_ITEM_A = ^PDH_RAW_COUNTER_ITEM_A;
  124. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM_A}
  125. _PDH_RAW_COUNTER_ITEM_A = record
  126. szName: LPSTR;
  127. RawValue: PDH_RAW_COUNTER;
  128. end;
  129. {$EXTERNALSYM _PDH_RAW_COUNTER_ITEM_A}
  130. PDH_RAW_COUNTER_ITEM_A = _PDH_RAW_COUNTER_ITEM_A;
  131. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM_A}
  132. TPdhRawCounterItemA = PDH_RAW_COUNTER_ITEM_A;
  133. PPdhRawCounterItemA = PPDH_RAW_COUNTER_ITEM_A;
  134. PPDH_RAW_COUNTER_ITEM_W = ^PDH_RAW_COUNTER_ITEM_W;
  135. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM_W}
  136. _PDH_RAW_COUNTER_ITEM_W = record
  137. szName: LPWSTR;
  138. RawValue: PDH_RAW_COUNTER;
  139. end;
  140. {$EXTERNALSYM _PDH_RAW_COUNTER_ITEM_W}
  141. PDH_RAW_COUNTER_ITEM_W = _PDH_RAW_COUNTER_ITEM_W;
  142. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM_W}
  143. TPdhRawCounterItemW = PDH_RAW_COUNTER_ITEM_W;
  144. PPdhRawCounterItemW = PPDH_RAW_COUNTER_ITEM_W;
  145. {$IFDEF UNICODE}
  146. PPdhRawCounterItem = PPdhRawCounterItemW;
  147. PDH_RAW_COUNTER_ITEM = _PDH_RAW_COUNTER_ITEM_W;
  148. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM}
  149. PPDH_RAW_COUNTER_ITEM = PPDH_RAW_COUNTER_ITEM_W;
  150. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM}
  151. TPdhRawCounterItem = _PDH_RAW_COUNTER_ITEM_W;
  152. {$ELSE}
  153. PPdhRawCounterItem = PPdhRawCounterItemA;
  154. PDH_RAW_COUNTER_ITEM = _PDH_RAW_COUNTER_ITEM_A;
  155. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM}
  156. PPDH_RAW_COUNTER_ITEM = PPDH_RAW_COUNTER_ITEM_A;
  157. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM}
  158. TPdhRawCounterItem = _PDH_RAW_COUNTER_ITEM_A;
  159. {$ENDIF UNICODE}
  160. PPDH_FMT_COUNTERVALUE = ^PDH_FMT_COUNTERVALUE;
  161. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE}
  162. _PDH_FMT_COUNTERVALUE = record
  163. CStatus: DWORD;
  164. case Longint of
  165. 1: (longValue: LONG);
  166. 2: (doubleValue: Double);
  167. 3: (largeValue: LONGLONG);
  168. 4: (AnsiStringValue: LPSTR);
  169. 5: (WideStringValue: LPCWSTR);
  170. end;
  171. {$EXTERNALSYM _PDH_FMT_COUNTERVALUE}
  172. PDH_FMT_COUNTERVALUE = _PDH_FMT_COUNTERVALUE;
  173. {$EXTERNALSYM PDH_FMT_COUNTERVALUE}
  174. TPdhFmtCounterValue = PDH_FMT_COUNTERVALUE;
  175. PPdhFmtCounterValue = PPDH_FMT_COUNTERVALUE;
  176. PPDH_FMT_COUNTERVALUE_ITEM_A = ^PDH_FMT_COUNTERVALUE_ITEM_A;
  177. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM_A}
  178. _PDH_FMT_COUNTERVALUE_ITEM_A = record
  179. szName: LPSTR;
  180. FmtValue: PDH_FMT_COUNTERVALUE;
  181. end;
  182. {$EXTERNALSYM _PDH_FMT_COUNTERVALUE_ITEM_A}
  183. PDH_FMT_COUNTERVALUE_ITEM_A = _PDH_FMT_COUNTERVALUE_ITEM_A;
  184. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM_A}
  185. TPdhFmtCounterValueItemA = PDH_FMT_COUNTERVALUE_ITEM_A;
  186. PPdhFmtCounterValueItemA = PPDH_FMT_COUNTERVALUE_ITEM_A;
  187. PPDH_FMT_COUNTERVALUE_ITEM_W = ^PDH_FMT_COUNTERVALUE_ITEM_W;
  188. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM_W}
  189. _PDH_FMT_COUNTERVALUE_ITEM_W = record
  190. szName: LPWSTR;
  191. FmtValue: PDH_FMT_COUNTERVALUE;
  192. end;
  193. {$EXTERNALSYM _PDH_FMT_COUNTERVALUE_ITEM_W}
  194. PDH_FMT_COUNTERVALUE_ITEM_W = _PDH_FMT_COUNTERVALUE_ITEM_W;
  195. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM_W}
  196. TPdhFmtCounterValueItemW = PDH_FMT_COUNTERVALUE_ITEM_W;
  197. PPdhFmtCounterValueItemW = PPDH_FMT_COUNTERVALUE_ITEM_W;
  198. {$IFDEF UNICODE}
  199. PPdhFmtCounterValueItem = PPdhFmtCounterValueItemW;
  200. PDH_FMT_COUNTERVALUE_ITEM = _PDH_FMT_COUNTERVALUE_ITEM_W;
  201. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM}
  202. PPDH_FMT_COUNTERVALUE_ITEM = PPDH_FMT_COUNTERVALUE_ITEM_W;
  203. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM}
  204. TPdhFmtCounterValueItem = _PDH_FMT_COUNTERVALUE_ITEM_W;
  205. {$ELSE}
  206. PPdhFmtCounterValueItem = PPdhFmtCounterValueItemA;
  207. PDH_FMT_COUNTERVALUE_ITEM = _PDH_FMT_COUNTERVALUE_ITEM_A;
  208. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM}
  209. PPDH_FMT_COUNTERVALUE_ITEM = PPDH_FMT_COUNTERVALUE_ITEM_A;
  210. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM}
  211. TPdhFmtCounterValueItem = _PDH_FMT_COUNTERVALUE_ITEM_A;
  212. {$ENDIF UNICODE}
  213. PPDH_STATISTICS = ^PDH_STATISTICS;
  214. {$EXTERNALSYM PPDH_STATISTICS}
  215. _PDH_STATISTICS = record
  216. dwFormat: DWORD;
  217. Count: DWORD;
  218. min: PDH_FMT_COUNTERVALUE;
  219. max: PDH_FMT_COUNTERVALUE;
  220. mean: PDH_FMT_COUNTERVALUE;
  221. end;
  222. {$EXTERNALSYM _PDH_STATISTICS}
  223. PDH_STATISTICS = _PDH_STATISTICS;
  224. {$EXTERNALSYM PDH_STATISTICS}
  225. TPdhStatistics = PDH_STATISTICS;
  226. PPdhStatistics = PPDH_STATISTICS;
  227. PPDH_COUNTER_PATH_ELEMENTS_A = ^PDH_COUNTER_PATH_ELEMENTS_A;
  228. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS_A}
  229. _PDH_COUNTER_PATH_ELEMENTS_A = record
  230. szMachineName: LPSTR;
  231. szObjectName: LPSTR;
  232. szInstanceName: LPSTR;
  233. szParentInstance: LPSTR;
  234. dwInstanceIndex: DWORD;
  235. szCounterName: LPSTR;
  236. end;
  237. {$EXTERNALSYM _PDH_COUNTER_PATH_ELEMENTS_A}
  238. PDH_COUNTER_PATH_ELEMENTS_A = _PDH_COUNTER_PATH_ELEMENTS_A;
  239. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS_A}
  240. TPdhCounterPathElementsA = PDH_COUNTER_PATH_ELEMENTS_A;
  241. PPdhCounterPathElementsA = PPDH_COUNTER_PATH_ELEMENTS_A;
  242. PPDH_COUNTER_PATH_ELEMENTS_W = ^PDH_COUNTER_PATH_ELEMENTS_W;
  243. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS_W}
  244. _PDH_COUNTER_PATH_ELEMENTS_W = record
  245. szMachineName: LPWSTR;
  246. szObjectName: LPWSTR;
  247. szInstanceName: LPWSTR;
  248. szParentInstance: LPWSTR;
  249. dwInstanceIndex: DWORD;
  250. szCounterName: LPWSTR;
  251. end;
  252. {$EXTERNALSYM _PDH_COUNTER_PATH_ELEMENTS_W}
  253. PDH_COUNTER_PATH_ELEMENTS_W = _PDH_COUNTER_PATH_ELEMENTS_W;
  254. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS_W}
  255. TPdhCounterPathElementsW = PDH_COUNTER_PATH_ELEMENTS_W;
  256. PPdhCounterPathElementsW = PPDH_COUNTER_PATH_ELEMENTS_W;
  257. {$IFDEF UNICODE}
  258. PPdhCounterPathElements = PPdhCounterPathElementsW;
  259. PDH_COUNTER_PATH_ELEMENTS = _PDH_COUNTER_PATH_ELEMENTS_W;
  260. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS}
  261. PPDH_COUNTER_PATH_ELEMENTS = PPDH_COUNTER_PATH_ELEMENTS_W;
  262. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS}
  263. TPdhCounterPathElements = _PDH_COUNTER_PATH_ELEMENTS_W;
  264. {$ELSE}
  265. PPdhCounterPathElements = PPdhCounterPathElementsA;
  266. PDH_COUNTER_PATH_ELEMENTS = _PDH_COUNTER_PATH_ELEMENTS_A;
  267. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS}
  268. PPDH_COUNTER_PATH_ELEMENTS = PPDH_COUNTER_PATH_ELEMENTS_A;
  269. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS}
  270. TPdhCounterPathElements = _PDH_COUNTER_PATH_ELEMENTS_A;
  271. {$ENDIF UNICODE}
  272. PPDH_DATA_ITEM_PATH_ELEMENTS_A = ^PDH_DATA_ITEM_PATH_ELEMENTS_A;
  273. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS_A}
  274. _PDH_DATA_ITEM_PATH_ELEMENTS_A = record
  275. szMachineName: LPSTR;
  276. ObjectGUID: GUID;
  277. dwItemId: DWORD;
  278. szInstanceName: LPSTR;
  279. end;
  280. {$EXTERNALSYM _PDH_DATA_ITEM_PATH_ELEMENTS_A}
  281. PDH_DATA_ITEM_PATH_ELEMENTS_A = _PDH_DATA_ITEM_PATH_ELEMENTS_A;
  282. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS_A}
  283. TPdhDataItemPathElementsA = PDH_DATA_ITEM_PATH_ELEMENTS_A;
  284. PPdhDataItemPathElementsA = PPDH_DATA_ITEM_PATH_ELEMENTS_A;
  285. PPDH_DATA_ITEM_PATH_ELEMENTS_W = ^PDH_DATA_ITEM_PATH_ELEMENTS_W;
  286. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS_W}
  287. _PDH_DATA_ITEM_PATH_ELEMENTS_W = record
  288. szMachineName: LPWSTR;
  289. ObjectGUID: GUID;
  290. dwItemId: DWORD;
  291. szInstanceName: LPWSTR;
  292. end;
  293. {$EXTERNALSYM _PDH_DATA_ITEM_PATH_ELEMENTS_W}
  294. PDH_DATA_ITEM_PATH_ELEMENTS_W = _PDH_DATA_ITEM_PATH_ELEMENTS_W;
  295. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS_W}
  296. TPdhDataItemPathElementsW = PDH_DATA_ITEM_PATH_ELEMENTS_W;
  297. PPdhDataItemPathElementsW = PPDH_DATA_ITEM_PATH_ELEMENTS_W;
  298. {$IFDEF UNICODE}
  299. PPdhDataItemPathElements = PPdhDataItemPathElementsW;
  300. PDH_DATA_ITEM_PATH_ELEMENTS = _PDH_DATA_ITEM_PATH_ELEMENTS_W;
  301. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS}
  302. PPDH_DATA_ITEM_PATH_ELEMENTS = PPDH_DATA_ITEM_PATH_ELEMENTS_W;
  303. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS}
  304. TPdhDataItemPathElements = _PDH_DATA_ITEM_PATH_ELEMENTS_W;
  305. {$ELSE}
  306. PPdhDataItemPathElements = PPdhDataItemPathElementsA;
  307. PDH_DATA_ITEM_PATH_ELEMENTS = _PDH_DATA_ITEM_PATH_ELEMENTS_A;
  308. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS}
  309. PPDH_DATA_ITEM_PATH_ELEMENTS = PPDH_DATA_ITEM_PATH_ELEMENTS_A;
  310. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS}
  311. TPdhDataItemPathElements = _PDH_DATA_ITEM_PATH_ELEMENTS_A;
  312. {$ENDIF UNICODE}
  313. PPDH_COUNTER_INFO_A = ^PDH_COUNTER_INFO_A;
  314. {$EXTERNALSYM PPDH_COUNTER_INFO_A}
  315. _PDH_COUNTER_INFO_A = record
  316. dwLength: DWORD;
  317. dwType: DWORD;
  318. CVersion: DWORD;
  319. CStatus: DWORD;
  320. lScale: LONG;
  321. lDefaultScale: LONG;
  322. dwUserData: DWORD_PTR;
  323. dwQueryUserData: DWORD_PTR;
  324. szFullPath: LPSTR;
  325. Union: record
  326. case Longint of
  327. 1: (DataItemPath: PDH_DATA_ITEM_PATH_ELEMENTS_A);
  328. 2: (CounterPath: PDH_COUNTER_PATH_ELEMENTS_A);
  329. 3: (szMachineName: LPSTR;
  330. szObjectName: LPSTR;
  331. szInstanceName: LPSTR;
  332. szParentInstance: LPSTR;
  333. dwInstanceIndex: DWORD;
  334. szCounterName: LPSTR);
  335. end;
  336. szExplainText: LPSTR;
  337. DataBuffer: array [0..0] of DWORD;
  338. end;
  339. {$EXTERNALSYM _PDH_COUNTER_INFO_A}
  340. PDH_COUNTER_INFO_A = _PDH_COUNTER_INFO_A;
  341. {$EXTERNALSYM PDH_COUNTER_INFO_A}
  342. TPdhCounterInfoA = PDH_COUNTER_INFO_A;
  343. PPdhCounterInfoA = PPDH_COUNTER_INFO_A;
  344. PPDH_COUNTER_INFO_W = ^PDH_COUNTER_INFO_W;
  345. {$EXTERNALSYM PPDH_COUNTER_INFO_W}
  346. _PDH_COUNTER_INFO_W = record
  347. dwLength: DWORD;
  348. dwType: DWORD;
  349. CVersion: DWORD;
  350. CStatus: DWORD;
  351. lScale: LONG;
  352. lDefaultScale: LONG;
  353. dwUserData: DWORD_PTR;
  354. dwQueryUserData: DWORD_PTR;
  355. szFullPath: LPWSTR;
  356. Union: record
  357. case Longint of
  358. 1: (DataItemPath: PDH_DATA_ITEM_PATH_ELEMENTS_W);
  359. 2: (CounterPath: PDH_COUNTER_PATH_ELEMENTS_W);
  360. 3: (szMachineName: LPWSTR;
  361. szObjectName: LPWSTR;
  362. szInstanceName: LPWSTR;
  363. szParentInstance: LPWSTR;
  364. dwInstanceIndex: DWORD;
  365. szCounterName: LPWSTR);
  366. end;
  367. szExplainText: LPWSTR;
  368. DataBuffer: array [0..0] of DWORD;
  369. end;
  370. {$EXTERNALSYM _PDH_COUNTER_INFO_W}
  371. PDH_COUNTER_INFO_W = _PDH_COUNTER_INFO_W;
  372. {$EXTERNALSYM PDH_COUNTER_INFO_W}
  373. TPdhCounterInfoW = PDH_COUNTER_INFO_W;
  374. PPdhCounterInfoW = PPDH_COUNTER_INFO_W;
  375. {$IFDEF UNICODE}
  376. PPdhCounterInfo = PPdhCounterInfoW;
  377. PDH_COUNTER_INFO = _PDH_COUNTER_INFO_W;
  378. {$EXTERNALSYM PDH_COUNTER_INFO}
  379. PPDH_COUNTER_INFO = PPDH_COUNTER_INFO_W;
  380. {$EXTERNALSYM PPDH_COUNTER_INFO}
  381. TPdhCounterInfo = _PDH_COUNTER_INFO_W;
  382. {$ELSE}
  383. PPdhCounterInfo = PPdhCounterInfoA;
  384. PDH_COUNTER_INFO = _PDH_COUNTER_INFO_A;
  385. {$EXTERNALSYM PDH_COUNTER_INFO}
  386. PPDH_COUNTER_INFO = PPDH_COUNTER_INFO_A;
  387. {$EXTERNALSYM PPDH_COUNTER_INFO}
  388. TPdhCounterInfo = _PDH_COUNTER_INFO_A;
  389. {$ENDIF UNICODE}
  390. PPDH_TIME_INFO = ^PDH_TIME_INFO;
  391. {$EXTERNALSYM PPDH_TIME_INFO}
  392. _PDH_TIME_INFO = record
  393. StartTime: LONGLONG;
  394. EndTime: LONGLONG;
  395. SampleCount: DWORD;
  396. end;
  397. {$EXTERNALSYM _PDH_TIME_INFO}
  398. PDH_TIME_INFO = _PDH_TIME_INFO;
  399. {$EXTERNALSYM PDH_TIME_INFO}
  400. TPdhTimeInfo = PDH_TIME_INFO;
  401. PPdhTimeInfo = PPDH_TIME_INFO;
  402. PPDH_RAW_LOG_RECORD = ^PDH_RAW_LOG_RECORD;
  403. {$EXTERNALSYM PPDH_RAW_LOG_RECORD}
  404. _PDH_RAW_LOG_RECORD = record
  405. dwStructureSize: DWORD;
  406. dwRecordType: DWORD;
  407. dwItems: DWORD;
  408. RawBytes: array [0..0] of UCHAR;
  409. end;
  410. {$EXTERNALSYM _PDH_RAW_LOG_RECORD}
  411. PDH_RAW_LOG_RECORD = _PDH_RAW_LOG_RECORD;
  412. {$EXTERNALSYM PDH_RAW_LOG_RECORD}
  413. TPdhRawLogRecord = PDH_RAW_LOG_RECORD;
  414. PPdhRawLogRecord = PPDH_RAW_LOG_RECORD;
  415. PPDH_LOG_SERVICE_QUERY_INFO_A = ^PDH_LOG_SERVICE_QUERY_INFO_A;
  416. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO_A}
  417. _PDH_LOG_SERVICE_QUERY_INFO_A = record
  418. dwSize: DWORD;
  419. dwFlags: DWORD;
  420. dwLogQuota: DWORD;
  421. szLogFileCaption: LPSTR;
  422. szDefaultDir: LPSTR;
  423. szBaseFileName: LPSTR;
  424. dwFileType: DWORD;
  425. dwReserved: DWORD;
  426. Union: record
  427. case Longint of
  428. 1: (PdlAutoNameInterval: DWORD;
  429. PdlAutoNameUnits: DWORD;
  430. PdlCommandFilename: LPSTR;
  431. PdlCounterList: LPSTR;
  432. PdlAutoNameFormat: DWORD;
  433. PdlSampleInterval: DWORD;
  434. PdlLogStartTime: FILETIME;
  435. PdlLogEndTime: FILETIME);
  436. 2: (TlNumberOfBuffers: DWORD;
  437. TlMinimumBuffers: DWORD;
  438. TlMaximumBuffers: DWORD;
  439. TlFreeBuffers: DWORD;
  440. TlBufferSize: DWORD;
  441. TlEventsLost: DWORD;
  442. TlLoggerThreadId: DWORD;
  443. TlBuffersWritten: DWORD;
  444. TlLogHandle: DWORD;
  445. TlLogFileName: LPSTR);
  446. end;
  447. end;
  448. {$EXTERNALSYM _PDH_LOG_SERVICE_QUERY_INFO_A}
  449. PDH_LOG_SERVICE_QUERY_INFO_A = _PDH_LOG_SERVICE_QUERY_INFO_A;
  450. {$EXTERNALSYM _PDH_LOG_SERVICE_QUERY_INFO_A}
  451. TPdhLogServiceQueryInfoA = PDH_LOG_SERVICE_QUERY_INFO_A;
  452. PPdhLogServiceQueryInfoA = PPDH_LOG_SERVICE_QUERY_INFO_A;
  453. PPDH_LOG_SERVICE_QUERY_INFO_W = ^PDH_LOG_SERVICE_QUERY_INFO_W;
  454. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO_W}
  455. _PDH_LOG_SERVICE_QUERY_INFO_W = record
  456. dwSize: DWORD;
  457. dwFlags: DWORD;
  458. dwLogQuota: DWORD;
  459. szLogFileCaption: LPWSTR;
  460. szDefaultDir: LPWSTR;
  461. szBaseFileName: LPWSTR;
  462. dwFileType: DWORD;
  463. dwReserved: DWORD;
  464. Union: record
  465. case Longint of
  466. 1: (PdlAutoNameInterval: DWORD;
  467. PdlAutoNameUnits: DWORD;
  468. PdlCommandFilename: LPWSTR;
  469. PdlCounterList: LPWSTR;
  470. PdlAutoNameFormat: DWORD;
  471. PdlSampleInterval: DWORD;
  472. PdlLogStartTime: FILETIME;
  473. PdlLogEndTime: FILETIME);
  474. 2: (TlNumberOfBuffers: DWORD;
  475. TlMinimumBuffers: DWORD;
  476. TlMaximumBuffers: DWORD;
  477. TlFreeBuffers: DWORD;
  478. TlBufferSize: DWORD;
  479. TlEventsLost: DWORD;
  480. TlLoggerThreadId: DWORD;
  481. TlBuffersWritten: DWORD;
  482. TlLogHandle: DWORD;
  483. TlLogFileName: LPWSTR);
  484. end;
  485. end;
  486. {$EXTERNALSYM _PDH_LOG_SERVICE_QUERY_INFO_W}
  487. PDH_LOG_SERVICE_QUERY_INFO_W = _PDH_LOG_SERVICE_QUERY_INFO_W;
  488. {$EXTERNALSYM PDH_LOG_SERVICE_QUERY_INFO_W}
  489. TPdhLogServiceQueryInfoW = PDH_LOG_SERVICE_QUERY_INFO_W;
  490. PPdhLogServiceQueryInfoW = PPDH_LOG_SERVICE_QUERY_INFO_W;
  491. {$IFDEF UNICODE}
  492. PPdhLogServiceQueryInfo = PPdhLogServiceQueryInfoW;
  493. PDH_LOG_SERVICE_QUERY_INFO = _PDH_LOG_SERVICE_QUERY_INFO_W;
  494. {$EXTERNALSYM PDH_LOG_SERVICE_QUERY_INFO}
  495. PPDH_LOG_SERVICE_QUERY_INFO = PPDH_LOG_SERVICE_QUERY_INFO_W;
  496. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO}
  497. TPdhLogServiceQueryInfo = _PDH_LOG_SERVICE_QUERY_INFO_W;
  498. {$ELSE}
  499. PPdhLogServiceQueryInfo = PPdhLogServiceQueryInfoA;
  500. PDH_LOG_SERVICE_QUERY_INFO = _PDH_LOG_SERVICE_QUERY_INFO_A;
  501. {$EXTERNALSYM PDH_LOG_SERVICE_QUERY_INFO}
  502. PPDH_LOG_SERVICE_QUERY_INFO = PPDH_LOG_SERVICE_QUERY_INFO_A;
  503. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO}
  504. TPdhLogServiceQueryInfo = _PDH_LOG_SERVICE_QUERY_INFO_A;
  505. {$ENDIF UNICODE}
  506. //
  507. // Time value constants
  508. //
  509. const
  510. MAX_TIME_VALUE = LONGLONG($7FFFFFFFFFFFFFFF);
  511. {$EXTERNALSYM MAX_TIME_VALUE}
  512. MIN_TIME_VALUE = LONGLONG(0);
  513. {$EXTERNALSYM MIN_TIME_VALUE}
  514. // function definitions
  515. function PdhGetDllVersion(var lpdwVersion: DWORD): PDH_STATUS; stdcall;
  516. {$EXTERNALSYM PdhGetDllVersion}
  517. //
  518. // Query Functions
  519. //
  520. function PdhOpenQueryA(szDataSource: LPCSTR; dwUserData: DWORD_PTR;
  521. var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  522. {$EXTERNALSYM PdhOpenQueryA}
  523. function PdhOpenQueryW(szDataSource: LPCWSTR; dwUserData: DWORD_PTR;
  524. var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  525. {$EXTERNALSYM PdhOpenQueryW}
  526. function PdhOpenQuery(szDataSource: LPCTSTR; dwUserData: DWORD_PTR;
  527. var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  528. {$EXTERNALSYM PdhOpenQuery}
  529. function PdhAddCounterA(hQuery: PDH_HQUERY; szFullCounterPath: LPCSTR;
  530. dwUserData: DWORD_PTR; var phCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  531. {$EXTERNALSYM PdhAddCounterA}
  532. function PdhAddCounterW(hQuery: PDH_HQUERY; szFullCounterPath: LPCWSTR;
  533. dwUserData: DWORD_PTR; var phCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  534. {$EXTERNALSYM PdhAddCounterW}
  535. function PdhAddCounter(hQuery: PDH_HQUERY; szFullCounterPath: LPCTSTR;
  536. dwUserData: DWORD_PTR; var phCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  537. {$EXTERNALSYM PdhAddCounter}
  538. function PdhRemoveCounter(hCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  539. {$EXTERNALSYM PdhRemoveCounter}
  540. function PdhCollectQueryData(hQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  541. {$EXTERNALSYM PdhCollectQueryData}
  542. function PdhCloseQuery(hQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  543. {$EXTERNALSYM PdhCloseQuery}
  544. //
  545. // Counter Functions
  546. //
  547. function PdhGetFormattedCounterValue(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  548. lpdwType: LPDWORD; var pValue: PDH_FMT_COUNTERVALUE): PDH_STATUS; stdcall;
  549. {$EXTERNALSYM PdhGetFormattedCounterValue}
  550. function PdhGetFormattedCounterArrayA(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  551. var lpdwBufferSize, lpdwItemCount: DWORD;
  552. var ItemBuffer: PDH_FMT_COUNTERVALUE_ITEM_A): PDH_STATUS; stdcall;
  553. {$EXTERNALSYM PdhGetFormattedCounterArrayA}
  554. function PdhGetFormattedCounterArrayW(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  555. var lpdwBufferSize, lpdwItemCount: DWORD;
  556. var ItemBuffer: PDH_FMT_COUNTERVALUE_ITEM_W): PDH_STATUS; stdcall;
  557. {$EXTERNALSYM PdhGetFormattedCounterArrayW}
  558. function PdhGetFormattedCounterArray(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  559. var lpdwBufferSize, lpdwItemCount: DWORD;
  560. var ItemBuffer: PDH_FMT_COUNTERVALUE_ITEM): PDH_STATUS; stdcall;
  561. {$EXTERNALSYM PdhGetFormattedCounterArray}
  562. // dwFormat flag values
  563. const
  564. PDH_FMT_RAW = DWORD($00000010);
  565. {$EXTERNALSYM PDH_FMT_RAW}
  566. PDH_FMT_ANSI = DWORD($00000020);
  567. {$EXTERNALSYM PDH_FMT_ANSI}
  568. PDH_FMT_UNICODE = DWORD($00000040);
  569. {$EXTERNALSYM PDH_FMT_UNICODE}
  570. PDH_FMT_LONG = DWORD($00000100);
  571. {$EXTERNALSYM PDH_FMT_LONG}
  572. PDH_FMT_DOUBLE = DWORD($00000200);
  573. {$EXTERNALSYM PDH_FMT_DOUBLE}
  574. PDH_FMT_LARGE = DWORD($00000400);
  575. {$EXTERNALSYM PDH_FMT_LARGE}
  576. PDH_FMT_NOSCALE = DWORD($00001000);
  577. {$EXTERNALSYM PDH_FMT_NOSCALE}
  578. PDH_FMT_1000 = DWORD($00002000);
  579. {$EXTERNALSYM PDH_FMT_1000}
  580. PDH_FMT_NODATA = DWORD($00004000);
  581. {$EXTERNALSYM PDH_FMT_NODATA}
  582. PDH_FMT_NOCAP100 = DWORD($00008000);
  583. {$EXTERNALSYM PDH_FMT_NODATA}
  584. PERF_DETAIL_COSTLY = DWORD($00010000);
  585. {$EXTERNALSYM PERF_DETAIL_COSTLY}
  586. PERF_DETAIL_STANDARD = DWORD($0000FFFF);
  587. {$EXTERNALSYM PERF_DETAIL_STANDARD}
  588. function PdhGetRawCounterValue(hCounter: PDH_HCOUNTER; lpdwType: LPDWORD;
  589. var pValue: PDH_RAW_COUNTER): PDH_STATUS; stdcall;
  590. {$EXTERNALSYM PdhGetRawCounterValue}
  591. function PdhGetRawCounterArrayA(hCounter: PDH_HCOUNTER; var lpdwBufferSize,
  592. lpdwItemCount: DWORD; var ItemBuffer: PDH_RAW_COUNTER_ITEM_A): PDH_STATUS; stdcall;
  593. {$EXTERNALSYM PdhGetRawCounterArrayA}
  594. function PdhGetRawCounterArrayW(hCounter: PDH_HCOUNTER; var lpdwBufferSize,
  595. lpdwItemCount: DWORD; var ItemBuffer: PDH_RAW_COUNTER_ITEM_W): PDH_STATUS; stdcall;
  596. {$EXTERNALSYM PdhGetRawCounterArrayW}
  597. function PdhGetRawCounterArray(hCounter: PDH_HCOUNTER; var lpdwBufferSize,
  598. lpdwItemCount: DWORD; var ItemBuffer: PDH_RAW_COUNTER_ITEM): PDH_STATUS; stdcall;
  599. {$EXTERNALSYM PdhGetRawCounterArray}
  600. function PdhCalculateCounterFromRawValue(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  601. rawValue1, rawValue2: PPDH_RAW_COUNTER; var fmtValue: PDH_FMT_COUNTERVALUE): PDH_STATUS; stdcall;
  602. {$EXTERNALSYM PdhCalculateCounterFromRawValue}
  603. function PdhComputeCounterStatistics(hCounter: PDH_HCOUNTER; dwFormat, dwFirstEntry,
  604. dwNumEntries: DWORD; lpRawValueArray: PPDH_RAW_COUNTER; var data: PDH_STATISTICS): PDH_STATUS; stdcall;
  605. {$EXTERNALSYM PdhComputeCounterStatistics}
  606. function PdhGetCounterInfoA(hCounter: PDH_HCOUNTER; bRetrieveExplainText: Boolean;
  607. var pdwBufferSize: DWORD; lpBuffer: PPDH_COUNTER_INFO_A): PDH_STATUS; stdcall;
  608. {$EXTERNALSYM PdhGetCounterInfoA}
  609. function PdhGetCounterInfoW(hCounter: PDH_HCOUNTER; bRetrieveExplainText: Boolean;
  610. var pdwBufferSize: DWORD; lpBuffer: PPDH_COUNTER_INFO_W): PDH_STATUS; stdcall;
  611. {$EXTERNALSYM PdhGetCounterInfoW}
  612. function PdhGetCounterInfo(hCounter: PDH_HCOUNTER; bRetrieveExplainText: Boolean;
  613. var pdwBufferSize: DWORD; lpBuffer: PPDH_COUNTER_INFO): PDH_STATUS; stdcall;
  614. {$EXTERNALSYM PdhGetCounterInfo}
  615. const
  616. PDH_MAX_SCALE = Longint(7);
  617. {$EXTERNALSYM PDH_MAX_SCALE}
  618. PDH_MIN_SCALE = Longint(-7);
  619. {$EXTERNALSYM PDH_MIN_SCALE}
  620. function PdhSetCounterScaleFactor(hCounter: PDH_HCOUNTER; lFactor: LONG): PDH_STATUS; stdcall;
  621. {$EXTERNALSYM PdhSetCounterScaleFactor}
  622. //
  623. // Browsing and enumeration functions
  624. //
  625. function PdhConnectMachineA(szMachineName: LPCSTR): PDH_STATUS; stdcall;
  626. {$EXTERNALSYM PdhConnectMachineA}
  627. function PdhConnectMachineW(szMachineName: LPCWSTR): PDH_STATUS; stdcall;
  628. {$EXTERNALSYM PdhConnectMachineW}
  629. function PdhConnectMachine(szMachineName: LPCTSTR): PDH_STATUS; stdcall;
  630. {$EXTERNALSYM PdhConnectMachine}
  631. function PdhEnumMachinesA(szDataSource: LPCSTR; mszMachineList: LPSTR;
  632. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  633. {$EXTERNALSYM PdhEnumMachinesA}
  634. function PdhEnumMachinesW(szDataSource: LPCWSTR; mszMachineList: LPWSTR;
  635. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  636. {$EXTERNALSYM PdhEnumMachinesW}
  637. function PdhEnumMachines(szDataSource: LPCTSTR; mszMachineList: LPTSTR;
  638. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  639. {$EXTERNALSYM PdhEnumMachines}
  640. function PdhEnumObjectsA(szDataSource, szMachineName: LPCSTR; mszObjectList: LPSTR;
  641. var pcchBufferSize: DWORD; dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  642. {$EXTERNALSYM PdhEnumObjectsA}
  643. function PdhEnumObjectsW(szDataSource, szMachineName: LPCWSTR; mszObjectList: LPWSTR;
  644. var pcchBufferSize: DWORD; dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  645. {$EXTERNALSYM PdhEnumObjectsW}
  646. function PdhEnumObjects(szDataSource, szMachineName: LPCTSTR; mszObjectList: LPTSTR;
  647. var pcchBufferSize: DWORD; dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  648. {$EXTERNALSYM PdhEnumObjects}
  649. function PdhEnumObjectItemsA(szDataSource, szMachineName, szObjectName: LPCSTR;
  650. mszCounterList: LPSTR; var pcchCounterListLength: DWORD; mszInstanceList: LPSTR;
  651. var pcchInstanceListLength: DWORD; dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  652. {$EXTERNALSYM PdhEnumObjectItemsA}
  653. function PdhEnumObjectItemsW(szDataSource, szMachineName, szObjectName: LPCWSTR;
  654. mszCounterList: LPWSTR; var pcchCounterListLength: DWORD; mszInstanceList: LPWSTR;
  655. var pcchInstanceListLength: DWORD; dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  656. {$EXTERNALSYM PdhEnumObjectItemsW}
  657. function PdhEnumObjectItems(szDataSource, szMachineName, szObjectName: LPCTSTR;
  658. mszCounterList: LPTSTR; var pcchCounterListLength: DWORD; mszInstanceList: LPTSTR;
  659. var pcchInstanceListLength: DWORD; dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  660. {$EXTERNALSYM PdhEnumObjectItems}
  661. const
  662. PDH_OBJECT_HAS_INSTANCES = $00000001;
  663. {$EXTERNALSYM PDH_OBJECT_HAS_INSTANCES}
  664. function PdhMakeCounterPathA(pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_A;
  665. szFullPathBuffer: LPSTR; var pcchBufferSize: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  666. {$EXTERNALSYM PdhMakeCounterPathA}
  667. function PdhMakeCounterPathW(pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_W;
  668. szFullPathBuffer: LPWSTR; var pcchBufferSize: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  669. {$EXTERNALSYM PdhMakeCounterPathW}
  670. function PdhMakeCounterPath(pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS;
  671. szFullPathBuffer: LPTSTR; var pcchBufferSize: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  672. {$EXTERNALSYM PdhMakeCounterPath}
  673. function PdhParseCounterPathA(szFullPathBuffer: LPCSTR;
  674. pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_A; var pdwBufferSize: DWORD;
  675. dwFlags: DWORD): PDH_STATUS; stdcall;
  676. {$EXTERNALSYM PdhParseCounterPathA}
  677. function PdhParseCounterPathW(szFullPathBuffer: LPCWSTR;
  678. pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_W; var pdwBufferSize: DWORD;
  679. dwFlags: DWORD): PDH_STATUS; stdcall;
  680. {$EXTERNALSYM PdhParseCounterPathW}
  681. function PdhParseCounterPath(szFullPathBuffer: LPCTSTR;
  682. pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS; var pdwBufferSize: DWORD;
  683. dwFlags: DWORD): PDH_STATUS; stdcall;
  684. {$EXTERNALSYM PdhParseCounterPath}
  685. const
  686. PDH_PATH_WBEM_RESULT = DWORD($00000001);
  687. {$EXTERNALSYM PDH_PATH_WBEM_RESULT}
  688. PDH_PATH_WBEM_INPUT = DWORD($00000002);
  689. {$EXTERNALSYM PDH_PATH_WBEM_INPUT}
  690. function PDH_PATH_LANG_FLAGS(LangId, Flags: DWORD): DWORD;
  691. {$EXTERNALSYM PDH_PATH_LANG_FLAGS}
  692. function PdhParseInstanceNameA(szInstanceString: LPSTR; szInstanceName: LPCSTR;
  693. var pcchInstanceNameLength: DWORD; szParentName: LPSTR;
  694. var pcchParentNameLength: DWORD; lpIndex: LPDWORD): PDH_STATUS; stdcall;
  695. {$EXTERNALSYM PdhParseInstanceNameA}
  696. function PdhParseInstanceNameW(szInstanceString: LPWSTR; szInstanceName: LPCWSTR;
  697. var pcchInstanceNameLength: DWORD; szParentName: LPWSTR;
  698. var pcchParentNameLength: DWORD; lpIndex: LPDWORD): PDH_STATUS; stdcall;
  699. {$EXTERNALSYM PdhParseInstanceNameW}
  700. function PdhParseInstanceName(szInstanceString: LPTSTR; szInstanceName: LPCTSTR;
  701. var pcchInstanceNameLength: DWORD; szParentName: LPTSTR;
  702. var pcchParentNameLength: DWORD; lpIndex: LPDWORD): PDH_STATUS; stdcall;
  703. {$EXTERNALSYM PdhParseInstanceName}
  704. function PdhValidatePathA(szFullPathBuffer: LPCSTR): PDH_STATUS; stdcall;
  705. {$EXTERNALSYM PdhValidatePathA}
  706. function PdhValidatePathW(szFullPathBuffer: LPCWSTR): PDH_STATUS; stdcall;
  707. {$EXTERNALSYM PdhValidatePathW}
  708. function PdhValidatePath(szFullPathBuffer: LPCTSTR): PDH_STATUS; stdcall;
  709. {$EXTERNALSYM PdhValidatePath}
  710. function PdhGetDefaultPerfObjectA(szDataSource, szMachineName: LPCSTR;
  711. szDefaultObjectName: LPSTR; var pcchBufferSize: DWORD): PDH_STATUS; stdcall;
  712. {$EXTERNALSYM PdhGetDefaultPerfObjectA}
  713. function PdhGetDefaultPerfObjectW(szDataSource, szMachineName: LPCWSTR;
  714. szDefaultObjectName: LPWSTR; var pcchBufferSize: DWORD): PDH_STATUS; stdcall;
  715. {$EXTERNALSYM PdhGetDefaultPerfObjectW}
  716. function PdhGetDefaultPerfObject(szDataSource, szMachineName: LPCTSTR;
  717. szDefaultObjectName: LPTSTR; var pcchBufferSize: DWORD): PDH_STATUS; stdcall;
  718. {$EXTERNALSYM PdhGetDefaultPerfObject}
  719. function PdhGetDefaultPerfCounterA(szDataSource, szMachineName, szObjectName: LPCSTR;
  720. szDefaultCounterName: LPSTR; var pcchBufferSize: DWORD): PDH_STATUS; stdcall;
  721. {$EXTERNALSYM PdhGetDefaultPerfCounterA}
  722. function PdhGetDefaultPerfCounterW(szDataSource, szMachineName, szObjectName: LPCWSTR;
  723. szDefaultCounterName: LPWSTR; var pcchBufferSize: DWORD): PDH_STATUS; stdcall;
  724. {$EXTERNALSYM PdhGetDefaultPerfCounterW}
  725. function PdhGetDefaultPerfCounter(szDataSource, szMachineName, szObjectName: LPCTSTR;
  726. szDefaultCounterName: LPTSTR; var pcchBufferSize: DWORD): PDH_STATUS; stdcall;
  727. {$EXTERNALSYM PdhGetDefaultPerfCounter}
  728. type
  729. CounterPathCallBack = function(dwArg: DWORD_PTR): PDH_STATUS; stdcall;
  730. {$EXTERNALSYM CounterPathCallBack}
  731. const
  732. PDH_CF_INCLUDEINSTANCEINDEX = 1 shl 0;
  733. PDH_CF_SINGLECOUNTERPERADD = 1 shl 1;
  734. PDH_CF_SINGLECOUNTERPERDIALOG = 1 shl 2;
  735. PDH_CF_LOCALCOUNTERSONLY = 1 shl 3;
  736. PDH_CF_WILDCARDINSTANCES = 1 shl 4;
  737. PDH_CF_HIDEDETAILBOX = 1 shl 5;
  738. PDH_CF_INITIALIZEPATH = 1 shl 6;
  739. PDH_CF_DISABLEMACHINESELECTION = 1 shl 7;
  740. PDH_CF_INCLUDECOSTLYOBJECTS = 1 shl 8;
  741. PDH_CF_SHOWOBJECTBROWSER = 1 shl 9;
  742. PDH_CF_RESERVED = DWORD($FFFFFD00);
  743. type
  744. _BrowseDlgConfig_HW = record
  745. // Configuration flags
  746. dwConfigFlags: DWORD;
  747. hWndOwner: HWND;
  748. hDataSource: PDH_HLOG;
  749. szReturnPathBuffer: LPWSTR;
  750. cchReturnPathLength: DWORD;
  751. pCallBack: CounterPathCallBack;
  752. dwCallBackArg: DWORD_PTR;
  753. CallBackStatus: PDH_STATUS;
  754. dwDefaultDetailLevel: DWORD;
  755. szDialogBoxCaption: LPWSTR;
  756. end;
  757. {$EXTERNALSYM _BrowseDlgConfig_HW}
  758. PDH_BROWSE_DLG_CONFIG_HW = _BrowseDlgConfig_HW;
  759. {$EXTERNALSYM PDH_BROWSE_DLG_CONFIG_HW}
  760. PPDH_BROWSE_DLG_CONFIG_HW = ^PDH_BROWSE_DLG_CONFIG_HW;
  761. {$EXTERNALSYM PPDH_BROWSE_DLG_CONFIG_HW}
  762. TPdhBrowseDlgConfigHW = PDH_BROWSE_DLG_CONFIG_HW;
  763. PPdhBrowseDlgConfigHW = PPDH_BROWSE_DLG_CONFIG_HW;
  764. _BrowseDlgConfig_HA = record
  765. // Configuration flags
  766. dwConfigFlags: DWORD;
  767. hWndOwner: HWND;
  768. hDataSource: PDH_HLOG;
  769. szReturnPathBuffer: LPSTR;
  770. cchReturnPathLength: DWORD;
  771. pCallBack: CounterPathCallBack;
  772. dwCallBackArg: DWORD_PTR;
  773. CallBackStatus: PDH_STATUS;
  774. dwDefaultDetailLevel: DWORD;
  775. szDialogBoxCaption: LPSTR;
  776. end;
  777. {$EXTERNALSYM _BrowseDlgConfig_HA}
  778. PDH_BROWSE_DLG_CONFIG_HA = _BrowseDlgConfig_HA;
  779. {$EXTERNALSYM PDH_BROWSE_DLG_CONFIG_HA}
  780. PPDH_BROWSE_DLG_CONFIG_HA = ^PDH_BROWSE_DLG_CONFIG_HA;
  781. {$EXTERNALSYM PPDH_BROWSE_DLG_CONFIG_HA}
  782. TPdhBrowseDlgConfigHA = PDH_BROWSE_DLG_CONFIG_HA;
  783. PPdhBrowseDlgConfigHA = PPDH_BROWSE_DLG_CONFIG_HA;
  784. {$IFDEF UNICODE}
  785. PDH_BROWSE_DLG_CONFIG_H = PDH_BROWSE_DLG_CONFIG_HW;
  786. PPDH_BROWSE_DLG_CONFIG_H = PPDH_BROWSE_DLG_CONFIG_HW;
  787. {$ELSE}
  788. PDH_BROWSE_DLG_CONFIG_H = PDH_BROWSE_DLG_CONFIG_HA;
  789. PPDH_BROWSE_DLG_CONFIG_H = PPDH_BROWSE_DLG_CONFIG_HA;
  790. {$ENDIF UNICODE}
  791. PPDH_BROWSE_DLG_CONFIG_A = ^_BrowseDlgConfig_A;
  792. {$EXTERNALSYM PPDH_BROWSE_DLG_CONFIG_A}
  793. _BrowseDlgConfig_A = record
  794. dwConfigFlags: DWORD;
  795. hWndOwner: HWND;
  796. szDataSource: LPSTR;
  797. szReturnPathBuffer: LPSTR;
  798. cchReturnPathLength: DWORD;
  799. pCallBack: CounterPathCallBack;
  800. dwCallBackArg: DWORD_PTR;
  801. CallBackStatus: PDH_STATUS;
  802. dwDefaultDetailLevel: DWORD;
  803. szDialogBoxCaption: LPSTR;
  804. end;
  805. {$EXTERNALSYM _BrowseDlgConfig_A}
  806. PDH_BROWSE_DLG_CONFIG_A = _BrowseDlgConfig_A;
  807. {$EXTERNALSYM PDH_BROWSE_DLG_CONFIG_A}
  808. TPdhBrowseDlgConfigA = PDH_BROWSE_DLG_CONFIG_A;
  809. PPdhBrowseDlgConfigA = PPDH_BROWSE_DLG_CONFIG_A;
  810. PPDH_BROWSE_DLG_CONFIG_W = ^_BrowseDlgConfig_W;
  811. {$EXTERNALSYM PPDH_BROWSE_DLG_CONFIG_W}
  812. _BrowseDlgConfig_W = record
  813. dwConfigFlags: DWORD;
  814. hWndOwner: HWND;
  815. szDataSource: LPWSTR;
  816. szReturnPathBuffer: LPWSTR;
  817. cchReturnPathLength: DWORD;
  818. pCallBack: CounterPathCallBack;
  819. dwCallBackArg: DWORD_PTR;
  820. CallBackStatus: PDH_STATUS;
  821. dwDefaultDetailLevel: DWORD;
  822. szDialogBoxCaption: LPWSTR;
  823. end;
  824. {$EXTERNALSYM _BrowseDlgConfig_W}
  825. PDH_BROWSE_DLG_CONFIG_W = _BrowseDlgConfig_W;
  826. {$EXTERNALSYM PDH_BROWSE_DLG_CONFIG_W}
  827. TPdhBrowseDlgConfigW = PDH_BROWSE_DLG_CONFIG_W;
  828. PPdhBrowseDlgConfigW = PPDH_BROWSE_DLG_CONFIG_W;
  829. {$IFDEF UNICODE}
  830. PPdhBrowseDlgConfig = PPdhBrowseDlgConfigW;
  831. PDH_BROWSE_DLG_CONFIG = PDH_BROWSE_DLG_CONFIG_W;
  832. {$EXTERNALSYM PDH_BROWSE_DLG_CONFIG}
  833. PPDH_BROWSE_DLG_CONFIG = PPDH_BROWSE_DLG_CONFIG_W;
  834. {$EXTERNALSYM PPDH_BROWSE_DLG_CONFIG}
  835. TPdhBrowseDlgConfig = TPdhBrowseDlgConfigW;
  836. {$ELSE}
  837. PPdhBrowseDlgConfig = PPdhBrowseDlgConfigA;
  838. PDH_BROWSE_DLG_CONFIG = PDH_BROWSE_DLG_CONFIG_A;
  839. {$EXTERNALSYM PDH_BROWSE_DLG_CONFIG}
  840. PPDH_BROWSE_DLG_CONFIG = PPDH_BROWSE_DLG_CONFIG_A;
  841. {$EXTERNALSYM PPDH_BROWSE_DLG_CONFIG}
  842. TPdhBrowseDlgConfig = TPdhBrowseDlgConfigA;
  843. {$ENDIF UNICODE}
  844. function PdhBrowseCountersA(const pBrowseDlgData: PDH_BROWSE_DLG_CONFIG_A): PDH_STATUS; stdcall;
  845. {$EXTERNALSYM PdhBrowseCountersA}
  846. function PdhBrowseCountersW(const pBrowseDlgData: PDH_BROWSE_DLG_CONFIG_W): PDH_STATUS; stdcall;
  847. {$EXTERNALSYM PdhBrowseCountersW}
  848. function PdhBrowseCounters(const pBrowseDlgData: PDH_BROWSE_DLG_CONFIG): PDH_STATUS; stdcall;
  849. {$EXTERNALSYM PdhBrowseCounters}
  850. function PdhExpandCounterPathA(szWildCardPath: LPCSTR; mszExpandedPathList: LPSTR;
  851. var pcchPathListLength: DWORD): PDH_STATUS; stdcall;
  852. {$EXTERNALSYM PdhExpandCounterPathA}
  853. function PdhExpandCounterPathW(szWildCardPath: LPCWSTR; mszExpandedPathList: LPWSTR;
  854. var pcchPathListLength: DWORD): PDH_STATUS; stdcall;
  855. {$EXTERNALSYM PdhExpandCounterPathW}
  856. function PdhExpandCounterPath(szWildCardPath: LPCTSTR; mszExpandedPathList: LPTSTR;
  857. var pcchPathListLength: DWORD): PDH_STATUS; stdcall;
  858. {$EXTERNALSYM PdhExpandCounterPath}
  859. //
  860. // v2.0 functions
  861. //
  862. function PdhLookupPerfNameByIndexA(szMachineName: LPCSTR; dwNameIndex: DWORD;
  863. szNameBuffer: LPSTR; var pcchNameBufferSize: DWORD): PDH_STATUS; stdcall;
  864. {$EXTERNALSYM PdhLookupPerfNameByIndexA}
  865. function PdhLookupPerfNameByIndexW(szMachineName: LPCWSTR; dwNameIndex: DWORD;
  866. szNameBuffer: LPWSTR; var pcchNameBufferSize: DWORD): PDH_STATUS; stdcall;
  867. {$EXTERNALSYM PdhLookupPerfNameByIndexW}
  868. function PdhLookupPerfNameByIndex(szMachineName: LPCTSTR; dwNameIndex: DWORD;
  869. szNameBuffer: LPTSTR; var pcchNameBufferSize: DWORD): PDH_STATUS; stdcall;
  870. {$EXTERNALSYM PdhLookupPerfNameByIndex}
  871. function PdhLookupPerfIndexByNameA(szMachineName, szNameBuffer: LPCSTR;
  872. var pdwIndex: DWORD): PDH_STATUS; stdcall;
  873. {$EXTERNALSYM PdhLookupPerfIndexByNameA}
  874. function PdhLookupPerfIndexByNameW(szMachineName, szNameBuffer: LPCWSTR;
  875. var pdwIndex: DWORD): PDH_STATUS; stdcall;
  876. {$EXTERNALSYM PdhLookupPerfIndexByNameW}
  877. function PdhLookupPerfIndexByName(szMachineName, szNameBuffer: LPCTSTR;
  878. var pdwIndex: DWORD): PDH_STATUS; stdcall;
  879. {$EXTERNALSYM PdhLookupPerfIndexByName}
  880. const
  881. PDH_NOEXPANDCOUNTERS = 1;
  882. {$EXTERNALSYM PDH_NOEXPANDCOUNTERS}
  883. PDH_NOEXPANDINSTANCES = 2;
  884. {$EXTERNALSYM PDH_NOEXPANDINSTANCES}
  885. PDH_REFRESHCOUNTERS = 4;
  886. {$EXTERNALSYM PDH_REFRESHCOUNTERS}
  887. function PdhExpandWildCardPathA(szDataSource, szWildCardPath: LPCSTR;
  888. mszExpandedPathList: LPSTR; var pcchPathListLength: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  889. {$EXTERNALSYM PdhExpandWildCardPathA}
  890. function PdhExpandWildCardPathW(szDataSource, szWildCardPath: LPCWSTR;
  891. mszExpandedPathList: LPWSTR; var pcchPathListLength: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  892. {$EXTERNALSYM PdhExpandWildCardPathW}
  893. function PdhExpandWildCardPath(szDataSource, szWildCardPath: LPCTSTR;
  894. mszExpandedPathList: LPTSTR; var pcchPathListLength: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  895. {$EXTERNALSYM PdhExpandWildCardPath}
  896. //
  897. // Logging Functions
  898. //
  899. const
  900. PDH_LOG_READ_ACCESS = DWORD($00010000);
  901. {$EXTERNALSYM PDH_LOG_READ_ACCESS}
  902. PDH_LOG_WRITE_ACCESS = DWORD($00020000);
  903. {$EXTERNALSYM PDH_LOG_WRITE_ACCESS}
  904. PDH_LOG_UPDATE_ACCESS = DWORD($00040000);
  905. {$EXTERNALSYM PDH_LOG_UPDATE_ACCESS}
  906. PDH_LOG_ACCESS_MASK = DWORD($000F0000);
  907. {$EXTERNALSYM PDH_LOG_ACCESS_MASK}
  908. PDH_LOG_CREATE_NEW = DWORD($00000001);
  909. {$EXTERNALSYM PDH_LOG_CREATE_NEW}
  910. PDH_LOG_CREATE_ALWAYS = DWORD($00000002);
  911. {$EXTERNALSYM PDH_LOG_CREATE_ALWAYS}
  912. PDH_LOG_OPEN_ALWAYS = DWORD($00000003);
  913. {$EXTERNALSYM PDH_LOG_OPEN_ALWAYS}
  914. PDH_LOG_OPEN_EXISTING = DWORD($00000004);
  915. {$EXTERNALSYM PDH_LOG_OPEN_EXISTING}
  916. PDH_LOG_CREATE_MASK = DWORD($0000000F);
  917. {$EXTERNALSYM PDH_LOG_CREATE_MASK}
  918. PDH_LOG_OPT_USER_STRING = DWORD($01000000);
  919. {$EXTERNALSYM PDH_LOG_OPT_USER_STRING}
  920. PDH_LOG_OPT_CIRCULAR = DWORD($02000000);
  921. {$EXTERNALSYM PDH_LOG_OPT_CIRCULAR}
  922. PDH_LOG_OPT_MAX_IS_BYTES = DWORD($04000000);
  923. {$EXTERNALSYM PDH_LOG_OPT_MAX_IS_BYTES}
  924. PDH_LOG_OPT_APPEND = DWORD($08000000);
  925. {$EXTERNALSYM PDH_LOG_OPT_APPEND}
  926. PDH_LOG_OPT_MASK = DWORD($0F000000);
  927. {$EXTERNALSYM PDH_LOG_OPT_MASK}
  928. PDH_LOG_TYPE_UNDEFINED = 0;
  929. {$EXTERNALSYM PDH_LOG_TYPE_UNDEFINED}
  930. PDH_LOG_TYPE_CSV = 1;
  931. {$EXTERNALSYM PDH_LOG_TYPE_CSV}
  932. PDH_LOG_TYPE_TSV = 2;
  933. {$EXTERNALSYM PDH_LOG_TYPE_TSV}
  934. //PDH_LOG_TYPE_BINARY = 3; // this is the retired binary format
  935. //{$EXTERNALSYM PDH_LOG_TYPE_BINARY}
  936. PDH_LOG_TYPE_TRACE_KERNEL = 4;
  937. {$EXTERNALSYM PDH_LOG_TYPE_TRACE_KERNEL}
  938. PDH_LOG_TYPE_TRACE_GENERIC = 5;
  939. {$EXTERNALSYM PDH_LOG_TYPE_TRACE_GENERIC}
  940. PDH_LOG_TYPE_PERFMON = 6;
  941. {$EXTERNALSYM PDH_LOG_TYPE_PERFMON}
  942. PDH_LOG_TYPE_SQL = 7;
  943. {$EXTERNALSYM PDH_LOG_TYPE_SQL}
  944. PDH_LOG_TYPE_BINARY = 8;
  945. {$EXTERNALSYM PDH_LOG_TYPE_BINARY}
  946. function PdhOpenLogA(szLogFileName: LPCSTR; dwAccessFlags: DWORD;
  947. lpdwLogType: LPDWORD; hQuery: PDH_HQUERY; dwMaxRecords: DWORD;
  948. szUserCaption: LPCSTR; var phLog: PDH_HLOG): PDH_STATUS; stdcall;
  949. {$EXTERNALSYM PdhOpenLogA}
  950. function PdhOpenLogW(szLogFileName: LPCWSTR; dwAccessFlags: DWORD;
  951. lpdwLogType: LPDWORD; hQuery: PDH_HQUERY; dwMaxRecords: DWORD;
  952. szUserCaption: LPCWSTR; var phLog: PDH_HLOG): PDH_STATUS; stdcall;
  953. {$EXTERNALSYM PdhOpenLogW}
  954. function PdhOpenLog(szLogFileName: LPCTSTR; dwAccessFlags: DWORD;
  955. lpdwLogType: LPDWORD; hQuery: PDH_HQUERY; dwMaxRecords: DWORD;
  956. szUserCaption: LPCTSTR; var phLog: PDH_HLOG): PDH_STATUS; stdcall;
  957. {$EXTERNALSYM PdhOpenLog}
  958. function PdhUpdateLogA(hLog: PDH_HLOG; szUserString: LPCSTR): PDH_STATUS; stdcall;
  959. {$EXTERNALSYM PdhUpdateLogA}
  960. function PdhUpdateLogW(hLog: PDH_HLOG; szUserString: LPCWSTR): PDH_STATUS; stdcall;
  961. {$EXTERNALSYM PdhUpdateLogW}
  962. function PdhUpdateLog(hLog: PDH_HLOG; szUserString: LPCTSTR): PDH_STATUS; stdcall;
  963. {$EXTERNALSYM PdhUpdateLog}
  964. function PdhUpdateLogFileCatalog(hLog: PDH_HLOG): PDH_STATUS; stdcall;
  965. {$EXTERNALSYM PdhUpdateLogFileCatalog}
  966. function PdhGetLogFileSize(hLog: PDH_HLOG; var llSize: LONGLONG): PDH_STATUS; stdcall;
  967. {$EXTERNALSYM PdhGetLogFileSize}
  968. function PdhCloseLog(hLog: PDH_HLOG; dwFlags: DWORD): PDH_STATUS; stdcall;
  969. {$EXTERNALSYM PdhCloseLog}
  970. const
  971. PDH_FLAGS_CLOSE_QUERY = DWORD($00000001);
  972. {$EXTERNALSYM PDH_FLAGS_CLOSE_QUERY}
  973. //
  974. // Data source selection dialog
  975. //
  976. const
  977. PDH_FLAGS_FILE_BROWSER_ONLY = DWORD($00000001);
  978. {$EXTERNALSYM PDH_FLAGS_FILE_BROWSER_ONLY}
  979. function PdhSelectDataSourceA(hWndOwner: HWND; dwFlags: DWORD;
  980. szDataSource: LPSTR; var pcchBufferLength: DWORD): PDH_STATUS; stdcall;
  981. {$EXTERNALSYM PdhSelectDataSourceA}
  982. function PdhSelectDataSourceW(hWndOwner: HWND; dwFlags: DWORD;
  983. szDataSource: LPWSTR; var pcchBufferLength: DWORD): PDH_STATUS; stdcall;
  984. {$EXTERNALSYM PdhSelectDataSourceW}
  985. function PdhSelectDataSource(hWndOwner: HWND; dwFlags: DWORD;
  986. szDataSource: LPTSTR; var pcchBufferLength: DWORD): PDH_STATUS; stdcall;
  987. {$EXTERNALSYM PdhSelectDataSource}
  988. function PdhIsRealTimeQuery(hQuery: PDH_HQUERY): BOOL; stdcall;
  989. {$EXTERNALSYM PdhIsRealTimeQuery}
  990. function PdhSetQueryTimeRange(hQuery: PDH_HQUERY; var pInfo: PDH_TIME_INFO): PDH_STATUS; stdcall;
  991. {$EXTERNALSYM PdhSetQueryTimeRange}
  992. function PdhGetDataSourceTimeRangeA(szDataSource: LPCSTR; var pdwNumEntries: DWORD;
  993. var pInfo: PDH_TIME_INFO; pdwBufferSize: LPDWORD): PDH_STATUS; stdcall;
  994. {$EXTERNALSYM PdhGetDataSourceTimeRangeA}
  995. function PdhGetDataSourceTimeRangeW(szDataSource: LPCWSTR; var pdwNumEntries: DWORD;
  996. var pInfo: PDH_TIME_INFO; pdwBufferSize: LPDWORD): PDH_STATUS; stdcall;
  997. {$EXTERNALSYM PdhGetDataSourceTimeRangeW}
  998. function PdhGetDataSourceTimeRange(szDataSource: LPCTSTR; var pdwNumEntries: DWORD;
  999. var pInfo: PDH_TIME_INFO; pdwBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1000. {$EXTERNALSYM PdhGetDataSourceTimeRange}
  1001. function PdhCollectQueryDataEx(hQuery: PDH_HQUERY; dwIntervalTime: DWORD;
  1002. hNewDataEvent: HANDLE): PDH_STATUS; stdcall;
  1003. {$EXTERNALSYM PdhCollectQueryDataEx}
  1004. function PdhFormatFromRawValue(dwCounterType, dwFormat: DWORD;
  1005. var pTimeBase: LONGLONG; pRawValue1, pRawValue2: PPDH_RAW_COUNTER;
  1006. var pFmtValue: PDH_FMT_COUNTERVALUE): PDH_STATUS; stdcall;
  1007. {$EXTERNALSYM PdhFormatFromRawValue}
  1008. function PdhGetCounterTimeBase(hCounter: PDH_HCOUNTER; var pTimeBase: LONGLONG): PDH_STATUS; stdcall;
  1009. {$EXTERNALSYM PdhGetCounterTimeBase}
  1010. function PdhReadRawLogRecord(hLog: PDH_HLOG; ftRecord: FILETIME;
  1011. var pRawLogRecord: PDH_RAW_LOG_RECORD; pdwBufferLength: LPDWORD): PDH_STATUS; stdcall;
  1012. {$EXTERNALSYM PdhReadRawLogRecord}
  1013. const
  1014. DATA_SOURCE_REGISTRY = DWORD($00000001);
  1015. {$EXTERNALSYM DATA_SOURCE_REGISTRY}
  1016. DATA_SOURCE_LOGFILE = DWORD($00000002);
  1017. {$EXTERNALSYM DATA_SOURCE_LOGFILE}
  1018. DATA_SOURCE_WBEM = DWORD($00000004);
  1019. {$EXTERNALSYM DATA_SOURCE_WBEM}
  1020. function PdhSetDefaultRealTimeDataSource(dwDataSourceId: DWORD): PDH_STATUS; stdcall;
  1021. {$EXTERNALSYM PdhSetDefaultRealTimeDataSource}
  1022. // Extended API for WMI event trace logfile format
  1023. //
  1024. function PdhBindInputDataSourceW(var phDataSource: PDH_HLOG; LogFileNameList: LPCWSTR): PDH_STATUS; stdcall;
  1025. {$EXTERNALSYM PdhBindInputDataSourceW}
  1026. function PdhBindInputDataSourceA(var phDataSource: PDH_HLOG; LogFileNameList: LPCSTR): PDH_STATUS; stdcall;
  1027. {$EXTERNALSYM PdhBindInputDataSourceA}
  1028. function PdhBindInputDataSource(var phDataSource: PDH_HLOG; LogFileNameList: LPCTSTR): PDH_STATUS; stdcall;
  1029. {$EXTERNALSYM PdhBindInputDataSource}
  1030. function PdhOpenQueryH(hDataSource: PDH_HLOG; dwUserData: DWORD_PTR; var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  1031. {$EXTERNALSYM PdhOpenQueryH}
  1032. function PdhEnumMachinesHW(hDataSource: PDH_HLOG; mszMachineList: LPWSTR; pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1033. {$EXTERNALSYM PdhEnumMachinesHW}
  1034. function PdhEnumMachinesHA(hDataSource: PDH_HLOG; mszMachineList: LPSTR; pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1035. {$EXTERNALSYM PdhEnumMachinesHA}
  1036. function PdhEnumMachinesH(hDataSource: PDH_HLOG; mszMachineList: LPTSTR; pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1037. {$EXTERNALSYM PdhEnumMachinesH}
  1038. function PdhEnumObjectsHA(hDataSource: PDH_HLOG; szMachineName: LPCSTR; mszObjectList: LPSTR; pcchBufferSize: LPDWORD;
  1039. dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  1040. {$EXTERNALSYM PdhEnumObjectsHA}
  1041. function PdhEnumObjectsHW(hDataSource: PDH_HLOG; szMachineName: LPCWSTR; mszObjectList: LPWSTR; pcchBufferSize: LPDWORD;
  1042. dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  1043. {$EXTERNALSYM PdhEnumObjectsHW}
  1044. function PdhEnumObjectsH(hDataSource: PDH_HLOG; szMachineName: LPCTSTR; mszObjectList: LPWSTR; pcchBufferSize: LPDWORD;
  1045. dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  1046. {$EXTERNALSYM PdhEnumObjectsH}
  1047. function PdhEnumObjectItemsHA(hDataSource: PDH_HLOG; szMachineName, szObjectName: LPCSTR; mszCounterList: LPSTR;
  1048. pcchCounterListLength: LPDWORD; mszInstanceList: LPSTR; pcchInstanceListLength: LPDWORD;
  1049. dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  1050. {$EXTERNALSYM PdhEnumObjectItemsHA}
  1051. function PdhEnumObjectItemsHW(hDataSource: PDH_HLOG; szMachineName, szObjectName: LPCWSTR; mszCounterList: LPWSTR;
  1052. pcchCounterListLength: LPDWORD; mszInstanceList: LPWSTR; pcchInstanceListLength: LPDWORD;
  1053. dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  1054. {$EXTERNALSYM PdhEnumObjectItemsHW}
  1055. function PdhEnumObjectItemsH(hDataSource: PDH_HLOG; szMachineName, szObjectName: LPCTSTR; mszCounterList: LPTSTR;
  1056. pcchCounterListLength: LPDWORD; mszInstanceList: LPTSTR; pcchInstanceListLength: LPDWORD;
  1057. dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  1058. {$EXTERNALSYM PdhEnumObjectItemsH}
  1059. function PdhExpandWildCardPathHA(hDataSource: PDH_HLOG; szWildCardPath: LPCSTR; mszExpandedPathList: LPSTR;
  1060. pcchPathListLength: LPDWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  1061. {$EXTERNALSYM PdhExpandWildCardPathHA}
  1062. function PdhExpandWildCardPathHW(hDataSource: PDH_HLOG; szWildCardPath: LPCWSTR; mszExpandedPathList: LPWSTR;
  1063. pcchPathListLength: LPDWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  1064. {$EXTERNALSYM PdhExpandWildCardPathHW}
  1065. function PdhExpandWildCardPathH(hDataSource: PDH_HLOG; szWildCardPath: LPCTSTR; mszExpandedPathList: LPTSTR;
  1066. pcchPathListLength: LPDWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  1067. {$EXTERNALSYM PdhExpandWildCardPathH}
  1068. function PdhGetDataSourceTimeRangeH(hDataSource: PDH_HLOG; pdwNumEntries: LPDWORD; pInfo: PPDH_TIME_INFO;
  1069. pdwBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1070. {$EXTERNALSYM PdhGetDataSourceTimeRangeH}
  1071. function PdhGetDefaultPerfObjectHW(hDataSource: PDH_HLOG; szMachineName: LPCWSTR; szDefaultObjectName: LPWSTR;
  1072. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1073. {$EXTERNALSYM PdhGetDefaultPerfObjectHW}
  1074. function PdhGetDefaultPerfObjectHA(hDataSource: PDH_HLOG; szMachineName: LPCSTR; szDefaultObjectName: LPSTR;
  1075. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1076. {$EXTERNALSYM PdhGetDefaultPerfObjectHA}
  1077. function PdhGetDefaultPerfObjectH(hDataSource: PDH_HLOG; szMachineName: LPCTSTR; szDefaultObjectName: LPTSTR;
  1078. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1079. {$EXTERNALSYM PdhGetDefaultPerfObjectH}
  1080. function PdhGetDefaultPerfCounterHW(hDataSource: PDH_HLOG; szMachineName, szObjectName: LPCWSTR;
  1081. szDefaultCounterName: LPWSTR; pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1082. {$EXTERNALSYM PdhGetDefaultPerfCounterHW}
  1083. function PdhGetDefaultPerfCounterHA(hDataSource: PDH_HLOG; szMachineName, szObjectName: LPCSTR;
  1084. szDefaultCounterName: LPSTR; pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1085. {$EXTERNALSYM PdhGetDefaultPerfCounterHA}
  1086. function PdhGetDefaultPerfCounterH(hDataSource: PDH_HLOG; szMachineName, szObjectName: LPCTSTR;
  1087. szDefaultCounterName: LPTSTR; pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  1088. {$EXTERNALSYM PdhGetDefaultPerfCounterH}
  1089. function PdhBrowseCountersHW(const pBrowseDlgData: PDH_BROWSE_DLG_CONFIG_HW): PDH_STATUS; stdcall;
  1090. {$EXTERNALSYM PdhBrowseCountersHW}
  1091. function PdhBrowseCountersHA(const pBrowseDlgData: PDH_BROWSE_DLG_CONFIG_HA): PDH_STATUS; stdcall;
  1092. {$EXTERNALSYM PdhBrowseCountersHA}
  1093. function PdhBrowseCountersH(const pBrowseDlgData: PDH_BROWSE_DLG_CONFIG_H): PDH_STATUS; stdcall;
  1094. {$EXTERNALSYM PdhBrowseCountersH}
  1095. //Check that a DSN points to a database that contains the correct Perfmon tables.
  1096. function PdhVerifySQLDBW(szDataSource: LPCWSTR): PDH_STATUS; stdcall;
  1097. {$EXTERNALSYM PdhVerifySQLDBW}
  1098. function PdhVerifySQLDBA(szDataSource: LPCSTR): PDH_STATUS; stdcall;
  1099. {$EXTERNALSYM PdhVerifySQLDBA}
  1100. function PdhVerifySQLDB(szDataSource: LPCTSTR): PDH_STATUS; stdcall;
  1101. {$EXTERNALSYM PdhVerifySQLDB}
  1102. //Create the correct perfmon tables in the database pointed to by a DSN.
  1103. function PdhCreateSQLTablesW(szDataSource: LPCWSTR): PDH_STATUS; stdcall;
  1104. {$EXTERNALSYM PdhCreateSQLTablesW}
  1105. function PdhCreateSQLTablesA(szDataSource: LPCSTR): PDH_STATUS; stdcall;
  1106. {$EXTERNALSYM PdhCreateSQLTablesA}
  1107. function PdhCreateSQLTables(szDataSource: LPCTSTR): PDH_STATUS; stdcall;
  1108. {$EXTERNALSYM PdhCreateSQLTables}
  1109. //Return the list of Log set names in the database pointed to by the DSN.
  1110. function PdhEnumLogSetNamesW(szDataSource: LPCWSTR; mszDataSetNameList: LPWSTR; pcchBufferLength: LPDWORD): PDH_STATUS; stdcall;
  1111. {$EXTERNALSYM PdhEnumLogSetNamesW}
  1112. function PdhEnumLogSetNamesA(szDataSource: LPCSTR; mszDataSetNameList: LPSTR; pcchBufferLength: LPDWORD): PDH_STATUS; stdcall;
  1113. {$EXTERNALSYM PdhEnumLogSetNamesA}
  1114. function PdhEnumLogSetNames(szDataSource: LPCTSTR; mszDataSetNameList: LPTSTR; pcchBufferLength: LPDWORD): PDH_STATUS; stdcall;
  1115. {$EXTERNALSYM PdhEnumLogSetNames}
  1116. //Retrieve the GUID for an open Log Set
  1117. function PdhGetLogSetGUID(hLog: PDH_HLOG; pGuid: LPGUID; pRunId: LPINT): PDH_STATUS; stdcall;
  1118. {$EXTERNALSYM PdhGetLogSetGUID}
  1119. //Set the RunID for an open Log Set
  1120. function PdhSetLogSetRunID(hLog: PDH_HLOG; RunId: Integer): PDH_STATUS; stdcall;
  1121. {$EXTERNALSYM PdhSetLogSetRunID}
  1122. implementation
  1123. uses
  1124. JwaWinDLLNames;
  1125. function IsSuccessSeverity(ErrorCode: Longint): Boolean;
  1126. begin
  1127. Result := (ErrorCode and $C0000000) = $00000000;
  1128. end;
  1129. function IsInformationalSeverity(ErrorCode: Longint): Boolean;
  1130. begin
  1131. Result := (ErrorCode and $C0000000) = $40000000;
  1132. end;
  1133. function IsWarningSeverity(ErrorCode: Longint): Boolean;
  1134. begin
  1135. Result := (ErrorCode and $C0000000) = $80000000;
  1136. end;
  1137. function IsErrorSeverity(ErrorCode: Longint): Boolean;
  1138. begin
  1139. Result := (ErrorCode and $C0000000) = $C0000000;
  1140. end;
  1141. function PDH_PATH_LANG_FLAGS(LangId, Flags: DWORD): DWORD;
  1142. begin
  1143. Result := DWORD(((LangId and $0000FFFF) shl 16) or (Flags and $0000FFFF));
  1144. end;
  1145. {$IFDEF DYNAMIC_LINK}
  1146. var
  1147. _PdhGetDllVersion: Pointer;
  1148. function PdhGetDllVersion;
  1149. begin
  1150. GetProcedureAddress(_PdhGetDllVersion, PdhLib, 'PdhGetDllVersion');
  1151. asm
  1152. MOV ESP, EBP
  1153. POP EBP
  1154. JMP [_PdhGetDllVersion]
  1155. end;
  1156. end;
  1157. var
  1158. _PdhOpenQueryA: Pointer;
  1159. function PdhOpenQueryA;
  1160. begin
  1161. GetProcedureAddress(_PdhOpenQueryA, PdhLib, 'PdhOpenQueryA');
  1162. asm
  1163. MOV ESP, EBP
  1164. POP EBP
  1165. JMP [_PdhOpenQueryA]
  1166. end;
  1167. end;
  1168. var
  1169. _PdhOpenQueryW: Pointer;
  1170. function PdhOpenQueryW;
  1171. begin
  1172. GetProcedureAddress(_PdhOpenQueryW, PdhLib, 'PdhOpenQueryW');
  1173. asm
  1174. MOV ESP, EBP
  1175. POP EBP
  1176. JMP [_PdhOpenQueryW]
  1177. end;
  1178. end;
  1179. var
  1180. _PdhOpenQuery: Pointer;
  1181. function PdhOpenQuery;
  1182. begin
  1183. GetProcedureAddress(_PdhOpenQuery, PdhLib, 'PdhOpenQuery' + AWSuffix);
  1184. asm
  1185. MOV ESP, EBP
  1186. POP EBP
  1187. JMP [_PdhOpenQuery]
  1188. end;
  1189. end;
  1190. var
  1191. _PdhAddCounterA: Pointer;
  1192. function PdhAddCounterA;
  1193. begin
  1194. GetProcedureAddress(_PdhAddCounterA, PdhLib, 'PdhAddCounterA');
  1195. asm
  1196. MOV ESP, EBP
  1197. POP EBP
  1198. JMP [_PdhAddCounterA]
  1199. end;
  1200. end;
  1201. var
  1202. _PdhAddCounterW: Pointer;
  1203. function PdhAddCounterW;
  1204. begin
  1205. GetProcedureAddress(_PdhAddCounterW, PdhLib, 'PdhAddCounterW');
  1206. asm
  1207. MOV ESP, EBP
  1208. POP EBP
  1209. JMP [_PdhAddCounterW]
  1210. end;
  1211. end;
  1212. var
  1213. _PdhAddCounter: Pointer;
  1214. function PdhAddCounter;
  1215. begin
  1216. GetProcedureAddress(_PdhAddCounter, PdhLib, 'PdhAddCounter' + AWSuffix);
  1217. asm
  1218. MOV ESP, EBP
  1219. POP EBP
  1220. JMP [_PdhAddCounter]
  1221. end;
  1222. end;
  1223. var
  1224. _PdhRemoveCounter: Pointer;
  1225. function PdhRemoveCounter;
  1226. begin
  1227. GetProcedureAddress(_PdhRemoveCounter, PdhLib, 'PdhRemoveCounter');
  1228. asm
  1229. MOV ESP, EBP
  1230. POP EBP
  1231. JMP [_PdhRemoveCounter]
  1232. end;
  1233. end;
  1234. var
  1235. _PdhCollectQueryData: Pointer;
  1236. function PdhCollectQueryData;
  1237. begin
  1238. GetProcedureAddress(_PdhCollectQueryData, PdhLib, 'PdhCollectQueryData');
  1239. asm
  1240. MOV ESP, EBP
  1241. POP EBP
  1242. JMP [_PdhCollectQueryData]
  1243. end;
  1244. end;
  1245. var
  1246. _PdhCloseQuery: Pointer;
  1247. function PdhCloseQuery;
  1248. begin
  1249. GetProcedureAddress(_PdhCloseQuery, PdhLib, 'PdhCloseQuery');
  1250. asm
  1251. MOV ESP, EBP
  1252. POP EBP
  1253. JMP [_PdhCloseQuery]
  1254. end;
  1255. end;
  1256. var
  1257. _PdhGetFormattedCounterValue: Pointer;
  1258. function PdhGetFormattedCounterValue;
  1259. begin
  1260. GetProcedureAddress(_PdhGetFormattedCounterValue, PdhLib, 'PdhGetFormattedCounterValue');
  1261. asm
  1262. MOV ESP, EBP
  1263. POP EBP
  1264. JMP [_PdhGetFormattedCounterValue]
  1265. end;
  1266. end;
  1267. var
  1268. _PdhGetFormattedCounterArrayA: Pointer;
  1269. function PdhGetFormattedCounterArrayA;
  1270. begin
  1271. GetProcedureAddress(_PdhGetFormattedCounterArrayA, PdhLib, 'PdhGetFormattedCounterArrayA');
  1272. asm
  1273. MOV ESP, EBP
  1274. POP EBP
  1275. JMP [_PdhGetFormattedCounterArrayA]
  1276. end;
  1277. end;
  1278. var
  1279. _PdhGetFormattedCounterArrayW: Pointer;
  1280. function PdhGetFormattedCounterArrayW;
  1281. begin
  1282. GetProcedureAddress(_PdhGetFormattedCounterArrayW, PdhLib, 'PdhGetFormattedCounterArrayW');
  1283. asm
  1284. MOV ESP, EBP
  1285. POP EBP
  1286. JMP [_PdhGetFormattedCounterArrayW]
  1287. end;
  1288. end;
  1289. var
  1290. _PdhGetFormattedCounterArray: Pointer;
  1291. function PdhGetFormattedCounterArray;
  1292. begin
  1293. GetProcedureAddress(_PdhGetFormattedCounterArray, PdhLib, 'PdhGetFormattedCounterArray' + AWSuffix);
  1294. asm
  1295. MOV ESP, EBP
  1296. POP EBP
  1297. JMP [_PdhGetFormattedCounterArray]
  1298. end;
  1299. end;
  1300. var
  1301. _PdhGetRawCounterValue: Pointer;
  1302. function PdhGetRawCounterValue;
  1303. begin
  1304. GetProcedureAddress(_PdhGetRawCounterValue, PdhLib, 'PdhGetRawCounterValue');
  1305. asm
  1306. MOV ESP, EBP
  1307. POP EBP
  1308. JMP [_PdhGetRawCounterValue]
  1309. end;
  1310. end;
  1311. var
  1312. _PdhGetRawCounterArrayA: Pointer;
  1313. function PdhGetRawCounterArrayA;
  1314. begin
  1315. GetProcedureAddress(_PdhGetRawCounterArrayA, PdhLib, 'PdhGetRawCounterArrayA');
  1316. asm
  1317. MOV ESP, EBP
  1318. POP EBP
  1319. JMP [_PdhGetRawCounterArrayA]
  1320. end;
  1321. end;
  1322. var
  1323. _PdhGetRawCounterArrayW: Pointer;
  1324. function PdhGetRawCounterArrayW;
  1325. begin
  1326. GetProcedureAddress(_PdhGetRawCounterArrayW, PdhLib, 'PdhGetRawCounterArrayW');
  1327. asm
  1328. MOV ESP, EBP
  1329. POP EBP
  1330. JMP [_PdhGetRawCounterArrayW]
  1331. end;
  1332. end;
  1333. var
  1334. _PdhGetRawCounterArray: Pointer;
  1335. function PdhGetRawCounterArray;
  1336. begin
  1337. GetProcedureAddress(_PdhGetRawCounterArray, PdhLib, 'PdhGetRawCounterArray' + AWSuffix);
  1338. asm
  1339. MOV ESP, EBP
  1340. POP EBP
  1341. JMP [_PdhGetRawCounterArray]
  1342. end;
  1343. end;
  1344. var
  1345. _PdhCalculateCounterFromRawValue: Pointer;
  1346. function PdhCalculateCounterFromRawValue;
  1347. begin
  1348. GetProcedureAddress(_PdhCalculateCounterFromRawValue, PdhLib, 'PdhCalculateCounterFromRawValue');
  1349. asm
  1350. MOV ESP, EBP
  1351. POP EBP
  1352. JMP [_PdhCalculateCounterFromRawValue]
  1353. end;
  1354. end;
  1355. var
  1356. _PdhComputeCounterStatistics: Pointer;
  1357. function PdhComputeCounterStatistics;
  1358. begin
  1359. GetProcedureAddress(_PdhComputeCounterStatistics, PdhLib, 'PdhComputeCounterStatistics');
  1360. asm
  1361. MOV ESP, EBP
  1362. POP EBP
  1363. JMP [_PdhComputeCounterStatistics]
  1364. end;
  1365. end;
  1366. var
  1367. _PdhGetCounterInfoA: Pointer;
  1368. function PdhGetCounterInfoA;
  1369. begin
  1370. GetProcedureAddress(_PdhGetCounterInfoA, PdhLib, 'PdhGetCounterInfoA');
  1371. asm
  1372. MOV ESP, EBP
  1373. POP EBP
  1374. JMP [_PdhGetCounterInfoA]
  1375. end;
  1376. end;
  1377. var
  1378. _PdhGetCounterInfoW: Pointer;
  1379. function PdhGetCounterInfoW;
  1380. begin
  1381. GetProcedureAddress(_PdhGetCounterInfoW, PdhLib, 'PdhGetCounterInfoW');
  1382. asm
  1383. MOV ESP, EBP
  1384. POP EBP
  1385. JMP [_PdhGetCounterInfoW]
  1386. end;
  1387. end;
  1388. var
  1389. _PdhGetCounterInfo: Pointer;
  1390. function PdhGetCounterInfo;
  1391. begin
  1392. GetProcedureAddress(_PdhGetCounterInfo, PdhLib, 'PdhGetCounterInfo' + AWSuffix);
  1393. asm
  1394. MOV ESP, EBP
  1395. POP EBP
  1396. JMP [_PdhGetCounterInfo]
  1397. end;
  1398. end;
  1399. var
  1400. _PdhSetCounterScaleFactor: Pointer;
  1401. function PdhSetCounterScaleFactor;
  1402. begin
  1403. GetProcedureAddress(_PdhSetCounterScaleFactor, PdhLib, 'PdhSetCounterScaleFactor');
  1404. asm
  1405. MOV ESP, EBP
  1406. POP EBP
  1407. JMP [_PdhSetCounterScaleFactor]
  1408. end;
  1409. end;
  1410. var
  1411. _PdhConnectMachineA: Pointer;
  1412. function PdhConnectMachineA;
  1413. begin
  1414. GetProcedureAddress(_PdhConnectMachineA, PdhLib, 'PdhConnectMachineA');
  1415. asm
  1416. MOV ESP, EBP
  1417. POP EBP
  1418. JMP [_PdhConnectMachineA]
  1419. end;
  1420. end;
  1421. var
  1422. _PdhConnectMachineW: Pointer;
  1423. function PdhConnectMachineW;
  1424. begin
  1425. GetProcedureAddress(_PdhConnectMachineW, PdhLib, 'PdhConnectMachineW');
  1426. asm
  1427. MOV ESP, EBP
  1428. POP EBP
  1429. JMP [_PdhConnectMachineW]
  1430. end;
  1431. end;
  1432. var
  1433. _PdhConnectMachine: Pointer;
  1434. function PdhConnectMachine;
  1435. begin
  1436. GetProcedureAddress(_PdhConnectMachine, PdhLib, 'PdhConnectMachine' + AWSuffix);
  1437. asm
  1438. MOV ESP, EBP
  1439. POP EBP
  1440. JMP [_PdhConnectMachine]
  1441. end;
  1442. end;
  1443. var
  1444. _PdhEnumMachinesA: Pointer;
  1445. function PdhEnumMachinesA;
  1446. begin
  1447. GetProcedureAddress(_PdhEnumMachinesA, PdhLib, 'PdhEnumMachinesA');
  1448. asm
  1449. MOV ESP, EBP
  1450. POP EBP
  1451. JMP [_PdhEnumMachinesA]
  1452. end;
  1453. end;
  1454. var
  1455. _PdhEnumMachinesW: Pointer;
  1456. function PdhEnumMachinesW;
  1457. begin
  1458. GetProcedureAddress(_PdhEnumMachinesW, PdhLib, 'PdhEnumMachinesW');
  1459. asm
  1460. MOV ESP, EBP
  1461. POP EBP
  1462. JMP [_PdhEnumMachinesW]
  1463. end;
  1464. end;
  1465. var
  1466. _PdhEnumMachines: Pointer;
  1467. function PdhEnumMachines;
  1468. begin
  1469. GetProcedureAddress(_PdhEnumMachines, PdhLib, 'PdhEnumMachines' + AWSuffix);
  1470. asm
  1471. MOV ESP, EBP
  1472. POP EBP
  1473. JMP [_PdhEnumMachines]
  1474. end;
  1475. end;
  1476. var
  1477. _PdhEnumObjectsA: Pointer;
  1478. function PdhEnumObjectsA;
  1479. begin
  1480. GetProcedureAddress(_PdhEnumObjectsA, PdhLib, 'PdhEnumObjectsA');
  1481. asm
  1482. MOV ESP, EBP
  1483. POP EBP
  1484. JMP [_PdhEnumObjectsA]
  1485. end;
  1486. end;
  1487. var
  1488. _PdhEnumObjectsW: Pointer;
  1489. function PdhEnumObjectsW;
  1490. begin
  1491. GetProcedureAddress(_PdhEnumObjectsW, PdhLib, 'PdhEnumObjectsW');
  1492. asm
  1493. MOV ESP, EBP
  1494. POP EBP
  1495. JMP [_PdhEnumObjectsW]
  1496. end;
  1497. end;
  1498. var
  1499. _PdhEnumObjects: Pointer;
  1500. function PdhEnumObjects;
  1501. begin
  1502. GetProcedureAddress(_PdhEnumObjects, PdhLib, 'PdhEnumObjects' + AWSuffix);
  1503. asm
  1504. MOV ESP, EBP
  1505. POP EBP
  1506. JMP [_PdhEnumObjects]
  1507. end;
  1508. end;
  1509. var
  1510. _PdhEnumObjectItemsA: Pointer;
  1511. function PdhEnumObjectItemsA;
  1512. begin
  1513. GetProcedureAddress(_PdhEnumObjectItemsA, PdhLib, 'PdhEnumObjectItemsA');
  1514. asm
  1515. MOV ESP, EBP
  1516. POP EBP
  1517. JMP [_PdhEnumObjectItemsA]
  1518. end;
  1519. end;
  1520. var
  1521. _PdhEnumObjectItemsW: Pointer;
  1522. function PdhEnumObjectItemsW;
  1523. begin
  1524. GetProcedureAddress(_PdhEnumObjectItemsW, PdhLib, 'PdhEnumObjectItemsW');
  1525. asm
  1526. MOV ESP, EBP
  1527. POP EBP
  1528. JMP [_PdhEnumObjectItemsW]
  1529. end;
  1530. end;
  1531. var
  1532. _PdhEnumObjectItems: Pointer;
  1533. function PdhEnumObjectItems;
  1534. begin
  1535. GetProcedureAddress(_PdhEnumObjectItems, PdhLib, 'PdhEnumObjectItems' + AWSuffix);
  1536. asm
  1537. MOV ESP, EBP
  1538. POP EBP
  1539. JMP [_PdhEnumObjectItems]
  1540. end;
  1541. end;
  1542. var
  1543. _PdhMakeCounterPathA: Pointer;
  1544. function PdhMakeCounterPathA;
  1545. begin
  1546. GetProcedureAddress(_PdhMakeCounterPathA, PdhLib, 'PdhMakeCounterPathA');
  1547. asm
  1548. MOV ESP, EBP
  1549. POP EBP
  1550. JMP [_PdhMakeCounterPathA]
  1551. end;
  1552. end;
  1553. var
  1554. _PdhMakeCounterPathW: Pointer;
  1555. function PdhMakeCounterPathW;
  1556. begin
  1557. GetProcedureAddress(_PdhMakeCounterPathW, PdhLib, 'PdhMakeCounterPathW');
  1558. asm
  1559. MOV ESP, EBP
  1560. POP EBP
  1561. JMP [_PdhMakeCounterPathW]
  1562. end;
  1563. end;
  1564. var
  1565. _PdhMakeCounterPath: Pointer;
  1566. function PdhMakeCounterPath;
  1567. begin
  1568. GetProcedureAddress(_PdhMakeCounterPath, PdhLib, 'PdhMakeCounterPath' + AWSuffix);
  1569. asm
  1570. MOV ESP, EBP
  1571. POP EBP
  1572. JMP [_PdhMakeCounterPath]
  1573. end;
  1574. end;
  1575. var
  1576. _PdhParseCounterPathA: Pointer;
  1577. function PdhParseCounterPathA;
  1578. begin
  1579. GetProcedureAddress(_PdhParseCounterPathA, PdhLib, 'PdhParseCounterPathA');
  1580. asm
  1581. MOV ESP, EBP
  1582. POP EBP
  1583. JMP [_PdhParseCounterPathA]
  1584. end;
  1585. end;
  1586. var
  1587. _PdhParseCounterPathW: Pointer;
  1588. function PdhParseCounterPathW;
  1589. begin
  1590. GetProcedureAddress(_PdhParseCounterPathW, PdhLib, 'PdhParseCounterPathW');
  1591. asm
  1592. MOV ESP, EBP
  1593. POP EBP
  1594. JMP [_PdhParseCounterPathW]
  1595. end;
  1596. end;
  1597. var
  1598. _PdhParseCounterPath: Pointer;
  1599. function PdhParseCounterPath;
  1600. begin
  1601. GetProcedureAddress(_PdhParseCounterPath, PdhLib, 'PdhParseCounterPath' + AWSuffix);
  1602. asm
  1603. MOV ESP, EBP
  1604. POP EBP
  1605. JMP [_PdhParseCounterPath]
  1606. end;
  1607. end;
  1608. var
  1609. _PdhParseInstanceNameA: Pointer;
  1610. function PdhParseInstanceNameA;
  1611. begin
  1612. GetProcedureAddress(_PdhParseInstanceNameA, PdhLib, 'PdhParseInstanceNameA');
  1613. asm
  1614. MOV ESP, EBP
  1615. POP EBP
  1616. JMP [_PdhParseInstanceNameA]
  1617. end;
  1618. end;
  1619. var
  1620. _PdhParseInstanceNameW: Pointer;
  1621. function PdhParseInstanceNameW;
  1622. begin
  1623. GetProcedureAddress(_PdhParseInstanceNameW, PdhLib, 'PdhParseInstanceNameW');
  1624. asm
  1625. MOV ESP, EBP
  1626. POP EBP
  1627. JMP [_PdhParseInstanceNameW]
  1628. end;
  1629. end;
  1630. var
  1631. _PdhParseInstanceName: Pointer;
  1632. function PdhParseInstanceName;
  1633. begin
  1634. GetProcedureAddress(_PdhParseInstanceName, PdhLib, 'PdhParseInstanceName' + AWSuffix);
  1635. asm
  1636. MOV ESP, EBP
  1637. POP EBP
  1638. JMP [_PdhParseInstanceName]
  1639. end;
  1640. end;
  1641. var
  1642. _PdhValidatePathA: Pointer;
  1643. function PdhValidatePathA;
  1644. begin
  1645. GetProcedureAddress(_PdhValidatePathA, PdhLib, 'PdhValidatePathA');
  1646. asm
  1647. MOV ESP, EBP
  1648. POP EBP
  1649. JMP [_PdhValidatePathA]
  1650. end;
  1651. end;
  1652. var
  1653. _PdhValidatePathW: Pointer;
  1654. function PdhValidatePathW;
  1655. begin
  1656. GetProcedureAddress(_PdhValidatePathW, PdhLib, 'PdhValidatePathW');
  1657. asm
  1658. MOV ESP, EBP
  1659. POP EBP
  1660. JMP [_PdhValidatePathW]
  1661. end;
  1662. end;
  1663. var
  1664. _PdhValidatePath: Pointer;
  1665. function PdhValidatePath;
  1666. begin
  1667. GetProcedureAddress(_PdhValidatePath, PdhLib, 'PdhValidatePath' + AWSuffix);
  1668. asm
  1669. MOV ESP, EBP
  1670. POP EBP
  1671. JMP [_PdhValidatePath]
  1672. end;
  1673. end;
  1674. var
  1675. _PdhGetDefaultPerfObjectA: Pointer;
  1676. function PdhGetDefaultPerfObjectA;
  1677. begin
  1678. GetProcedureAddress(_PdhGetDefaultPerfObjectA, PdhLib, 'PdhGetDefaultPerfObjectA');
  1679. asm
  1680. MOV ESP, EBP
  1681. POP EBP
  1682. JMP [_PdhGetDefaultPerfObjectA]
  1683. end;
  1684. end;
  1685. var
  1686. _PdhGetDefaultPerfObjectW: Pointer;
  1687. function PdhGetDefaultPerfObjectW;
  1688. begin
  1689. GetProcedureAddress(_PdhGetDefaultPerfObjectW, PdhLib, 'PdhGetDefaultPerfObjectW');
  1690. asm
  1691. MOV ESP, EBP
  1692. POP EBP
  1693. JMP [_PdhGetDefaultPerfObjectW]
  1694. end;
  1695. end;
  1696. var
  1697. _PdhGetDefaultPerfObject: Pointer;
  1698. function PdhGetDefaultPerfObject;
  1699. begin
  1700. GetProcedureAddress(_PdhGetDefaultPerfObject, PdhLib, 'PdhGetDefaultPerfObject' + AWSuffix);
  1701. asm
  1702. MOV ESP, EBP
  1703. POP EBP
  1704. JMP [_PdhGetDefaultPerfObject]
  1705. end;
  1706. end;
  1707. var
  1708. _PdhGetDefaultPerfCounterA: Pointer;
  1709. function PdhGetDefaultPerfCounterA;
  1710. begin
  1711. GetProcedureAddress(_PdhGetDefaultPerfCounterA, PdhLib, 'PdhGetDefaultPerfCounterA');
  1712. asm
  1713. MOV ESP, EBP
  1714. POP EBP
  1715. JMP [_PdhGetDefaultPerfCounterA]
  1716. end;
  1717. end;
  1718. var
  1719. _PdhGetDefaultPerfCounterW: Pointer;
  1720. function PdhGetDefaultPerfCounterW;
  1721. begin
  1722. GetProcedureAddress(_PdhGetDefaultPerfCounterW, PdhLib, 'PdhGetDefaultPerfCounterW');
  1723. asm
  1724. MOV ESP, EBP
  1725. POP EBP
  1726. JMP [_PdhGetDefaultPerfCounterW]
  1727. end;
  1728. end;
  1729. var
  1730. _PdhGetDefaultPerfCounter: Pointer;
  1731. function PdhGetDefaultPerfCounter;
  1732. begin
  1733. GetProcedureAddress(_PdhGetDefaultPerfCounter, PdhLib, 'PdhGetDefaultPerfCounter' + AWSuffix);
  1734. asm
  1735. MOV ESP, EBP
  1736. POP EBP
  1737. JMP [_PdhGetDefaultPerfCounter]
  1738. end;
  1739. end;
  1740. var
  1741. _PdhBrowseCountersA: Pointer;
  1742. function PdhBrowseCountersA;
  1743. begin
  1744. GetProcedureAddress(_PdhBrowseCountersA, PdhLib, 'PdhBrowseCountersA');
  1745. asm
  1746. MOV ESP, EBP
  1747. POP EBP
  1748. JMP [_PdhBrowseCountersA]
  1749. end;
  1750. end;
  1751. var
  1752. _PdhBrowseCountersW: Pointer;
  1753. function PdhBrowseCountersW;
  1754. begin
  1755. GetProcedureAddress(_PdhBrowseCountersW, PdhLib, 'PdhBrowseCountersW');
  1756. asm
  1757. MOV ESP, EBP
  1758. POP EBP
  1759. JMP [_PdhBrowseCountersW]
  1760. end;
  1761. end;
  1762. var
  1763. _PdhBrowseCounters: Pointer;
  1764. function PdhBrowseCounters;
  1765. begin
  1766. GetProcedureAddress(_PdhBrowseCounters, PdhLib, 'PdhBrowseCounters' + AWSuffix);
  1767. asm
  1768. MOV ESP, EBP
  1769. POP EBP
  1770. JMP [_PdhBrowseCounters]
  1771. end;
  1772. end;
  1773. var
  1774. _PdhExpandCounterPathA: Pointer;
  1775. function PdhExpandCounterPathA;
  1776. begin
  1777. GetProcedureAddress(_PdhExpandCounterPathA, PdhLib, 'PdhExpandCounterPathA');
  1778. asm
  1779. MOV ESP, EBP
  1780. POP EBP
  1781. JMP [_PdhExpandCounterPathA]
  1782. end;
  1783. end;
  1784. var
  1785. _PdhExpandCounterPathW: Pointer;
  1786. function PdhExpandCounterPathW;
  1787. begin
  1788. GetProcedureAddress(_PdhExpandCounterPathW, PdhLib, 'PdhExpandCounterPathW');
  1789. asm
  1790. MOV ESP, EBP
  1791. POP EBP
  1792. JMP [_PdhExpandCounterPathW]
  1793. end;
  1794. end;
  1795. var
  1796. _PdhExpandCounterPath: Pointer;
  1797. function PdhExpandCounterPath;
  1798. begin
  1799. GetProcedureAddress(_PdhExpandCounterPath, PdhLib, 'PdhExpandCounterPath' + AWSuffix);
  1800. asm
  1801. MOV ESP, EBP
  1802. POP EBP
  1803. JMP [_PdhExpandCounterPath]
  1804. end;
  1805. end;
  1806. var
  1807. _PdhLookupPerfNameByIndexA: Pointer;
  1808. function PdhLookupPerfNameByIndexA;
  1809. begin
  1810. GetProcedureAddress(_PdhLookupPerfNameByIndexA, PdhLib, 'PdhLookupPerfNameByIndexA');
  1811. asm
  1812. MOV ESP, EBP
  1813. POP EBP
  1814. JMP [_PdhLookupPerfNameByIndexA]
  1815. end;
  1816. end;
  1817. var
  1818. _PdhLookupPerfNameByIndexW: Pointer;
  1819. function PdhLookupPerfNameByIndexW;
  1820. begin
  1821. GetProcedureAddress(_PdhLookupPerfNameByIndexW, PdhLib, 'PdhLookupPerfNameByIndexW');
  1822. asm
  1823. MOV ESP, EBP
  1824. POP EBP
  1825. JMP [_PdhLookupPerfNameByIndexW]
  1826. end;
  1827. end;
  1828. var
  1829. _PdhLookupPerfNameByIndex: Pointer;
  1830. function PdhLookupPerfNameByIndex;
  1831. begin
  1832. GetProcedureAddress(_PdhLookupPerfNameByIndex, PdhLib, 'PdhLookupPerfNameByIndex' + AWSuffix);
  1833. asm
  1834. MOV ESP, EBP
  1835. POP EBP
  1836. JMP [_PdhLookupPerfNameByIndex]
  1837. end;
  1838. end;
  1839. var
  1840. _PdhLookupPerfIndexByNameA: Pointer;
  1841. function PdhLookupPerfIndexByNameA;
  1842. begin
  1843. GetProcedureAddress(_PdhLookupPerfIndexByNameA, PdhLib, 'PdhLookupPerfIndexByNameA');
  1844. asm
  1845. MOV ESP, EBP
  1846. POP EBP
  1847. JMP [_PdhLookupPerfIndexByNameA]
  1848. end;
  1849. end;
  1850. var
  1851. _PdhLookupPerfIndexByNameW: Pointer;
  1852. function PdhLookupPerfIndexByNameW;
  1853. begin
  1854. GetProcedureAddress(_PdhLookupPerfIndexByNameW, PdhLib, 'PdhLookupPerfIndexByNameW');
  1855. asm
  1856. MOV ESP, EBP
  1857. POP EBP
  1858. JMP [_PdhLookupPerfIndexByNameW]
  1859. end;
  1860. end;
  1861. var
  1862. _PdhLookupPerfIndexByName: Pointer;
  1863. function PdhLookupPerfIndexByName;
  1864. begin
  1865. GetProcedureAddress(_PdhLookupPerfIndexByName, PdhLib, 'PdhLookupPerfIndexByName' + AWSuffix);
  1866. asm
  1867. MOV ESP, EBP
  1868. POP EBP
  1869. JMP [_PdhLookupPerfIndexByName]
  1870. end;
  1871. end;
  1872. var
  1873. _PdhExpandWildCardPathA: Pointer;
  1874. function PdhExpandWildCardPathA;
  1875. begin
  1876. GetProcedureAddress(_PdhExpandWildCardPathA, PdhLib, 'PdhExpandWildCardPathA');
  1877. asm
  1878. MOV ESP, EBP
  1879. POP EBP
  1880. JMP [_PdhExpandWildCardPathA]
  1881. end;
  1882. end;
  1883. var
  1884. _PdhExpandWildCardPathW: Pointer;
  1885. function PdhExpandWildCardPathW;
  1886. begin
  1887. GetProcedureAddress(_PdhExpandWildCardPathW, PdhLib, 'PdhExpandWildCardPathW');
  1888. asm
  1889. MOV ESP, EBP
  1890. POP EBP
  1891. JMP [_PdhExpandWildCardPathW]
  1892. end;
  1893. end;
  1894. var
  1895. _PdhExpandWildCardPath: Pointer;
  1896. function PdhExpandWildCardPath;
  1897. begin
  1898. GetProcedureAddress(_PdhExpandWildCardPath, PdhLib, 'PdhExpandWildCardPath' + AWSuffix);
  1899. asm
  1900. MOV ESP, EBP
  1901. POP EBP
  1902. JMP [_PdhExpandWildCardPath]
  1903. end;
  1904. end;
  1905. var
  1906. _PdhOpenLogA: Pointer;
  1907. function PdhOpenLogA;
  1908. begin
  1909. GetProcedureAddress(_PdhOpenLogA, PdhLib, 'PdhOpenLogA');
  1910. asm
  1911. MOV ESP, EBP
  1912. POP EBP
  1913. JMP [_PdhOpenLogA]
  1914. end;
  1915. end;
  1916. var
  1917. _PdhOpenLogW: Pointer;
  1918. function PdhOpenLogW;
  1919. begin
  1920. GetProcedureAddress(_PdhOpenLogW, PdhLib, 'PdhOpenLogW');
  1921. asm
  1922. MOV ESP, EBP
  1923. POP EBP
  1924. JMP [_PdhOpenLogW]
  1925. end;
  1926. end;
  1927. var
  1928. _PdhOpenLog: Pointer;
  1929. function PdhOpenLog;
  1930. begin
  1931. GetProcedureAddress(_PdhOpenLog, PdhLib, 'PdhOpenLog' + AWSuffix);
  1932. asm
  1933. MOV ESP, EBP
  1934. POP EBP
  1935. JMP [_PdhOpenLog]
  1936. end;
  1937. end;
  1938. var
  1939. _PdhUpdateLogA: Pointer;
  1940. function PdhUpdateLogA;
  1941. begin
  1942. GetProcedureAddress(_PdhUpdateLogA, PdhLib, 'PdhUpdateLogA');
  1943. asm
  1944. MOV ESP, EBP
  1945. POP EBP
  1946. JMP [_PdhUpdateLogA]
  1947. end;
  1948. end;
  1949. var
  1950. _PdhUpdateLogW: Pointer;
  1951. function PdhUpdateLogW;
  1952. begin
  1953. GetProcedureAddress(_PdhUpdateLogW, PdhLib, 'PdhUpdateLogW');
  1954. asm
  1955. MOV ESP, EBP
  1956. POP EBP
  1957. JMP [_PdhUpdateLogW]
  1958. end;
  1959. end;
  1960. var
  1961. _PdhUpdateLog: Pointer;
  1962. function PdhUpdateLog;
  1963. begin
  1964. GetProcedureAddress(_PdhUpdateLog, PdhLib, 'PdhUpdateLog' + AWSuffix);
  1965. asm
  1966. MOV ESP, EBP
  1967. POP EBP
  1968. JMP [_PdhUpdateLog]
  1969. end;
  1970. end;
  1971. var
  1972. _PdhUpdateLogFileCatalog: Pointer;
  1973. function PdhUpdateLogFileCatalog;
  1974. begin
  1975. GetProcedureAddress(_PdhUpdateLogFileCatalog, PdhLib, 'PdhUpdateLogFileCatalog');
  1976. asm
  1977. MOV ESP, EBP
  1978. POP EBP
  1979. JMP [_PdhUpdateLogFileCatalog]
  1980. end;
  1981. end;
  1982. var
  1983. _PdhGetLogFileSize: Pointer;
  1984. function PdhGetLogFileSize;
  1985. begin
  1986. GetProcedureAddress(_PdhGetLogFileSize, PdhLib, 'PdhGetLogFileSize');
  1987. asm
  1988. MOV ESP, EBP
  1989. POP EBP
  1990. JMP [_PdhGetLogFileSize]
  1991. end;
  1992. end;
  1993. var
  1994. _PdhCloseLog: Pointer;
  1995. function PdhCloseLog;
  1996. begin
  1997. GetProcedureAddress(_PdhCloseLog, PdhLib, 'PdhCloseLog');
  1998. asm
  1999. MOV ESP, EBP
  2000. POP EBP
  2001. JMP [_PdhCloseLog]
  2002. end;
  2003. end;
  2004. var
  2005. _PdhSelectDataSourceA: Pointer;
  2006. function PdhSelectDataSourceA;
  2007. begin
  2008. GetProcedureAddress(_PdhSelectDataSourceA, PdhLib, 'PdhSelectDataSourceA');
  2009. asm
  2010. MOV ESP, EBP
  2011. POP EBP
  2012. JMP [_PdhSelectDataSourceA]
  2013. end;
  2014. end;
  2015. var
  2016. _PdhSelectDataSourceW: Pointer;
  2017. function PdhSelectDataSourceW;
  2018. begin
  2019. GetProcedureAddress(_PdhSelectDataSourceW, PdhLib, 'PdhSelectDataSourceW');
  2020. asm
  2021. MOV ESP, EBP
  2022. POP EBP
  2023. JMP [_PdhSelectDataSourceW]
  2024. end;
  2025. end;
  2026. var
  2027. _PdhSelectDataSource: Pointer;
  2028. function PdhSelectDataSource;
  2029. begin
  2030. GetProcedureAddress(_PdhSelectDataSource, PdhLib, 'PdhSelectDataSource' + AWSuffix);
  2031. asm
  2032. MOV ESP, EBP
  2033. POP EBP
  2034. JMP [_PdhSelectDataSource]
  2035. end;
  2036. end;
  2037. var
  2038. _PdhIsRealTimeQuery: Pointer;
  2039. function PdhIsRealTimeQuery;
  2040. begin
  2041. GetProcedureAddress(_PdhIsRealTimeQuery, PdhLib, 'PdhIsRealTimeQuery');
  2042. asm
  2043. MOV ESP, EBP
  2044. POP EBP
  2045. JMP [_PdhIsRealTimeQuery]
  2046. end;
  2047. end;
  2048. var
  2049. _PdhSetQueryTimeRange: Pointer;
  2050. function PdhSetQueryTimeRange;
  2051. begin
  2052. GetProcedureAddress(_PdhSetQueryTimeRange, PdhLib, 'PdhSetQueryTimeRange');
  2053. asm
  2054. MOV ESP, EBP
  2055. POP EBP
  2056. JMP [_PdhSetQueryTimeRange]
  2057. end;
  2058. end;
  2059. var
  2060. _PdhGetDataSourceTimeRangeA: Pointer;
  2061. function PdhGetDataSourceTimeRangeA;
  2062. begin
  2063. GetProcedureAddress(_PdhGetDataSourceTimeRangeA, PdhLib, 'PdhGetDataSourceTimeRangeA');
  2064. asm
  2065. MOV ESP, EBP
  2066. POP EBP
  2067. JMP [_PdhGetDataSourceTimeRangeA]
  2068. end;
  2069. end;
  2070. var
  2071. _PdhGetDataSourceTimeRangeW: Pointer;
  2072. function PdhGetDataSourceTimeRangeW;
  2073. begin
  2074. GetProcedureAddress(_PdhGetDataSourceTimeRangeW, PdhLib, 'PdhGetDataSourceTimeRangeW');
  2075. asm
  2076. MOV ESP, EBP
  2077. POP EBP
  2078. JMP [_PdhGetDataSourceTimeRangeW]
  2079. end;
  2080. end;
  2081. var
  2082. _PdhGetDataSourceTimeRange: Pointer;
  2083. function PdhGetDataSourceTimeRange;
  2084. begin
  2085. GetProcedureAddress(_PdhGetDataSourceTimeRange, PdhLib, 'PdhGetDataSourceTimeRange' + AWSuffix);
  2086. asm
  2087. MOV ESP, EBP
  2088. POP EBP
  2089. JMP [_PdhGetDataSourceTimeRange]
  2090. end;
  2091. end;
  2092. var
  2093. _PdhCollectQueryDataEx: Pointer;
  2094. function PdhCollectQueryDataEx;
  2095. begin
  2096. GetProcedureAddress(_PdhCollectQueryDataEx, PdhLib, 'PdhCollectQueryDataEx');
  2097. asm
  2098. MOV ESP, EBP
  2099. POP EBP
  2100. JMP [_PdhCollectQueryDataEx]
  2101. end;
  2102. end;
  2103. var
  2104. _PdhFormatFromRawValue: Pointer;
  2105. function PdhFormatFromRawValue;
  2106. begin
  2107. GetProcedureAddress(_PdhFormatFromRawValue, PdhLib, 'PdhFormatFromRawValue');
  2108. asm
  2109. MOV ESP, EBP
  2110. POP EBP
  2111. JMP [_PdhFormatFromRawValue]
  2112. end;
  2113. end;
  2114. var
  2115. _PdhGetCounterTimeBase: Pointer;
  2116. function PdhGetCounterTimeBase;
  2117. begin
  2118. GetProcedureAddress(_PdhGetCounterTimeBase, PdhLib, 'PdhGetCounterTimeBase');
  2119. asm
  2120. MOV ESP, EBP
  2121. POP EBP
  2122. JMP [_PdhGetCounterTimeBase]
  2123. end;
  2124. end;
  2125. var
  2126. _PdhReadRawLogRecord: Pointer;
  2127. function PdhReadRawLogRecord;
  2128. begin
  2129. GetProcedureAddress(_PdhReadRawLogRecord, PdhLib, 'PdhReadRawLogRecord');
  2130. asm
  2131. MOV ESP, EBP
  2132. POP EBP
  2133. JMP [_PdhReadRawLogRecord]
  2134. end;
  2135. end;
  2136. var
  2137. _PdhSetDefaultRealTimeDataSource: Pointer;
  2138. function PdhSetDefaultRealTimeDataSource;
  2139. begin
  2140. GetProcedureAddress(_PdhSetDefaultRealTimeDataSource, PdhLib, 'PdhSetDefaultRealTimeDataSource');
  2141. asm
  2142. MOV ESP, EBP
  2143. POP EBP
  2144. JMP [_PdhSetDefaultRealTimeDataSource]
  2145. end;
  2146. end;
  2147. var
  2148. _PdhBindInputDataSourceW: Pointer;
  2149. function PdhBindInputDataSourceW;
  2150. begin
  2151. GetProcedureAddress(_PdhBindInputDataSourceW, PdhLib, 'PdhBindInputDataSourceW');
  2152. asm
  2153. MOV ESP, EBP
  2154. POP EBP
  2155. JMP [_PdhBindInputDataSourceW]
  2156. end;
  2157. end;
  2158. var
  2159. _PdhBindInputDataSourceA: Pointer;
  2160. function PdhBindInputDataSourceA;
  2161. begin
  2162. GetProcedureAddress(_PdhBindInputDataSourceA, PdhLib, 'PdhBindInputDataSourceA');
  2163. asm
  2164. MOV ESP, EBP
  2165. POP EBP
  2166. JMP [_PdhBindInputDataSourceA]
  2167. end;
  2168. end;
  2169. var
  2170. _PdhBindInputDataSource: Pointer;
  2171. function PdhBindInputDataSource;
  2172. begin
  2173. GetProcedureAddress(_PdhBindInputDataSource, PdhLib, 'PdhBindInputDataSource' + AWSuffix);
  2174. asm
  2175. MOV ESP, EBP
  2176. POP EBP
  2177. JMP [_PdhBindInputDataSource]
  2178. end;
  2179. end;
  2180. var
  2181. _PdhOpenQueryH: Pointer;
  2182. function PdhOpenQueryH;
  2183. begin
  2184. GetProcedureAddress(_PdhOpenQueryH, PdhLib, 'PdhOpenQueryH');
  2185. asm
  2186. MOV ESP, EBP
  2187. POP EBP
  2188. JMP [_PdhOpenQueryH]
  2189. end;
  2190. end;
  2191. var
  2192. _PdhEnumMachinesHW: Pointer;
  2193. function PdhEnumMachinesHW;
  2194. begin
  2195. GetProcedureAddress(_PdhEnumMachinesHW, PdhLib, 'PdhEnumMachinesHW');
  2196. asm
  2197. MOV ESP, EBP
  2198. POP EBP
  2199. JMP [_PdhEnumMachinesHW]
  2200. end;
  2201. end;
  2202. var
  2203. _PdhEnumMachinesHA: Pointer;
  2204. function PdhEnumMachinesHA;
  2205. begin
  2206. GetProcedureAddress(_PdhEnumMachinesHA, PdhLib, 'PdhEnumMachinesHA');
  2207. asm
  2208. MOV ESP, EBP
  2209. POP EBP
  2210. JMP [_PdhEnumMachinesHA]
  2211. end;
  2212. end;
  2213. var
  2214. _PdhEnumMachinesH: Pointer;
  2215. function PdhEnumMachinesH;
  2216. begin
  2217. GetProcedureAddress(_PdhEnumMachinesH, PdhLib, 'PdhEnumMachinesH' + AWSuffix);
  2218. asm
  2219. MOV ESP, EBP
  2220. POP EBP
  2221. JMP [_PdhEnumMachinesH]
  2222. end;
  2223. end;
  2224. var
  2225. _PdhEnumObjectsHW: Pointer;
  2226. function PdhEnumObjectsHW;
  2227. begin
  2228. GetProcedureAddress(_PdhEnumObjectsHW, PdhLib, 'PdhEnumObjectsHW');
  2229. asm
  2230. MOV ESP, EBP
  2231. POP EBP
  2232. JMP [_PdhEnumObjectsHW]
  2233. end;
  2234. end;
  2235. var
  2236. _PdhEnumObjectsHA: Pointer;
  2237. function PdhEnumObjectsHA;
  2238. begin
  2239. GetProcedureAddress(_PdhEnumObjectsHA, PdhLib, 'PdhEnumObjectsHA');
  2240. asm
  2241. MOV ESP, EBP
  2242. POP EBP
  2243. JMP [_PdhEnumObjectsHA]
  2244. end;
  2245. end;
  2246. var
  2247. _PdhEnumObjectsH: Pointer;
  2248. function PdhEnumObjectsH;
  2249. begin
  2250. GetProcedureAddress(_PdhEnumObjectsH, PdhLib, 'PdhEnumObjectsH' + AWSuffix);
  2251. asm
  2252. MOV ESP, EBP
  2253. POP EBP
  2254. JMP [_PdhEnumObjectsH]
  2255. end;
  2256. end;
  2257. var
  2258. _PdhEnumObjectItemsHW: Pointer;
  2259. function PdhEnumObjectItemsHW;
  2260. begin
  2261. GetProcedureAddress(_PdhEnumObjectItemsHW, PdhLib, 'PdhEnumObjectItemsHW');
  2262. asm
  2263. MOV ESP, EBP
  2264. POP EBP
  2265. JMP [_PdhEnumObjectItemsHW]
  2266. end;
  2267. end;
  2268. var
  2269. _PdhEnumObjectItemsHA: Pointer;
  2270. function PdhEnumObjectItemsHA;
  2271. begin
  2272. GetProcedureAddress(_PdhEnumObjectItemsHA, PdhLib, 'PdhEnumObjectItemsHA');
  2273. asm
  2274. MOV ESP, EBP
  2275. POP EBP
  2276. JMP [_PdhEnumObjectItemsHA]
  2277. end;
  2278. end;
  2279. var
  2280. _PdhEnumObjectItemsH: Pointer;
  2281. function PdhEnumObjectItemsH;
  2282. begin
  2283. GetProcedureAddress(_PdhEnumObjectItemsH, PdhLib, 'PdhEnumObjectItemsH' + AWSuffix);
  2284. asm
  2285. MOV ESP, EBP
  2286. POP EBP
  2287. JMP [_PdhEnumObjectItemsH]
  2288. end;
  2289. end;
  2290. var
  2291. _PdhExpandWildCardPathHW: Pointer;
  2292. function PdhExpandWildCardPathHW;
  2293. begin
  2294. GetProcedureAddress(_PdhExpandWildCardPathHW, PdhLib, 'PdhExpandWildCardPathHW');
  2295. asm
  2296. MOV ESP, EBP
  2297. POP EBP
  2298. JMP [_PdhExpandWildCardPathHW]
  2299. end;
  2300. end;
  2301. var
  2302. _PdhExpandWildCardPathHA: Pointer;
  2303. function PdhExpandWildCardPathHA;
  2304. begin
  2305. GetProcedureAddress(_PdhExpandWildCardPathHA, PdhLib, 'PdhExpandWildCardPathHA');
  2306. asm
  2307. MOV ESP, EBP
  2308. POP EBP
  2309. JMP [_PdhExpandWildCardPathHA]
  2310. end;
  2311. end;
  2312. var
  2313. _PdhExpandWildCardPathH: Pointer;
  2314. function PdhExpandWildCardPathH;
  2315. begin
  2316. GetProcedureAddress(_PdhExpandWildCardPathH, PdhLib, 'PdhExpandWildCardPathH' + AWSuffix);
  2317. asm
  2318. MOV ESP, EBP
  2319. POP EBP
  2320. JMP [_PdhExpandWildCardPathH]
  2321. end;
  2322. end;
  2323. var
  2324. _PdhGetDataSourceTimeRangeH: Pointer;
  2325. function PdhGetDataSourceTimeRangeH;
  2326. begin
  2327. GetProcedureAddress(_PdhGetDataSourceTimeRangeH, PdhLib, 'PdhGetDataSourceTimeRangeH');
  2328. asm
  2329. MOV ESP, EBP
  2330. POP EBP
  2331. JMP [_PdhGetDataSourceTimeRangeH]
  2332. end;
  2333. end;
  2334. var
  2335. _PdhGetDefaultPerfObjectHW: Pointer;
  2336. function PdhGetDefaultPerfObjectHW;
  2337. begin
  2338. GetProcedureAddress(_PdhGetDefaultPerfObjectHW, PdhLib, 'PdhGetDefaultPerfObjectHW');
  2339. asm
  2340. MOV ESP, EBP
  2341. POP EBP
  2342. JMP [_PdhGetDefaultPerfObjectHW]
  2343. end;
  2344. end;
  2345. var
  2346. _PdhGetDefaultPerfObjectHA: Pointer;
  2347. function PdhGetDefaultPerfObjectHA;
  2348. begin
  2349. GetProcedureAddress(_PdhGetDefaultPerfObjectHA, PdhLib, 'PdhGetDefaultPerfObjectHA');
  2350. asm
  2351. MOV ESP, EBP
  2352. POP EBP
  2353. JMP [_PdhGetDefaultPerfObjectHA]
  2354. end;
  2355. end;
  2356. var
  2357. _PdhGetDefaultPerfObjectH: Pointer;
  2358. function PdhGetDefaultPerfObjectH;
  2359. begin
  2360. GetProcedureAddress(_PdhGetDefaultPerfObjectH, PdhLib, 'PdhGetDefaultPerfObjectH' + AWSuffix);
  2361. asm
  2362. MOV ESP, EBP
  2363. POP EBP
  2364. JMP [_PdhGetDefaultPerfObjectH]
  2365. end;
  2366. end;
  2367. var
  2368. _PdhGetDefaultPerfCounterHW: Pointer;
  2369. function PdhGetDefaultPerfCounterHW;
  2370. begin
  2371. GetProcedureAddress(_PdhGetDefaultPerfCounterHW, PdhLib, 'PdhGetDefaultPerfCounterHW');
  2372. asm
  2373. MOV ESP, EBP
  2374. POP EBP
  2375. JMP [_PdhGetDefaultPerfCounterHW]
  2376. end;
  2377. end;
  2378. var
  2379. _PdhGetDefaultPerfCounterHA: Pointer;
  2380. function PdhGetDefaultPerfCounterHA;
  2381. begin
  2382. GetProcedureAddress(_PdhGetDefaultPerfCounterHA, PdhLib, 'PdhGetDefaultPerfCounterHA');
  2383. asm
  2384. MOV ESP, EBP
  2385. POP EBP
  2386. JMP [_PdhGetDefaultPerfCounterHA]
  2387. end;
  2388. end;
  2389. var
  2390. _PdhGetDefaultPerfCounterH: Pointer;
  2391. function PdhGetDefaultPerfCounterH;
  2392. begin
  2393. GetProcedureAddress(_PdhGetDefaultPerfCounterH, PdhLib, 'PdhGetDefaultPerfCounterH' + AWSuffix);
  2394. asm
  2395. MOV ESP, EBP
  2396. POP EBP
  2397. JMP [_PdhGetDefaultPerfCounterH]
  2398. end;
  2399. end;
  2400. var
  2401. _PdhBrowseCountersHW: Pointer;
  2402. function PdhBrowseCountersHW;
  2403. begin
  2404. GetProcedureAddress(_PdhBrowseCountersHW, PdhLib, 'PdhBrowseCountersHW');
  2405. asm
  2406. MOV ESP, EBP
  2407. POP EBP
  2408. JMP [_PdhBrowseCountersHW]
  2409. end;
  2410. end;
  2411. var
  2412. _PdhBrowseCountersHA: Pointer;
  2413. function PdhBrowseCountersHA;
  2414. begin
  2415. GetProcedureAddress(_PdhBrowseCountersHA, PdhLib, 'PdhBrowseCountersHA');
  2416. asm
  2417. MOV ESP, EBP
  2418. POP EBP
  2419. JMP [_PdhBrowseCountersHA]
  2420. end;
  2421. end;
  2422. var
  2423. _PdhBrowseCountersH: Pointer;
  2424. function PdhBrowseCountersH;
  2425. begin
  2426. GetProcedureAddress(_PdhBrowseCountersH, PdhLib, 'PdhBrowseCountersH' + AWSuffix);
  2427. asm
  2428. MOV ESP, EBP
  2429. POP EBP
  2430. JMP [_PdhBrowseCountersH]
  2431. end;
  2432. end;
  2433. var
  2434. _PdhVerifySQLDBW: Pointer;
  2435. function PdhVerifySQLDBW;
  2436. begin
  2437. GetProcedureAddress(_PdhVerifySQLDBW, PdhLib, 'PdhVerifySQLDBW');
  2438. asm
  2439. MOV ESP, EBP
  2440. POP EBP
  2441. JMP [_PdhVerifySQLDBW]
  2442. end;
  2443. end;
  2444. var
  2445. _PdhVerifySQLDBA: Pointer;
  2446. function PdhVerifySQLDBA;
  2447. begin
  2448. GetProcedureAddress(_PdhVerifySQLDBA, PdhLib, 'PdhVerifySQLDBA');
  2449. asm
  2450. MOV ESP, EBP
  2451. POP EBP
  2452. JMP [_PdhVerifySQLDBA]
  2453. end;
  2454. end;
  2455. var
  2456. _PdhVerifySQLDB: Pointer;
  2457. function PdhVerifySQLDB;
  2458. begin
  2459. GetProcedureAddress(_PdhVerifySQLDB, PdhLib, 'PdhVerifySQLDB' + AWSuffix);
  2460. asm
  2461. MOV ESP, EBP
  2462. POP EBP
  2463. JMP [_PdhVerifySQLDB]
  2464. end;
  2465. end;
  2466. var
  2467. _PdhCreateSQLTablesW: Pointer;
  2468. function PdhCreateSQLTablesW;
  2469. begin
  2470. GetProcedureAddress(_PdhCreateSQLTablesW, PdhLib, 'PdhCreateSQLTablesW');
  2471. asm
  2472. MOV ESP, EBP
  2473. POP EBP
  2474. JMP [_PdhCreateSQLTablesW]
  2475. end;
  2476. end;
  2477. var
  2478. _PdhCreateSQLTablesA: Pointer;
  2479. function PdhCreateSQLTablesA;
  2480. begin
  2481. GetProcedureAddress(_PdhCreateSQLTablesA, PdhLib, 'PdhCreateSQLTablesA');
  2482. asm
  2483. MOV ESP, EBP
  2484. POP EBP
  2485. JMP [_PdhCreateSQLTablesA]
  2486. end;
  2487. end;
  2488. var
  2489. _PdhCreateSQLTables: Pointer;
  2490. function PdhCreateSQLTables;
  2491. begin
  2492. GetProcedureAddress(_PdhCreateSQLTables, PdhLib, 'PdhCreateSQLTables' + AWSuffix);
  2493. asm
  2494. MOV ESP, EBP
  2495. POP EBP
  2496. JMP [_PdhCreateSQLTables]
  2497. end;
  2498. end;
  2499. var
  2500. _PdhEnumLogSetNamesW: Pointer;
  2501. function PdhEnumLogSetNamesW;
  2502. begin
  2503. GetProcedureAddress(_PdhEnumLogSetNamesW, PdhLib, 'PdhEnumLogSetNamesW');
  2504. asm
  2505. MOV ESP, EBP
  2506. POP EBP
  2507. JMP [_PdhEnumLogSetNamesW]
  2508. end;
  2509. end;
  2510. var
  2511. _PdhEnumLogSetNamesA: Pointer;
  2512. function PdhEnumLogSetNamesA;
  2513. begin
  2514. GetProcedureAddress(_PdhEnumLogSetNamesA, PdhLib, 'PdhEnumLogSetNamesA');
  2515. asm
  2516. MOV ESP, EBP
  2517. POP EBP
  2518. JMP [_PdhEnumLogSetNamesA]
  2519. end;
  2520. end;
  2521. var
  2522. _PdhEnumLogSetNames: Pointer;
  2523. function PdhEnumLogSetNames;
  2524. begin
  2525. GetProcedureAddress(_PdhEnumLogSetNames, PdhLib, 'PdhEnumLogSetNames' + AWSuffix);
  2526. asm
  2527. MOV ESP, EBP
  2528. POP EBP
  2529. JMP [_PdhEnumLogSetNames]
  2530. end;
  2531. end;
  2532. var
  2533. _PdhGetLogSetGUID: Pointer;
  2534. function PdhGetLogSetGUID;
  2535. begin
  2536. GetProcedureAddress(_PdhGetLogSetGUID, PdhLib, 'PdhGetLogSetGUID');
  2537. asm
  2538. MOV ESP, EBP
  2539. POP EBP
  2540. JMP [_PdhGetLogSetGUID]
  2541. end;
  2542. end;
  2543. var
  2544. _PdhSetLogSetRunID: Pointer;
  2545. function PdhSetLogSetRunID;
  2546. begin
  2547. GetProcedureAddress(_PdhSetLogSetRunID, PdhLib, 'PdhSetLogSetRunID');
  2548. asm
  2549. MOV ESP, EBP
  2550. POP EBP
  2551. JMP [_PdhSetLogSetRunID]
  2552. end;
  2553. end;
  2554. {$ELSE}
  2555. function PdhGetDllVersion; external PdhLib name 'PdhGetDllVersion';
  2556. function PdhOpenQueryA; external PdhLib name 'PdhOpenQueryA';
  2557. function PdhOpenQueryW; external PdhLib name 'PdhOpenQueryW';
  2558. function PdhOpenQuery; external PdhLib name 'PdhOpenQuery' + AWSuffix;
  2559. function PdhAddCounterA; external PdhLib name 'PdhAddCounterA';
  2560. function PdhAddCounterW; external PdhLib name 'PdhAddCounterW';
  2561. function PdhAddCounter; external PdhLib name 'PdhAddCounter' + AWSuffix;
  2562. function PdhRemoveCounter; external PdhLib name 'PdhRemoveCounter';
  2563. function PdhCollectQueryData; external PdhLib name 'PdhCollectQueryData';
  2564. function PdhCloseQuery; external PdhLib name 'PdhCloseQuery';
  2565. function PdhGetFormattedCounterValue; external PdhLib name 'PdhGetFormattedCounterValue';
  2566. function PdhGetFormattedCounterArrayA; external PdhLib name 'PdhGetFormattedCounterArrayA';
  2567. function PdhGetFormattedCounterArrayW; external PdhLib name 'PdhGetFormattedCounterArrayW';
  2568. function PdhGetFormattedCounterArray; external PdhLib name 'PdhGetFormattedCounterArray' + AWSuffix;
  2569. function PdhGetRawCounterValue; external PdhLib name 'PdhGetRawCounterValue';
  2570. function PdhGetRawCounterArrayA; external PdhLib name 'PdhGetRawCounterArrayA';
  2571. function PdhGetRawCounterArrayW; external PdhLib name 'PdhGetRawCounterArrayW';
  2572. function PdhGetRawCounterArray; external PdhLib name 'PdhGetRawCounterArray' + AWSuffix;
  2573. function PdhCalculateCounterFromRawValue; external PdhLib name 'PdhCalculateCounterFromRawValue';
  2574. function PdhComputeCounterStatistics; external PdhLib name 'PdhComputeCounterStatistics';
  2575. function PdhGetCounterInfoA; external PdhLib name 'PdhGetCounterInfoA';
  2576. function PdhGetCounterInfoW; external PdhLib name 'PdhGetCounterInfoW';
  2577. function PdhGetCounterInfo; external PdhLib name 'PdhGetCounterInfo' + AWSuffix;
  2578. function PdhSetCounterScaleFactor; external PdhLib name 'PdhSetCounterScaleFactor';
  2579. function PdhConnectMachineA; external PdhLib name 'PdhConnectMachineA';
  2580. function PdhConnectMachineW; external PdhLib name 'PdhConnectMachineW';
  2581. function PdhConnectMachine; external PdhLib name 'PdhConnectMachine' + AWSuffix;
  2582. function PdhEnumMachinesA; external PdhLib name 'PdhEnumMachinesA';
  2583. function PdhEnumMachinesW; external PdhLib name 'PdhEnumMachinesW';
  2584. function PdhEnumMachines; external PdhLib name 'PdhEnumMachines' + AWSuffix;
  2585. function PdhEnumObjectsA; external PdhLib name 'PdhEnumObjectsA';
  2586. function PdhEnumObjectsW; external PdhLib name 'PdhEnumObjectsW';
  2587. function PdhEnumObjects; external PdhLib name 'PdhEnumObjects' + AWSuffix;
  2588. function PdhEnumObjectItemsA; external PdhLib name 'PdhEnumObjectItemsA';
  2589. function PdhEnumObjectItemsW; external PdhLib name 'PdhEnumObjectItemsW';
  2590. function PdhEnumObjectItems; external PdhLib name 'PdhEnumObjectItems' + AWSuffix;
  2591. function PdhMakeCounterPathA; external PdhLib name 'PdhMakeCounterPathA';
  2592. function PdhMakeCounterPathW; external PdhLib name 'PdhMakeCounterPathW';
  2593. function PdhMakeCounterPath; external PdhLib name 'PdhMakeCounterPath' + AWSuffix;
  2594. function PdhParseCounterPathA; external PdhLib name 'PdhParseCounterPathA';
  2595. function PdhParseCounterPathW; external PdhLib name 'PdhParseCounterPathW';
  2596. function PdhParseCounterPath; external PdhLib name 'PdhParseCounterPath' + AWSuffix;
  2597. function PdhParseInstanceNameA; external PdhLib name 'PdhParseInstanceNameA';
  2598. function PdhParseInstanceNameW; external PdhLib name 'PdhParseInstanceNameW';
  2599. function PdhParseInstanceName; external PdhLib name 'PdhParseInstanceName' + AWSuffix;
  2600. function PdhValidatePathA; external PdhLib name 'PdhValidatePathA';
  2601. function PdhValidatePathW; external PdhLib name 'PdhValidatePathW';
  2602. function PdhValidatePath; external PdhLib name 'PdhValidatePath' + AWSuffix;
  2603. function PdhGetDefaultPerfObjectA; external PdhLib name 'PdhGetDefaultPerfObjectA';
  2604. function PdhGetDefaultPerfObjectW; external PdhLib name 'PdhGetDefaultPerfObjectW';
  2605. function PdhGetDefaultPerfObject; external PdhLib name 'PdhGetDefaultPerfObject' + AWSuffix;
  2606. function PdhGetDefaultPerfCounterA; external PdhLib name 'PdhGetDefaultPerfCounterA';
  2607. function PdhGetDefaultPerfCounterW; external PdhLib name 'PdhGetDefaultPerfCounterW';
  2608. function PdhGetDefaultPerfCounter; external PdhLib name 'PdhGetDefaultPerfCounter' + AWSuffix;
  2609. function PdhBrowseCountersA; external PdhLib name 'PdhBrowseCountersA';
  2610. function PdhBrowseCountersW; external PdhLib name 'PdhBrowseCountersW';
  2611. function PdhBrowseCounters; external PdhLib name 'PdhBrowseCounters' + AWSuffix;
  2612. function PdhExpandCounterPathA; external PdhLib name 'PdhExpandCounterPathA';
  2613. function PdhExpandCounterPathW; external PdhLib name 'PdhExpandCounterPathW';
  2614. function PdhExpandCounterPath; external PdhLib name 'PdhExpandCounterPath' + AWSuffix;
  2615. function PdhLookupPerfNameByIndexA; external PdhLib name 'PdhLookupPerfNameByIndexA';
  2616. function PdhLookupPerfNameByIndexW; external PdhLib name 'PdhLookupPerfNameByIndexW';
  2617. function PdhLookupPerfNameByIndex; external PdhLib name 'PdhLookupPerfNameByIndex' + AWSuffix;
  2618. function PdhLookupPerfIndexByNameA; external PdhLib name 'PdhLookupPerfIndexByNameA';
  2619. function PdhLookupPerfIndexByNameW; external PdhLib name 'PdhLookupPerfIndexByNameW';
  2620. function PdhLookupPerfIndexByName; external PdhLib name 'PdhLookupPerfIndexByName' + AWSuffix;
  2621. function PdhExpandWildCardPathA; external PdhLib name 'PdhExpandWildCardPathA';
  2622. function PdhExpandWildCardPathW; external PdhLib name 'PdhExpandWildCardPathW';
  2623. function PdhExpandWildCardPath; external PdhLib name 'PdhExpandWildCardPath' + AWSuffix;
  2624. function PdhOpenLogA; external PdhLib name 'PdhOpenLogA';
  2625. function PdhOpenLogW; external PdhLib name 'PdhOpenLogW';
  2626. function PdhOpenLog; external PdhLib name 'PdhOpenLog' + AWSuffix;
  2627. function PdhUpdateLogA; external PdhLib name 'PdhUpdateLogA';
  2628. function PdhUpdateLogW; external PdhLib name 'PdhUpdateLogW';
  2629. function PdhUpdateLog; external PdhLib name 'PdhUpdateLog' + AWSuffix;
  2630. function PdhUpdateLogFileCatalog; external PdhLib name 'PdhUpdateLogFileCatalog';
  2631. function PdhGetLogFileSize; external PdhLib name 'PdhGetLogFileSize';
  2632. function PdhCloseLog; external PdhLib name 'PdhCloseLog';
  2633. function PdhSelectDataSourceA; external PdhLib name 'PdhSelectDataSourceA';
  2634. function PdhSelectDataSourceW; external PdhLib name 'PdhSelectDataSourceW';
  2635. function PdhSelectDataSource; external PdhLib name 'PdhSelectDataSource' + AWSuffix;
  2636. function PdhIsRealTimeQuery; external PdhLib name 'PdhIsRealTimeQuery';
  2637. function PdhSetQueryTimeRange; external PdhLib name 'PdhSetQueryTimeRange';
  2638. function PdhGetDataSourceTimeRangeA; external PdhLib name 'PdhGetDataSourceTimeRangeA';
  2639. function PdhGetDataSourceTimeRangeW; external PdhLib name 'PdhGetDataSourceTimeRangeW';
  2640. function PdhGetDataSourceTimeRange; external PdhLib name 'PdhGetDataSourceTimeRange' + AWSuffix;
  2641. function PdhCollectQueryDataEx; external PdhLib name 'PdhCollectQueryDataEx';
  2642. function PdhFormatFromRawValue; external PdhLib name 'PdhFormatFromRawValue';
  2643. function PdhGetCounterTimeBase; external PdhLib name 'PdhGetCounterTimeBase';
  2644. function PdhReadRawLogRecord; external PdhLib name 'PdhReadRawLogRecord';
  2645. function PdhSetDefaultRealTimeDataSource; external PdhLib name 'PdhSetDefaultRealTimeDataSource';
  2646. function PdhBindInputDataSourceW; external PdhLib name 'PdhBindInputDataSourceW';
  2647. function PdhBindInputDataSourceA; external PdhLib name 'PdhBindInputDataSourceA';
  2648. function PdhBindInputDataSource; external PdhLib name 'PdhBindInputDataSource' + AWSuffix;
  2649. function PdhOpenQueryH; external PdhLib name 'PdhOpenQueryH';
  2650. function PdhEnumMachinesHW; external PdhLib name 'PdhEnumMachinesHW';
  2651. function PdhEnumMachinesHA; external PdhLib name 'PdhEnumMachinesHA';
  2652. function PdhEnumMachinesH; external PdhLib name 'PdhEnumMachinesH' + AWSuffix;
  2653. function PdhEnumObjectsHW; external PdhLib name 'PdhEnumObjectsHW';
  2654. function PdhEnumObjectsHA; external PdhLib name 'PdhEnumObjectsHA';
  2655. function PdhEnumObjectsH; external PdhLib name 'PdhEnumObjectsH' + AWSuffix;
  2656. function PdhEnumObjectItemsHW; external PdhLib name 'PdhEnumObjectItemsHW';
  2657. function PdhEnumObjectItemsHA; external PdhLib name 'PdhEnumObjectItemsHA';
  2658. function PdhEnumObjectItemsH; external PdhLib name 'PdhEnumObjectItemsH' + AWSuffix;
  2659. function PdhExpandWildCardPathHW; external PdhLib name 'PdhExpandWildCardPathHW';
  2660. function PdhExpandWildCardPathHA; external PdhLib name 'PdhExpandWildCardPathHA';
  2661. function PdhExpandWildCardPathH; external PdhLib name 'PdhExpandWildCardPathH' + AWSuffix;
  2662. function PdhGetDataSourceTimeRangeH; external PdhLib name 'PdhGetDataSourceTimeRangeH';
  2663. function PdhGetDefaultPerfObjectHW; external PdhLib name 'PdhGetDefaultPerfObjectHW';
  2664. function PdhGetDefaultPerfObjectHA; external PdhLib name 'PdhGetDefaultPerfObjectHA';
  2665. function PdhGetDefaultPerfObjectH; external PdhLib name 'PdhGetDefaultPerfObjectH' + AWSuffix;
  2666. function PdhGetDefaultPerfCounterHW; external PdhLib name 'PdhGetDefaultPerfCounterHW';
  2667. function PdhGetDefaultPerfCounterHA; external PdhLib name 'PdhGetDefaultPerfCounterHA';
  2668. function PdhGetDefaultPerfCounterH; external PdhLib name 'PdhGetDefaultPerfCounterH' + AWSuffix;
  2669. function PdhBrowseCountersHW; external PdhLib name 'PdhBrowseCountersHW';
  2670. function PdhBrowseCountersHA; external PdhLib name 'PdhBrowseCountersHA';
  2671. function PdhBrowseCountersH; external PdhLib name 'PdhBrowseCountersH' + AWSuffix;
  2672. function PdhVerifySQLDBW; external PdhLib name 'PdhVerifySQLDBW';
  2673. function PdhVerifySQLDBA; external PdhLib name 'PdhVerifySQLDBA';
  2674. function PdhVerifySQLDB; external PdhLib name 'PdhVerifySQLDB' + AWSuffix;
  2675. function PdhCreateSQLTablesW; external PdhLib name 'PdhCreateSQLTablesW';
  2676. function PdhCreateSQLTablesA; external PdhLib name 'PdhCreateSQLTablesA';
  2677. function PdhCreateSQLTables; external PdhLib name 'PdhCreateSQLTables' + AWSuffix;
  2678. function PdhEnumLogSetNamesW; external PdhLib name 'PdhEnumLogSetNamesW';
  2679. function PdhEnumLogSetNamesA; external PdhLib name 'PdhEnumLogSetNamesA';
  2680. function PdhEnumLogSetNames; external PdhLib name 'PdhEnumLogSetNames' + AWSuffix;
  2681. function PdhGetLogSetGUID; external PdhLib name 'PdhGetLogSetGUID';
  2682. function PdhSetLogSetRunID; external PdhLib name 'PdhSetLogSetRunID';
  2683. {$ENDIF DYNAMIC_LINK}
  2684. end.