jwapdh.pas 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099
  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. unit JwaPdh;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "pdh.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaWinBase, JwaWinType, JwaWinPerf;
  51. type
  52. PDH_STATUS = DWORD;
  53. {$EXTERNALSYM PDH_STATUS}
  54. const
  55. // version info
  56. PDH_CVERSION_WIN40 = DWORD($0400);
  57. {$EXTERNALSYM PDH_CVERSION_WIN40}
  58. PDH_CVERSION_WIN50 = DWORD($0500);
  59. {$EXTERNALSYM PDH_CVERSION_WIN50}
  60. // v1.1 revision of PDH -- basic log functions
  61. // v1.2 of the PDH -- adds variable instance counters
  62. // v1.3 of the PDH -- adds log service control & stubs for NT5/PDH v2 fn's
  63. // v2.0 of the PDH -- is the NT v 5.0 B2 version
  64. PDH_VERSION = DWORD((PDH_CVERSION_WIN50) + $0003);
  65. {$EXTERNALSYM PDH_VERSION}
  66. // define severity masks
  67. function IsSuccessSeverity(ErrorCode: Longint): Boolean;
  68. {$EXTERNALSYM IsSuccessSeverity}
  69. function IsInformationalSeverity(ErrorCode: Longint): Boolean;
  70. {$EXTERNALSYM IsInformationalSeverity}
  71. function IsWarningSeverity(ErrorCode: Longint): Boolean;
  72. {$EXTERNALSYM IsWarningSeverity}
  73. function IsErrorSeverity(ErrorCode: Longint): Boolean;
  74. {$EXTERNALSYM IsErrorSeverity}
  75. const
  76. MAX_COUNTER_PATH = 256; // Maximum counter path length
  77. {$EXTERNALSYM MAX_COUNTER_PATH}
  78. PDH_MAX_COUNTER_NAME = 1024; // Maximum counter name length.
  79. {$EXTERNALSYM PDH_MAX_COUNTER_NAME}
  80. PDH_MAX_INSTANCE_NAME = 1024; // Maximum counter instance name length.
  81. {$EXTERNALSYM PDH_MAX_INSTANCE_NAME}
  82. PDH_MAX_COUNTER_PATH = 2048; // Maximum full counter path length.
  83. {$EXTERNALSYM PDH_MAX_COUNTER_PATH}
  84. PDH_MAX_DATASOURCE_PATH = 1024; // MAximum full counter log name length.
  85. {$EXTERNALSYM PDH_MAX_DATASOURCE_PATH}
  86. // data type definitions
  87. type
  88. PDH_HCOUNTER = HANDLE;
  89. {$EXTERNALSYM PDH_HCOUNTER}
  90. PDH_HQUERY = HANDLE;
  91. {$EXTERNALSYM PDH_HQUERY}
  92. PDH_HLOG = HANDLE;
  93. {$EXTERNALSYM PDH_HLOG}
  94. HCOUNTER = PDH_HCOUNTER;
  95. {$EXTERNALSYM HCOUNTER}
  96. HQUERY = PDH_HQUERY;
  97. {$EXTERNALSYM HQUERY}
  98. HLOG = PDH_HLOG;
  99. {$EXTERNALSYM HLOG}
  100. const
  101. INVALID_HANDLE_VALUE = HANDLE(LONG_PTR(-1));
  102. {$EXTERNALSYM INVALID_HANDLE_VALUE}
  103. H_REALTIME_DATASOURCE = NULL;
  104. {$EXTERNALSYM H_REALTIME_DATASOURCE}
  105. H_WBEM_DATASOURCE = INVALID_HANDLE_VALUE;
  106. {$EXTERNALSYM H_WBEM_DATASOURCE}
  107. type
  108. PPDH_RAW_COUNTER = ^PDH_RAW_COUNTER;
  109. {$EXTERNALSYM PPDH_RAW_COUNTER}
  110. _PDH_RAW_COUNTER = record
  111. CStatus: DWORD;
  112. TimeStamp: FILETIME;
  113. FirstValue: LONGLONG;
  114. SecondValue: LONGLONG;
  115. MultiCount: DWORD;
  116. end;
  117. {$EXTERNALSYM _PDH_RAW_COUNTER}
  118. PDH_RAW_COUNTER = _PDH_RAW_COUNTER;
  119. {$EXTERNALSYM PDH_RAW_COUNTER}
  120. TPdhRawCounter = PDH_RAW_COUNTER;
  121. PPdhRawCounter = PPDH_RAW_COUNTER;
  122. PPDH_RAW_COUNTER_ITEM_A = ^PDH_RAW_COUNTER_ITEM_A;
  123. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM_A}
  124. _PDH_RAW_COUNTER_ITEM_A = record
  125. szName: LPSTR;
  126. RawValue: PDH_RAW_COUNTER;
  127. end;
  128. {$EXTERNALSYM _PDH_RAW_COUNTER_ITEM_A}
  129. PDH_RAW_COUNTER_ITEM_A = _PDH_RAW_COUNTER_ITEM_A;
  130. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM_A}
  131. TPdhRawCounterItemA = PDH_RAW_COUNTER_ITEM_A;
  132. PPdhRawCounterItemA = PPDH_RAW_COUNTER_ITEM_A;
  133. PPDH_RAW_COUNTER_ITEM_W = ^PDH_RAW_COUNTER_ITEM_W;
  134. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM_W}
  135. _PDH_RAW_COUNTER_ITEM_W = record
  136. szName: LPWSTR;
  137. RawValue: PDH_RAW_COUNTER;
  138. end;
  139. {$EXTERNALSYM _PDH_RAW_COUNTER_ITEM_W}
  140. PDH_RAW_COUNTER_ITEM_W = _PDH_RAW_COUNTER_ITEM_W;
  141. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM_W}
  142. TPdhRawCounterItemW = PDH_RAW_COUNTER_ITEM_W;
  143. PPdhRawCounterItemW = PPDH_RAW_COUNTER_ITEM_W;
  144. {$IFDEF UNICODE}
  145. PPdhRawCounterItem = PPdhRawCounterItemW;
  146. PDH_RAW_COUNTER_ITEM = _PDH_RAW_COUNTER_ITEM_W;
  147. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM}
  148. PPDH_RAW_COUNTER_ITEM = PPDH_RAW_COUNTER_ITEM_W;
  149. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM}
  150. TPdhRawCounterItem = _PDH_RAW_COUNTER_ITEM_W;
  151. {$ELSE}
  152. PPdhRawCounterItem = PPdhRawCounterItemA;
  153. PDH_RAW_COUNTER_ITEM = _PDH_RAW_COUNTER_ITEM_A;
  154. {$EXTERNALSYM PDH_RAW_COUNTER_ITEM}
  155. PPDH_RAW_COUNTER_ITEM = PPDH_RAW_COUNTER_ITEM_A;
  156. {$EXTERNALSYM PPDH_RAW_COUNTER_ITEM}
  157. TPdhRawCounterItem = _PDH_RAW_COUNTER_ITEM_A;
  158. {$ENDIF UNICODE}
  159. PPDH_FMT_COUNTERVALUE = ^PDH_FMT_COUNTERVALUE;
  160. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE}
  161. _PDH_FMT_COUNTERVALUE = record
  162. CStatus: DWORD;
  163. case Longint of
  164. 1: (longValue: LONG);
  165. 2: (doubleValue: Double);
  166. 3: (largeValue: LONGLONG);
  167. 4: (AnsiStringValue: LPSTR);
  168. 5: (WideStringValue: LPCWSTR);
  169. end;
  170. {$EXTERNALSYM _PDH_FMT_COUNTERVALUE}
  171. PDH_FMT_COUNTERVALUE = _PDH_FMT_COUNTERVALUE;
  172. {$EXTERNALSYM PDH_FMT_COUNTERVALUE}
  173. TPdhFmtCounterValue = PDH_FMT_COUNTERVALUE;
  174. PPdhFmtCounterValue = PPDH_FMT_COUNTERVALUE;
  175. PPDH_FMT_COUNTERVALUE_ITEM_A = ^PDH_FMT_COUNTERVALUE_ITEM_A;
  176. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM_A}
  177. _PDH_FMT_COUNTERVALUE_ITEM_A = record
  178. szName: LPSTR;
  179. FmtValue: PDH_FMT_COUNTERVALUE;
  180. end;
  181. {$EXTERNALSYM _PDH_FMT_COUNTERVALUE_ITEM_A}
  182. PDH_FMT_COUNTERVALUE_ITEM_A = _PDH_FMT_COUNTERVALUE_ITEM_A;
  183. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM_A}
  184. TPdhFmtCounterValueItemA = PDH_FMT_COUNTERVALUE_ITEM_A;
  185. PPdhFmtCounterValueItemA = PPDH_FMT_COUNTERVALUE_ITEM_A;
  186. PPDH_FMT_COUNTERVALUE_ITEM_W = ^PDH_FMT_COUNTERVALUE_ITEM_W;
  187. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM_W}
  188. _PDH_FMT_COUNTERVALUE_ITEM_W = record
  189. szName: LPWSTR;
  190. FmtValue: PDH_FMT_COUNTERVALUE;
  191. end;
  192. {$EXTERNALSYM _PDH_FMT_COUNTERVALUE_ITEM_W}
  193. PDH_FMT_COUNTERVALUE_ITEM_W = _PDH_FMT_COUNTERVALUE_ITEM_W;
  194. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM_W}
  195. TPdhFmtCounterValueItemW = PDH_FMT_COUNTERVALUE_ITEM_W;
  196. PPdhFmtCounterValueItemW = PPDH_FMT_COUNTERVALUE_ITEM_W;
  197. {$IFDEF UNICODE}
  198. PPdhFmtCounterValueItem = PPdhFmtCounterValueItemW;
  199. PDH_FMT_COUNTERVALUE_ITEM = _PDH_FMT_COUNTERVALUE_ITEM_W;
  200. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM}
  201. PPDH_FMT_COUNTERVALUE_ITEM = PPDH_FMT_COUNTERVALUE_ITEM_W;
  202. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM}
  203. TPdhFmtCounterValueItem = _PDH_FMT_COUNTERVALUE_ITEM_W;
  204. {$ELSE}
  205. PPdhFmtCounterValueItem = PPdhFmtCounterValueItemA;
  206. PDH_FMT_COUNTERVALUE_ITEM = _PDH_FMT_COUNTERVALUE_ITEM_A;
  207. {$EXTERNALSYM PDH_FMT_COUNTERVALUE_ITEM}
  208. PPDH_FMT_COUNTERVALUE_ITEM = PPDH_FMT_COUNTERVALUE_ITEM_A;
  209. {$EXTERNALSYM PPDH_FMT_COUNTERVALUE_ITEM}
  210. TPdhFmtCounterValueItem = _PDH_FMT_COUNTERVALUE_ITEM_A;
  211. {$ENDIF UNICODE}
  212. PPDH_STATISTICS = ^PDH_STATISTICS;
  213. {$EXTERNALSYM PPDH_STATISTICS}
  214. _PDH_STATISTICS = record
  215. dwFormat: DWORD;
  216. Count: DWORD;
  217. min: PDH_FMT_COUNTERVALUE;
  218. max: PDH_FMT_COUNTERVALUE;
  219. mean: PDH_FMT_COUNTERVALUE;
  220. end;
  221. {$EXTERNALSYM _PDH_STATISTICS}
  222. PDH_STATISTICS = _PDH_STATISTICS;
  223. {$EXTERNALSYM PDH_STATISTICS}
  224. TPdhStatistics = PDH_STATISTICS;
  225. PPdhStatistics = PPDH_STATISTICS;
  226. PPDH_COUNTER_PATH_ELEMENTS_A = ^PDH_COUNTER_PATH_ELEMENTS_A;
  227. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS_A}
  228. _PDH_COUNTER_PATH_ELEMENTS_A = record
  229. szMachineName: LPSTR;
  230. szObjectName: LPSTR;
  231. szInstanceName: LPSTR;
  232. szParentInstance: LPSTR;
  233. dwInstanceIndex: DWORD;
  234. szCounterName: LPSTR;
  235. end;
  236. {$EXTERNALSYM _PDH_COUNTER_PATH_ELEMENTS_A}
  237. PDH_COUNTER_PATH_ELEMENTS_A = _PDH_COUNTER_PATH_ELEMENTS_A;
  238. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS_A}
  239. TPdhCounterPathElementsA = PDH_COUNTER_PATH_ELEMENTS_A;
  240. PPdhCounterPathElementsA = PPDH_COUNTER_PATH_ELEMENTS_A;
  241. PPDH_COUNTER_PATH_ELEMENTS_W = ^PDH_COUNTER_PATH_ELEMENTS_W;
  242. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS_W}
  243. _PDH_COUNTER_PATH_ELEMENTS_W = record
  244. szMachineName: LPWSTR;
  245. szObjectName: LPWSTR;
  246. szInstanceName: LPWSTR;
  247. szParentInstance: LPWSTR;
  248. dwInstanceIndex: DWORD;
  249. szCounterName: LPWSTR;
  250. end;
  251. {$EXTERNALSYM _PDH_COUNTER_PATH_ELEMENTS_W}
  252. PDH_COUNTER_PATH_ELEMENTS_W = _PDH_COUNTER_PATH_ELEMENTS_W;
  253. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS_W}
  254. TPdhCounterPathElementsW = PDH_COUNTER_PATH_ELEMENTS_W;
  255. PPdhCounterPathElementsW = PPDH_COUNTER_PATH_ELEMENTS_W;
  256. {$IFDEF UNICODE}
  257. PPdhCounterPathElements = PPdhCounterPathElementsW;
  258. PDH_COUNTER_PATH_ELEMENTS = _PDH_COUNTER_PATH_ELEMENTS_W;
  259. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS}
  260. PPDH_COUNTER_PATH_ELEMENTS = PPDH_COUNTER_PATH_ELEMENTS_W;
  261. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS}
  262. TPdhCounterPathElements = _PDH_COUNTER_PATH_ELEMENTS_W;
  263. {$ELSE}
  264. PPdhCounterPathElements = PPdhCounterPathElementsA;
  265. PDH_COUNTER_PATH_ELEMENTS = _PDH_COUNTER_PATH_ELEMENTS_A;
  266. {$EXTERNALSYM PDH_COUNTER_PATH_ELEMENTS}
  267. PPDH_COUNTER_PATH_ELEMENTS = PPDH_COUNTER_PATH_ELEMENTS_A;
  268. {$EXTERNALSYM PPDH_COUNTER_PATH_ELEMENTS}
  269. TPdhCounterPathElements = _PDH_COUNTER_PATH_ELEMENTS_A;
  270. {$ENDIF UNICODE}
  271. PPDH_DATA_ITEM_PATH_ELEMENTS_A = ^PDH_DATA_ITEM_PATH_ELEMENTS_A;
  272. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS_A}
  273. _PDH_DATA_ITEM_PATH_ELEMENTS_A = record
  274. szMachineName: LPSTR;
  275. ObjectGUID: GUID;
  276. dwItemId: DWORD;
  277. szInstanceName: LPSTR;
  278. end;
  279. {$EXTERNALSYM _PDH_DATA_ITEM_PATH_ELEMENTS_A}
  280. PDH_DATA_ITEM_PATH_ELEMENTS_A = _PDH_DATA_ITEM_PATH_ELEMENTS_A;
  281. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS_A}
  282. TPdhDataItemPathElementsA = PDH_DATA_ITEM_PATH_ELEMENTS_A;
  283. PPdhDataItemPathElementsA = PPDH_DATA_ITEM_PATH_ELEMENTS_A;
  284. PPDH_DATA_ITEM_PATH_ELEMENTS_W = ^PDH_DATA_ITEM_PATH_ELEMENTS_W;
  285. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS_W}
  286. _PDH_DATA_ITEM_PATH_ELEMENTS_W = record
  287. szMachineName: LPWSTR;
  288. ObjectGUID: GUID;
  289. dwItemId: DWORD;
  290. szInstanceName: LPWSTR;
  291. end;
  292. {$EXTERNALSYM _PDH_DATA_ITEM_PATH_ELEMENTS_W}
  293. PDH_DATA_ITEM_PATH_ELEMENTS_W = _PDH_DATA_ITEM_PATH_ELEMENTS_W;
  294. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS_W}
  295. TPdhDataItemPathElementsW = PDH_DATA_ITEM_PATH_ELEMENTS_W;
  296. PPdhDataItemPathElementsW = PPDH_DATA_ITEM_PATH_ELEMENTS_W;
  297. {$IFDEF UNICODE}
  298. PPdhDataItemPathElements = PPdhDataItemPathElementsW;
  299. PDH_DATA_ITEM_PATH_ELEMENTS = _PDH_DATA_ITEM_PATH_ELEMENTS_W;
  300. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS}
  301. PPDH_DATA_ITEM_PATH_ELEMENTS = PPDH_DATA_ITEM_PATH_ELEMENTS_W;
  302. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS}
  303. TPdhDataItemPathElements = _PDH_DATA_ITEM_PATH_ELEMENTS_W;
  304. {$ELSE}
  305. PPdhDataItemPathElements = PPdhDataItemPathElementsA;
  306. PDH_DATA_ITEM_PATH_ELEMENTS = _PDH_DATA_ITEM_PATH_ELEMENTS_A;
  307. {$EXTERNALSYM PDH_DATA_ITEM_PATH_ELEMENTS}
  308. PPDH_DATA_ITEM_PATH_ELEMENTS = PPDH_DATA_ITEM_PATH_ELEMENTS_A;
  309. {$EXTERNALSYM PPDH_DATA_ITEM_PATH_ELEMENTS}
  310. TPdhDataItemPathElements = _PDH_DATA_ITEM_PATH_ELEMENTS_A;
  311. {$ENDIF UNICODE}
  312. PPDH_COUNTER_INFO_A = ^PDH_COUNTER_INFO_A;
  313. {$EXTERNALSYM PPDH_COUNTER_INFO_A}
  314. _PDH_COUNTER_INFO_A = record
  315. dwLength: DWORD;
  316. dwType: DWORD;
  317. CVersion: DWORD;
  318. CStatus: DWORD;
  319. lScale: LONG;
  320. lDefaultScale: LONG;
  321. dwUserData: DWORD_PTR;
  322. dwQueryUserData: DWORD_PTR;
  323. szFullPath: LPSTR;
  324. Union: record
  325. case Longint of
  326. 1: (DataItemPath: PDH_DATA_ITEM_PATH_ELEMENTS_A);
  327. 2: (CounterPath: PDH_COUNTER_PATH_ELEMENTS_A);
  328. 3: (szMachineName: LPSTR;
  329. szObjectName: LPSTR;
  330. szInstanceName: LPSTR;
  331. szParentInstance: LPSTR;
  332. dwInstanceIndex: DWORD;
  333. szCounterName: LPSTR);
  334. end;
  335. szExplainText: LPSTR;
  336. DataBuffer: array [0..0] of DWORD;
  337. end;
  338. {$EXTERNALSYM _PDH_COUNTER_INFO_A}
  339. PDH_COUNTER_INFO_A = _PDH_COUNTER_INFO_A;
  340. {$EXTERNALSYM PDH_COUNTER_INFO_A}
  341. TPdhCounterInfoA = PDH_COUNTER_INFO_A;
  342. PPdhCounterInfoA = PPDH_COUNTER_INFO_A;
  343. PPDH_COUNTER_INFO_W = ^PDH_COUNTER_INFO_W;
  344. {$EXTERNALSYM PPDH_COUNTER_INFO_W}
  345. _PDH_COUNTER_INFO_W = record
  346. dwLength: DWORD;
  347. dwType: DWORD;
  348. CVersion: DWORD;
  349. CStatus: DWORD;
  350. lScale: LONG;
  351. lDefaultScale: LONG;
  352. dwUserData: DWORD_PTR;
  353. dwQueryUserData: DWORD_PTR;
  354. szFullPath: LPWSTR;
  355. Union: record
  356. case Longint of
  357. 1: (DataItemPath: PDH_DATA_ITEM_PATH_ELEMENTS_W);
  358. 2: (CounterPath: PDH_COUNTER_PATH_ELEMENTS_W);
  359. 3: (szMachineName: LPWSTR;
  360. szObjectName: LPWSTR;
  361. szInstanceName: LPWSTR;
  362. szParentInstance: LPWSTR;
  363. dwInstanceIndex: DWORD;
  364. szCounterName: LPWSTR);
  365. end;
  366. szExplainText: LPWSTR;
  367. DataBuffer: array [0..0] of DWORD;
  368. end;
  369. {$EXTERNALSYM _PDH_COUNTER_INFO_W}
  370. PDH_COUNTER_INFO_W = _PDH_COUNTER_INFO_W;
  371. {$EXTERNALSYM PDH_COUNTER_INFO_W}
  372. TPdhCounterInfoW = PDH_COUNTER_INFO_W;
  373. PPdhCounterInfoW = PPDH_COUNTER_INFO_W;
  374. {$IFDEF UNICODE}
  375. PPdhCounterInfo = PPdhCounterInfoW;
  376. PDH_COUNTER_INFO = _PDH_COUNTER_INFO_W;
  377. {$EXTERNALSYM PDH_COUNTER_INFO}
  378. PPDH_COUNTER_INFO = PPDH_COUNTER_INFO_W;
  379. {$EXTERNALSYM PPDH_COUNTER_INFO}
  380. TPdhCounterInfo = _PDH_COUNTER_INFO_W;
  381. {$ELSE}
  382. PPdhCounterInfo = PPdhCounterInfoA;
  383. PDH_COUNTER_INFO = _PDH_COUNTER_INFO_A;
  384. {$EXTERNALSYM PDH_COUNTER_INFO}
  385. PPDH_COUNTER_INFO = PPDH_COUNTER_INFO_A;
  386. {$EXTERNALSYM PPDH_COUNTER_INFO}
  387. TPdhCounterInfo = _PDH_COUNTER_INFO_A;
  388. {$ENDIF UNICODE}
  389. PPDH_TIME_INFO = ^PDH_TIME_INFO;
  390. {$EXTERNALSYM PPDH_TIME_INFO}
  391. _PDH_TIME_INFO = record
  392. StartTime: LONGLONG;
  393. EndTime: LONGLONG;
  394. SampleCount: DWORD;
  395. end;
  396. {$EXTERNALSYM _PDH_TIME_INFO}
  397. PDH_TIME_INFO = _PDH_TIME_INFO;
  398. {$EXTERNALSYM PDH_TIME_INFO}
  399. TPdhTimeInfo = PDH_TIME_INFO;
  400. PPdhTimeInfo = PPDH_TIME_INFO;
  401. PPDH_RAW_LOG_RECORD = ^PDH_RAW_LOG_RECORD;
  402. {$EXTERNALSYM PPDH_RAW_LOG_RECORD}
  403. _PDH_RAW_LOG_RECORD = record
  404. dwStructureSize: DWORD;
  405. dwRecordType: DWORD;
  406. dwItems: DWORD;
  407. RawBytes: array [0..0] of UCHAR;
  408. end;
  409. {$EXTERNALSYM _PDH_RAW_LOG_RECORD}
  410. PDH_RAW_LOG_RECORD = _PDH_RAW_LOG_RECORD;
  411. {$EXTERNALSYM PDH_RAW_LOG_RECORD}
  412. TPdhRawLogRecord = PDH_RAW_LOG_RECORD;
  413. PPdhRawLogRecord = PPDH_RAW_LOG_RECORD;
  414. PPDH_LOG_SERVICE_QUERY_INFO_A = ^PDH_LOG_SERVICE_QUERY_INFO_A;
  415. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO_A}
  416. _PDH_LOG_SERVICE_QUERY_INFO_A = record
  417. dwSize: DWORD;
  418. dwFlags: DWORD;
  419. dwLogQuota: DWORD;
  420. szLogFileCaption: LPSTR;
  421. szDefaultDir: LPSTR;
  422. szBaseFileName: LPSTR;
  423. dwFileType: DWORD;
  424. dwReserved: DWORD;
  425. Union: record
  426. case Longint of
  427. 1: (PdlAutoNameInterval: DWORD;
  428. PdlAutoNameUnits: DWORD;
  429. PdlCommandFilename: LPSTR;
  430. PdlCounterList: LPSTR;
  431. PdlAutoNameFormat: DWORD;
  432. PdlSampleInterval: DWORD;
  433. PdlLogStartTime: FILETIME;
  434. PdlLogEndTime: FILETIME);
  435. 2: (TlNumberOfBuffers: DWORD;
  436. TlMinimumBuffers: DWORD;
  437. TlMaximumBuffers: DWORD;
  438. TlFreeBuffers: DWORD;
  439. TlBufferSize: DWORD;
  440. TlEventsLost: DWORD;
  441. TlLoggerThreadId: DWORD;
  442. TlBuffersWritten: DWORD;
  443. TlLogHandle: DWORD;
  444. TlLogFileName: LPSTR);
  445. end;
  446. end;
  447. {$EXTERNALSYM _PDH_LOG_SERVICE_QUERY_INFO_A}
  448. PDH_LOG_SERVICE_QUERY_INFO_A = _PDH_LOG_SERVICE_QUERY_INFO_A;
  449. {$EXTERNALSYM _PDH_LOG_SERVICE_QUERY_INFO_A}
  450. TPdhLogServiceQueryInfoA = PDH_LOG_SERVICE_QUERY_INFO_A;
  451. PPdhLogServiceQueryInfoA = PPDH_LOG_SERVICE_QUERY_INFO_A;
  452. PPDH_LOG_SERVICE_QUERY_INFO_W = ^PDH_LOG_SERVICE_QUERY_INFO_W;
  453. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO_W}
  454. _PDH_LOG_SERVICE_QUERY_INFO_W = record
  455. dwSize: DWORD;
  456. dwFlags: DWORD;
  457. dwLogQuota: DWORD;
  458. szLogFileCaption: LPWSTR;
  459. szDefaultDir: LPWSTR;
  460. szBaseFileName: LPWSTR;
  461. dwFileType: DWORD;
  462. dwReserved: DWORD;
  463. Union: record
  464. case Longint of
  465. 1: (PdlAutoNameInterval: DWORD;
  466. PdlAutoNameUnits: DWORD;
  467. PdlCommandFilename: LPWSTR;
  468. PdlCounterList: LPWSTR;
  469. PdlAutoNameFormat: DWORD;
  470. PdlSampleInterval: DWORD;
  471. PdlLogStartTime: FILETIME;
  472. PdlLogEndTime: FILETIME);
  473. 2: (TlNumberOfBuffers: DWORD;
  474. TlMinimumBuffers: DWORD;
  475. TlMaximumBuffers: DWORD;
  476. TlFreeBuffers: DWORD;
  477. TlBufferSize: DWORD;
  478. TlEventsLost: DWORD;
  479. TlLoggerThreadId: DWORD;
  480. TlBuffersWritten: DWORD;
  481. TlLogHandle: DWORD;
  482. TlLogFileName: LPWSTR);
  483. end;
  484. end;
  485. {$EXTERNALSYM _PDH_LOG_SERVICE_QUERY_INFO_W}
  486. PDH_LOG_SERVICE_QUERY_INFO_W = _PDH_LOG_SERVICE_QUERY_INFO_W;
  487. {$EXTERNALSYM PDH_LOG_SERVICE_QUERY_INFO_W}
  488. TPdhLogServiceQueryInfoW = PDH_LOG_SERVICE_QUERY_INFO_W;
  489. PPdhLogServiceQueryInfoW = PPDH_LOG_SERVICE_QUERY_INFO_W;
  490. {$IFDEF UNICODE}
  491. PPdhLogServiceQueryInfo = PPdhLogServiceQueryInfoW;
  492. PDH_LOG_SERVICE_QUERY_INFO = _PDH_LOG_SERVICE_QUERY_INFO_W;
  493. {$EXTERNALSYM PDH_LOG_SERVICE_QUERY_INFO}
  494. PPDH_LOG_SERVICE_QUERY_INFO = PPDH_LOG_SERVICE_QUERY_INFO_W;
  495. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO}
  496. TPdhLogServiceQueryInfo = _PDH_LOG_SERVICE_QUERY_INFO_W;
  497. {$ELSE}
  498. PPdhLogServiceQueryInfo = PPdhLogServiceQueryInfoA;
  499. PDH_LOG_SERVICE_QUERY_INFO = _PDH_LOG_SERVICE_QUERY_INFO_A;
  500. {$EXTERNALSYM PDH_LOG_SERVICE_QUERY_INFO}
  501. PPDH_LOG_SERVICE_QUERY_INFO = PPDH_LOG_SERVICE_QUERY_INFO_A;
  502. {$EXTERNALSYM PPDH_LOG_SERVICE_QUERY_INFO}
  503. TPdhLogServiceQueryInfo = _PDH_LOG_SERVICE_QUERY_INFO_A;
  504. {$ENDIF UNICODE}
  505. //
  506. // Time value constants
  507. //
  508. const
  509. MAX_TIME_VALUE = LONGLONG($7FFFFFFFFFFFFFFF);
  510. {$EXTERNALSYM MAX_TIME_VALUE}
  511. MIN_TIME_VALUE = LONGLONG(0);
  512. {$EXTERNALSYM MIN_TIME_VALUE}
  513. // function definitions
  514. function PdhGetDllVersion(var lpdwVersion: DWORD): PDH_STATUS; stdcall;
  515. {$EXTERNALSYM PdhGetDllVersion}
  516. //
  517. // Query Functions
  518. //
  519. function PdhOpenQueryA(szDataSource: LPCSTR; dwUserData: DWORD_PTR;
  520. var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  521. {$EXTERNALSYM PdhOpenQueryA}
  522. function PdhOpenQueryW(szDataSource: LPCWSTR; dwUserData: DWORD_PTR;
  523. var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  524. {$EXTERNALSYM PdhOpenQueryW}
  525. function PdhOpenQuery(szDataSource: LPCTSTR; dwUserData: DWORD_PTR;
  526. var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  527. {$EXTERNALSYM PdhOpenQuery}
  528. function PdhAddCounterA(hQuery: PDH_HQUERY; szFullCounterPath: LPCSTR;
  529. dwUserData: DWORD_PTR; var phCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  530. {$EXTERNALSYM PdhAddCounterA}
  531. function PdhAddCounterW(hQuery: PDH_HQUERY; szFullCounterPath: LPCWSTR;
  532. dwUserData: DWORD_PTR; var phCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  533. {$EXTERNALSYM PdhAddCounterW}
  534. function PdhAddCounter(hQuery: PDH_HQUERY; szFullCounterPath: LPCTSTR;
  535. dwUserData: DWORD_PTR; var phCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  536. {$EXTERNALSYM PdhAddCounter}
  537. function PdhRemoveCounter(hCounter: PDH_HCOUNTER): PDH_STATUS; stdcall;
  538. {$EXTERNALSYM PdhRemoveCounter}
  539. function PdhCollectQueryData(hQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  540. {$EXTERNALSYM PdhCollectQueryData}
  541. function PdhCloseQuery(hQuery: PDH_HQUERY): PDH_STATUS; stdcall;
  542. {$EXTERNALSYM PdhCloseQuery}
  543. //
  544. // Counter Functions
  545. //
  546. function PdhGetFormattedCounterValue(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  547. lpdwType: LPDWORD; var pValue: PDH_FMT_COUNTERVALUE): PDH_STATUS; stdcall;
  548. {$EXTERNALSYM PdhGetFormattedCounterValue}
  549. function PdhGetFormattedCounterArrayA(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  550. var lpdwBufferSize, lpdwItemCount: DWORD;
  551. var ItemBuffer: PDH_FMT_COUNTERVALUE_ITEM_A): PDH_STATUS; stdcall;
  552. {$EXTERNALSYM PdhGetFormattedCounterArrayA}
  553. function PdhGetFormattedCounterArrayW(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  554. var lpdwBufferSize, lpdwItemCount: DWORD;
  555. var ItemBuffer: PDH_FMT_COUNTERVALUE_ITEM_W): PDH_STATUS; stdcall;
  556. {$EXTERNALSYM PdhGetFormattedCounterArrayW}
  557. function PdhGetFormattedCounterArray(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  558. var lpdwBufferSize, lpdwItemCount: DWORD;
  559. var ItemBuffer: PDH_FMT_COUNTERVALUE_ITEM): PDH_STATUS; stdcall;
  560. {$EXTERNALSYM PdhGetFormattedCounterArray}
  561. // dwFormat flag values
  562. const
  563. PDH_FMT_RAW = DWORD($00000010);
  564. {$EXTERNALSYM PDH_FMT_RAW}
  565. PDH_FMT_ANSI = DWORD($00000020);
  566. {$EXTERNALSYM PDH_FMT_ANSI}
  567. PDH_FMT_UNICODE = DWORD($00000040);
  568. {$EXTERNALSYM PDH_FMT_UNICODE}
  569. PDH_FMT_LONG = DWORD($00000100);
  570. {$EXTERNALSYM PDH_FMT_LONG}
  571. PDH_FMT_DOUBLE = DWORD($00000200);
  572. {$EXTERNALSYM PDH_FMT_DOUBLE}
  573. PDH_FMT_LARGE = DWORD($00000400);
  574. {$EXTERNALSYM PDH_FMT_LARGE}
  575. PDH_FMT_NOSCALE = DWORD($00001000);
  576. {$EXTERNALSYM PDH_FMT_NOSCALE}
  577. PDH_FMT_1000 = DWORD($00002000);
  578. {$EXTERNALSYM PDH_FMT_1000}
  579. PDH_FMT_NODATA = DWORD($00004000);
  580. {$EXTERNALSYM PDH_FMT_NODATA}
  581. PDH_FMT_NOCAP100 = DWORD($00008000);
  582. {$EXTERNALSYM PDH_FMT_NODATA}
  583. PERF_DETAIL_COSTLY = DWORD($00010000);
  584. {$EXTERNALSYM PERF_DETAIL_COSTLY}
  585. PERF_DETAIL_STANDARD = DWORD($0000FFFF);
  586. {$EXTERNALSYM PERF_DETAIL_STANDARD}
  587. function PdhGetRawCounterValue(hCounter: PDH_HCOUNTER; lpdwType: LPDWORD;
  588. var pValue: PDH_RAW_COUNTER): PDH_STATUS; stdcall;
  589. {$EXTERNALSYM PdhGetRawCounterValue}
  590. function PdhGetRawCounterArrayA(hCounter: PDH_HCOUNTER; var lpdwBufferSize,
  591. lpdwItemCount: DWORD; var ItemBuffer: PDH_RAW_COUNTER_ITEM_A): PDH_STATUS; stdcall;
  592. {$EXTERNALSYM PdhGetRawCounterArrayA}
  593. function PdhGetRawCounterArrayW(hCounter: PDH_HCOUNTER; var lpdwBufferSize,
  594. lpdwItemCount: DWORD; var ItemBuffer: PDH_RAW_COUNTER_ITEM_W): PDH_STATUS; stdcall;
  595. {$EXTERNALSYM PdhGetRawCounterArrayW}
  596. function PdhGetRawCounterArray(hCounter: PDH_HCOUNTER; var lpdwBufferSize,
  597. lpdwItemCount: DWORD; var ItemBuffer: PDH_RAW_COUNTER_ITEM): PDH_STATUS; stdcall;
  598. {$EXTERNALSYM PdhGetRawCounterArray}
  599. function PdhCalculateCounterFromRawValue(hCounter: PDH_HCOUNTER; dwFormat: DWORD;
  600. rawValue1, rawValue2: PPDH_RAW_COUNTER; var fmtValue: PDH_FMT_COUNTERVALUE): PDH_STATUS; stdcall;
  601. {$EXTERNALSYM PdhCalculateCounterFromRawValue}
  602. function PdhComputeCounterStatistics(hCounter: PDH_HCOUNTER; dwFormat, dwFirstEntry,
  603. dwNumEntries: DWORD; lpRawValueArray: PPDH_RAW_COUNTER; var data: PDH_STATISTICS): PDH_STATUS; stdcall;
  604. {$EXTERNALSYM PdhComputeCounterStatistics}
  605. function PdhGetCounterInfoA(hCounter: PDH_HCOUNTER; bRetrieveExplainText: Boolean;
  606. var pdwBufferSize: DWORD; lpBuffer: PPDH_COUNTER_INFO_A): PDH_STATUS; stdcall;
  607. {$EXTERNALSYM PdhGetCounterInfoA}
  608. function PdhGetCounterInfoW(hCounter: PDH_HCOUNTER; bRetrieveExplainText: Boolean;
  609. var pdwBufferSize: DWORD; lpBuffer: PPDH_COUNTER_INFO_W): PDH_STATUS; stdcall;
  610. {$EXTERNALSYM PdhGetCounterInfoW}
  611. function PdhGetCounterInfo(hCounter: PDH_HCOUNTER; bRetrieveExplainText: Boolean;
  612. var pdwBufferSize: DWORD; lpBuffer: PPDH_COUNTER_INFO): PDH_STATUS; stdcall;
  613. {$EXTERNALSYM PdhGetCounterInfo}
  614. const
  615. PDH_MAX_SCALE = Longint(7);
  616. {$EXTERNALSYM PDH_MAX_SCALE}
  617. PDH_MIN_SCALE = Longint(-7);
  618. {$EXTERNALSYM PDH_MIN_SCALE}
  619. function PdhSetCounterScaleFactor(hCounter: PDH_HCOUNTER; lFactor: LONG): PDH_STATUS; stdcall;
  620. {$EXTERNALSYM PdhSetCounterScaleFactor}
  621. //
  622. // Browsing and enumeration functions
  623. //
  624. function PdhConnectMachineA(szMachineName: LPCSTR): PDH_STATUS; stdcall;
  625. {$EXTERNALSYM PdhConnectMachineA}
  626. function PdhConnectMachineW(szMachineName: LPCWSTR): PDH_STATUS; stdcall;
  627. {$EXTERNALSYM PdhConnectMachineW}
  628. function PdhConnectMachine(szMachineName: LPCTSTR): PDH_STATUS; stdcall;
  629. {$EXTERNALSYM PdhConnectMachine}
  630. function PdhEnumMachinesA(szDataSource: LPCSTR; mszMachineList: LPSTR;
  631. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  632. {$EXTERNALSYM PdhEnumMachinesA}
  633. function PdhEnumMachinesW(szDataSource: LPCWSTR; mszMachineList: LPWSTR;
  634. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  635. {$EXTERNALSYM PdhEnumMachinesW}
  636. function PdhEnumMachines(szDataSource: LPCTSTR; mszMachineList: LPTSTR;
  637. pcchBufferSize: LPDWORD): PDH_STATUS; stdcall;
  638. {$EXTERNALSYM PdhEnumMachines}
  639. function PdhEnumObjectsA(szDataSource, szMachineName: LPCSTR; mszObjectList: LPSTR;
  640. var pcchBufferSize: DWORD; dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  641. {$EXTERNALSYM PdhEnumObjectsA}
  642. function PdhEnumObjectsW(szDataSource, szMachineName: LPCWSTR; mszObjectList: LPWSTR;
  643. var pcchBufferSize: DWORD; dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  644. {$EXTERNALSYM PdhEnumObjectsW}
  645. function PdhEnumObjects(szDataSource, szMachineName: LPCTSTR; mszObjectList: LPTSTR;
  646. var pcchBufferSize: DWORD; dwDetailLevel: DWORD; bRefresh: BOOL): PDH_STATUS; stdcall;
  647. {$EXTERNALSYM PdhEnumObjects}
  648. function PdhEnumObjectItemsA(szDataSource, szMachineName, szObjectName: LPCSTR;
  649. mszCounterList: LPSTR; var pcchCounterListLength: DWORD; mszInstanceList: LPSTR;
  650. var pcchInstanceListLength: DWORD; dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  651. {$EXTERNALSYM PdhEnumObjectItemsA}
  652. function PdhEnumObjectItemsW(szDataSource, szMachineName, szObjectName: LPCWSTR;
  653. mszCounterList: LPWSTR; var pcchCounterListLength: DWORD; mszInstanceList: LPWSTR;
  654. var pcchInstanceListLength: DWORD; dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  655. {$EXTERNALSYM PdhEnumObjectItemsW}
  656. function PdhEnumObjectItems(szDataSource, szMachineName, szObjectName: LPCTSTR;
  657. mszCounterList: LPTSTR; var pcchCounterListLength: DWORD; mszInstanceList: LPTSTR;
  658. var pcchInstanceListLength: DWORD; dwDetailLevel, dwFlags: DWORD): PDH_STATUS; stdcall;
  659. {$EXTERNALSYM PdhEnumObjectItems}
  660. const
  661. PDH_OBJECT_HAS_INSTANCES = $00000001;
  662. {$EXTERNALSYM PDH_OBJECT_HAS_INSTANCES}
  663. function PdhMakeCounterPathA(pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_A;
  664. szFullPathBuffer: LPSTR; var pcchBufferSize: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  665. {$EXTERNALSYM PdhMakeCounterPathA}
  666. function PdhMakeCounterPathW(pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_W;
  667. szFullPathBuffer: LPWSTR; var pcchBufferSize: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  668. {$EXTERNALSYM PdhMakeCounterPathW}
  669. function PdhMakeCounterPath(pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS;
  670. szFullPathBuffer: LPTSTR; var pcchBufferSize: DWORD; dwFlags: DWORD): PDH_STATUS; stdcall;
  671. {$EXTERNALSYM PdhMakeCounterPath}
  672. // todo shouldn't pCounterPathElements be a pointer to ...?
  673. function PdhParseCounterPathA(szFullPathBuffer: LPCSTR;
  674. pCounterPathElements: PDH_COUNTER_PATH_ELEMENTS_A; var pdwBufferSize: DWORD;
  675. dwFlags: DWORD): PDH_STATUS; stdcall;
  676. {$EXTERNALSYM PdhParseCounterPathA}
  677. function PdhParseCounterPathW(szFullPathBuffer: LPCWSTR;
  678. pCounterPathElements: PDH_COUNTER_PATH_ELEMENTS_W; var pdwBufferSize: DWORD;
  679. dwFlags: DWORD): PDH_STATUS; stdcall;
  680. {$EXTERNALSYM PdhParseCounterPathW}
  681. function PdhParseCounterPath(szFullPathBuffer: LPCTSTR;
  682. pCounterPathElements: PDH_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. const
  1124. PdhLib = 'pdh.dll';
  1125. {$IFDEF UNICODE}
  1126. AWSuffix = 'W';
  1127. {$ELSE}
  1128. AWSuffix = 'A';
  1129. {$ENDIF UNICODE}
  1130. function IsSuccessSeverity(ErrorCode: Longint): Boolean;
  1131. begin
  1132. Result := (ErrorCode and $C0000000) = $00000000;
  1133. end;
  1134. function IsInformationalSeverity(ErrorCode: Longint): Boolean;
  1135. begin
  1136. Result := (ErrorCode and $C0000000) = $40000000;
  1137. end;
  1138. function IsWarningSeverity(ErrorCode: Longint): Boolean;
  1139. begin
  1140. Result := (ErrorCode and $C0000000) = $80000000;
  1141. end;
  1142. function IsErrorSeverity(ErrorCode: Longint): Boolean;
  1143. begin
  1144. Result := (ErrorCode and $C0000000) = $C0000000;
  1145. end;
  1146. function PDH_PATH_LANG_FLAGS(LangId, Flags: DWORD): DWORD;
  1147. begin
  1148. Result := DWORD(((LangId and $0000FFFF) shl 16) or (Flags and $0000FFFF));
  1149. end;
  1150. {$IFDEF DYNAMIC_LINK}
  1151. var
  1152. _PdhGetDllVersion: Pointer;
  1153. function PdhGetDllVersion;
  1154. begin
  1155. GetProcedureAddress(_PdhGetDllVersion, PdhLib, 'PdhGetDllVersion');
  1156. asm
  1157. MOV ESP, EBP
  1158. POP EBP
  1159. JMP [_PdhGetDllVersion]
  1160. end;
  1161. end;
  1162. var
  1163. _PdhOpenQueryA: Pointer;
  1164. function PdhOpenQueryA;
  1165. begin
  1166. GetProcedureAddress(_PdhOpenQueryA, PdhLib, 'PdhOpenQueryA');
  1167. asm
  1168. MOV ESP, EBP
  1169. POP EBP
  1170. JMP [_PdhOpenQueryA]
  1171. end;
  1172. end;
  1173. var
  1174. _PdhOpenQueryW: Pointer;
  1175. function PdhOpenQueryW;
  1176. begin
  1177. GetProcedureAddress(_PdhOpenQueryW, PdhLib, 'PdhOpenQueryW');
  1178. asm
  1179. MOV ESP, EBP
  1180. POP EBP
  1181. JMP [_PdhOpenQueryW]
  1182. end;
  1183. end;
  1184. var
  1185. _PdhOpenQuery: Pointer;
  1186. function PdhOpenQuery;
  1187. begin
  1188. GetProcedureAddress(_PdhOpenQuery, PdhLib, 'PdhOpenQuery' + AWSuffix);
  1189. asm
  1190. MOV ESP, EBP
  1191. POP EBP
  1192. JMP [_PdhOpenQuery]
  1193. end;
  1194. end;
  1195. var
  1196. _PdhAddCounterA: Pointer;
  1197. function PdhAddCounterA;
  1198. begin
  1199. GetProcedureAddress(_PdhAddCounterA, PdhLib, 'PdhAddCounterA');
  1200. asm
  1201. MOV ESP, EBP
  1202. POP EBP
  1203. JMP [_PdhAddCounterA]
  1204. end;
  1205. end;
  1206. var
  1207. _PdhAddCounterW: Pointer;
  1208. function PdhAddCounterW;
  1209. begin
  1210. GetProcedureAddress(_PdhAddCounterW, PdhLib, 'PdhAddCounterW');
  1211. asm
  1212. MOV ESP, EBP
  1213. POP EBP
  1214. JMP [_PdhAddCounterW]
  1215. end;
  1216. end;
  1217. var
  1218. _PdhAddCounter: Pointer;
  1219. function PdhAddCounter;
  1220. begin
  1221. GetProcedureAddress(_PdhAddCounter, PdhLib, 'PdhAddCounter' + AWSuffix);
  1222. asm
  1223. MOV ESP, EBP
  1224. POP EBP
  1225. JMP [_PdhAddCounter]
  1226. end;
  1227. end;
  1228. var
  1229. _PdhRemoveCounter: Pointer;
  1230. function PdhRemoveCounter;
  1231. begin
  1232. GetProcedureAddress(_PdhRemoveCounter, PdhLib, 'PdhRemoveCounter');
  1233. asm
  1234. MOV ESP, EBP
  1235. POP EBP
  1236. JMP [_PdhRemoveCounter]
  1237. end;
  1238. end;
  1239. var
  1240. _PdhCollectQueryData: Pointer;
  1241. function PdhCollectQueryData;
  1242. begin
  1243. GetProcedureAddress(_PdhCollectQueryData, PdhLib, 'PdhCollectQueryData');
  1244. asm
  1245. MOV ESP, EBP
  1246. POP EBP
  1247. JMP [_PdhCollectQueryData]
  1248. end;
  1249. end;
  1250. var
  1251. _PdhCloseQuery: Pointer;
  1252. function PdhCloseQuery;
  1253. begin
  1254. GetProcedureAddress(_PdhCloseQuery, PdhLib, 'PdhCloseQuery');
  1255. asm
  1256. MOV ESP, EBP
  1257. POP EBP
  1258. JMP [_PdhCloseQuery]
  1259. end;
  1260. end;
  1261. var
  1262. _PdhGetFormattedCounterValue: Pointer;
  1263. function PdhGetFormattedCounterValue;
  1264. begin
  1265. GetProcedureAddress(_PdhGetFormattedCounterValue, PdhLib, 'PdhGetFormattedCounterValue');
  1266. asm
  1267. MOV ESP, EBP
  1268. POP EBP
  1269. JMP [_PdhGetFormattedCounterValue]
  1270. end;
  1271. end;
  1272. var
  1273. _PdhGetFormattedCounterArrayA: Pointer;
  1274. function PdhGetFormattedCounterArrayA;
  1275. begin
  1276. GetProcedureAddress(_PdhGetFormattedCounterArrayA, PdhLib, 'PdhGetFormattedCounterArrayA');
  1277. asm
  1278. MOV ESP, EBP
  1279. POP EBP
  1280. JMP [_PdhGetFormattedCounterArrayA]
  1281. end;
  1282. end;
  1283. var
  1284. _PdhGetFormattedCounterArrayW: Pointer;
  1285. function PdhGetFormattedCounterArrayW;
  1286. begin
  1287. GetProcedureAddress(_PdhGetFormattedCounterArrayW, PdhLib, 'PdhGetFormattedCounterArrayW');
  1288. asm
  1289. MOV ESP, EBP
  1290. POP EBP
  1291. JMP [_PdhGetFormattedCounterArrayW]
  1292. end;
  1293. end;
  1294. var
  1295. _PdhGetFormattedCounterArray: Pointer;
  1296. function PdhGetFormattedCounterArray;
  1297. begin
  1298. GetProcedureAddress(_PdhGetFormattedCounterArray, PdhLib, 'PdhGetFormattedCounterArray' + AWSuffix);
  1299. asm
  1300. MOV ESP, EBP
  1301. POP EBP
  1302. JMP [_PdhGetFormattedCounterArray]
  1303. end;
  1304. end;
  1305. var
  1306. _PdhGetRawCounterValue: Pointer;
  1307. function PdhGetRawCounterValue;
  1308. begin
  1309. GetProcedureAddress(_PdhGetRawCounterValue, PdhLib, 'PdhGetRawCounterValue');
  1310. asm
  1311. MOV ESP, EBP
  1312. POP EBP
  1313. JMP [_PdhGetRawCounterValue]
  1314. end;
  1315. end;
  1316. var
  1317. _PdhGetRawCounterArrayA: Pointer;
  1318. function PdhGetRawCounterArrayA;
  1319. begin
  1320. GetProcedureAddress(_PdhGetRawCounterArrayA, PdhLib, 'PdhGetRawCounterArrayA');
  1321. asm
  1322. MOV ESP, EBP
  1323. POP EBP
  1324. JMP [_PdhGetRawCounterArrayA]
  1325. end;
  1326. end;
  1327. var
  1328. _PdhGetRawCounterArrayW: Pointer;
  1329. function PdhGetRawCounterArrayW;
  1330. begin
  1331. GetProcedureAddress(_PdhGetRawCounterArrayW, PdhLib, 'PdhGetRawCounterArrayW');
  1332. asm
  1333. MOV ESP, EBP
  1334. POP EBP
  1335. JMP [_PdhGetRawCounterArrayW]
  1336. end;
  1337. end;
  1338. var
  1339. _PdhGetRawCounterArray: Pointer;
  1340. function PdhGetRawCounterArray;
  1341. begin
  1342. GetProcedureAddress(_PdhGetRawCounterArray, PdhLib, 'PdhGetRawCounterArray' + AWSuffix);
  1343. asm
  1344. MOV ESP, EBP
  1345. POP EBP
  1346. JMP [_PdhGetRawCounterArray]
  1347. end;
  1348. end;
  1349. var
  1350. _PdhCalculateCounterFromRawValue: Pointer;
  1351. function PdhCalculateCounterFromRawValue;
  1352. begin
  1353. GetProcedureAddress(_PdhCalculateCounterFromRawValue, PdhLib, 'PdhCalculateCounterFromRawValue');
  1354. asm
  1355. MOV ESP, EBP
  1356. POP EBP
  1357. JMP [_PdhCalculateCounterFromRawValue]
  1358. end;
  1359. end;
  1360. var
  1361. _PdhComputeCounterStatistics: Pointer;
  1362. function PdhComputeCounterStatistics;
  1363. begin
  1364. GetProcedureAddress(_PdhComputeCounterStatistics, PdhLib, 'PdhComputeCounterStatistics');
  1365. asm
  1366. MOV ESP, EBP
  1367. POP EBP
  1368. JMP [_PdhComputeCounterStatistics]
  1369. end;
  1370. end;
  1371. var
  1372. _PdhGetCounterInfoA: Pointer;
  1373. function PdhGetCounterInfoA;
  1374. begin
  1375. GetProcedureAddress(_PdhGetCounterInfoA, PdhLib, 'PdhGetCounterInfoA');
  1376. asm
  1377. MOV ESP, EBP
  1378. POP EBP
  1379. JMP [_PdhGetCounterInfoA]
  1380. end;
  1381. end;
  1382. var
  1383. _PdhGetCounterInfoW: Pointer;
  1384. function PdhGetCounterInfoW;
  1385. begin
  1386. GetProcedureAddress(_PdhGetCounterInfoW, PdhLib, 'PdhGetCounterInfoW');
  1387. asm
  1388. MOV ESP, EBP
  1389. POP EBP
  1390. JMP [_PdhGetCounterInfoW]
  1391. end;
  1392. end;
  1393. var
  1394. _PdhGetCounterInfo: Pointer;
  1395. function PdhGetCounterInfo;
  1396. begin
  1397. GetProcedureAddress(_PdhGetCounterInfo, PdhLib, 'PdhGetCounterInfo' + AWSuffix);
  1398. asm
  1399. MOV ESP, EBP
  1400. POP EBP
  1401. JMP [_PdhGetCounterInfo]
  1402. end;
  1403. end;
  1404. var
  1405. _PdhSetCounterScaleFactor: Pointer;
  1406. function PdhSetCounterScaleFactor;
  1407. begin
  1408. GetProcedureAddress(_PdhSetCounterScaleFactor, PdhLib, 'PdhSetCounterScaleFactor');
  1409. asm
  1410. MOV ESP, EBP
  1411. POP EBP
  1412. JMP [_PdhSetCounterScaleFactor]
  1413. end;
  1414. end;
  1415. var
  1416. _PdhConnectMachineA: Pointer;
  1417. function PdhConnectMachineA;
  1418. begin
  1419. GetProcedureAddress(_PdhConnectMachineA, PdhLib, 'PdhConnectMachineA');
  1420. asm
  1421. MOV ESP, EBP
  1422. POP EBP
  1423. JMP [_PdhConnectMachineA]
  1424. end;
  1425. end;
  1426. var
  1427. _PdhConnectMachineW: Pointer;
  1428. function PdhConnectMachineW;
  1429. begin
  1430. GetProcedureAddress(_PdhConnectMachineW, PdhLib, 'PdhConnectMachineW');
  1431. asm
  1432. MOV ESP, EBP
  1433. POP EBP
  1434. JMP [_PdhConnectMachineW]
  1435. end;
  1436. end;
  1437. var
  1438. _PdhConnectMachine: Pointer;
  1439. function PdhConnectMachine;
  1440. begin
  1441. GetProcedureAddress(_PdhConnectMachine, PdhLib, 'PdhConnectMachine' + AWSuffix);
  1442. asm
  1443. MOV ESP, EBP
  1444. POP EBP
  1445. JMP [_PdhConnectMachine]
  1446. end;
  1447. end;
  1448. var
  1449. _PdhEnumMachinesA: Pointer;
  1450. function PdhEnumMachinesA;
  1451. begin
  1452. GetProcedureAddress(_PdhEnumMachinesA, PdhLib, 'PdhEnumMachinesA');
  1453. asm
  1454. MOV ESP, EBP
  1455. POP EBP
  1456. JMP [_PdhEnumMachinesA]
  1457. end;
  1458. end;
  1459. var
  1460. _PdhEnumMachinesW: Pointer;
  1461. function PdhEnumMachinesW;
  1462. begin
  1463. GetProcedureAddress(_PdhEnumMachinesW, PdhLib, 'PdhEnumMachinesW');
  1464. asm
  1465. MOV ESP, EBP
  1466. POP EBP
  1467. JMP [_PdhEnumMachinesW]
  1468. end;
  1469. end;
  1470. var
  1471. _PdhEnumMachines: Pointer;
  1472. function PdhEnumMachines;
  1473. begin
  1474. GetProcedureAddress(_PdhEnumMachines, PdhLib, 'PdhEnumMachines' + AWSuffix);
  1475. asm
  1476. MOV ESP, EBP
  1477. POP EBP
  1478. JMP [_PdhEnumMachines]
  1479. end;
  1480. end;
  1481. var
  1482. _PdhEnumObjectsA: Pointer;
  1483. function PdhEnumObjectsA;
  1484. begin
  1485. GetProcedureAddress(_PdhEnumObjectsA, PdhLib, 'PdhEnumObjectsA');
  1486. asm
  1487. MOV ESP, EBP
  1488. POP EBP
  1489. JMP [_PdhEnumObjectsA]
  1490. end;
  1491. end;
  1492. var
  1493. _PdhEnumObjectsW: Pointer;
  1494. function PdhEnumObjectsW;
  1495. begin
  1496. GetProcedureAddress(_PdhEnumObjectsW, PdhLib, 'PdhEnumObjectsW');
  1497. asm
  1498. MOV ESP, EBP
  1499. POP EBP
  1500. JMP [_PdhEnumObjectsW]
  1501. end;
  1502. end;
  1503. var
  1504. _PdhEnumObjects: Pointer;
  1505. function PdhEnumObjects;
  1506. begin
  1507. GetProcedureAddress(_PdhEnumObjects, PdhLib, 'PdhEnumObjects' + AWSuffix);
  1508. asm
  1509. MOV ESP, EBP
  1510. POP EBP
  1511. JMP [_PdhEnumObjects]
  1512. end;
  1513. end;
  1514. var
  1515. _PdhEnumObjectItemsA: Pointer;
  1516. function PdhEnumObjectItemsA;
  1517. begin
  1518. GetProcedureAddress(_PdhEnumObjectItemsA, PdhLib, 'PdhEnumObjectItemsA');
  1519. asm
  1520. MOV ESP, EBP
  1521. POP EBP
  1522. JMP [_PdhEnumObjectItemsA]
  1523. end;
  1524. end;
  1525. var
  1526. _PdhEnumObjectItemsW: Pointer;
  1527. function PdhEnumObjectItemsW;
  1528. begin
  1529. GetProcedureAddress(_PdhEnumObjectItemsW, PdhLib, 'PdhEnumObjectItemsW');
  1530. asm
  1531. MOV ESP, EBP
  1532. POP EBP
  1533. JMP [_PdhEnumObjectItemsW]
  1534. end;
  1535. end;
  1536. var
  1537. _PdhEnumObjectItems: Pointer;
  1538. function PdhEnumObjectItems;
  1539. begin
  1540. GetProcedureAddress(_PdhEnumObjectItems, PdhLib, 'PdhEnumObjectItems' + AWSuffix);
  1541. asm
  1542. MOV ESP, EBP
  1543. POP EBP
  1544. JMP [_PdhEnumObjectItems]
  1545. end;
  1546. end;
  1547. var
  1548. _PdhMakeCounterPathA: Pointer;
  1549. function PdhMakeCounterPathA;
  1550. begin
  1551. GetProcedureAddress(_PdhMakeCounterPathA, PdhLib, 'PdhMakeCounterPathA');
  1552. asm
  1553. MOV ESP, EBP
  1554. POP EBP
  1555. JMP [_PdhMakeCounterPathA]
  1556. end;
  1557. end;
  1558. var
  1559. _PdhMakeCounterPathW: Pointer;
  1560. function PdhMakeCounterPathW;
  1561. begin
  1562. GetProcedureAddress(_PdhMakeCounterPathW, PdhLib, 'PdhMakeCounterPathW');
  1563. asm
  1564. MOV ESP, EBP
  1565. POP EBP
  1566. JMP [_PdhMakeCounterPathW]
  1567. end;
  1568. end;
  1569. var
  1570. _PdhMakeCounterPath: Pointer;
  1571. function PdhMakeCounterPath;
  1572. begin
  1573. GetProcedureAddress(_PdhMakeCounterPath, PdhLib, 'PdhMakeCounterPath' + AWSuffix);
  1574. asm
  1575. MOV ESP, EBP
  1576. POP EBP
  1577. JMP [_PdhMakeCounterPath]
  1578. end;
  1579. end;
  1580. var
  1581. _PdhParseCounterPathA: Pointer;
  1582. function PdhParseCounterPathA;
  1583. begin
  1584. GetProcedureAddress(_PdhParseCounterPathA, PdhLib, 'PdhParseCounterPathA');
  1585. asm
  1586. MOV ESP, EBP
  1587. POP EBP
  1588. JMP [_PdhParseCounterPathA]
  1589. end;
  1590. end;
  1591. var
  1592. _PdhParseCounterPathW: Pointer;
  1593. function PdhParseCounterPathW;
  1594. begin
  1595. GetProcedureAddress(_PdhParseCounterPathW, PdhLib, 'PdhParseCounterPathW');
  1596. asm
  1597. MOV ESP, EBP
  1598. POP EBP
  1599. JMP [_PdhParseCounterPathW]
  1600. end;
  1601. end;
  1602. var
  1603. _PdhParseCounterPath: Pointer;
  1604. function PdhParseCounterPath;
  1605. begin
  1606. GetProcedureAddress(_PdhParseCounterPath, PdhLib, 'PdhParseCounterPath' + AWSuffix);
  1607. asm
  1608. MOV ESP, EBP
  1609. POP EBP
  1610. JMP [_PdhParseCounterPath]
  1611. end;
  1612. end;
  1613. var
  1614. _PdhParseInstanceNameA: Pointer;
  1615. function PdhParseInstanceNameA;
  1616. begin
  1617. GetProcedureAddress(_PdhParseInstanceNameA, PdhLib, 'PdhParseInstanceNameA');
  1618. asm
  1619. MOV ESP, EBP
  1620. POP EBP
  1621. JMP [_PdhParseInstanceNameA]
  1622. end;
  1623. end;
  1624. var
  1625. _PdhParseInstanceNameW: Pointer;
  1626. function PdhParseInstanceNameW;
  1627. begin
  1628. GetProcedureAddress(_PdhParseInstanceNameW, PdhLib, 'PdhParseInstanceNameW');
  1629. asm
  1630. MOV ESP, EBP
  1631. POP EBP
  1632. JMP [_PdhParseInstanceNameW]
  1633. end;
  1634. end;
  1635. var
  1636. _PdhParseInstanceName: Pointer;
  1637. function PdhParseInstanceName;
  1638. begin
  1639. GetProcedureAddress(_PdhParseInstanceName, PdhLib, 'PdhParseInstanceName' + AWSuffix);
  1640. asm
  1641. MOV ESP, EBP
  1642. POP EBP
  1643. JMP [_PdhParseInstanceName]
  1644. end;
  1645. end;
  1646. var
  1647. _PdhValidatePathA: Pointer;
  1648. function PdhValidatePathA;
  1649. begin
  1650. GetProcedureAddress(_PdhValidatePathA, PdhLib, 'PdhValidatePathA');
  1651. asm
  1652. MOV ESP, EBP
  1653. POP EBP
  1654. JMP [_PdhValidatePathA]
  1655. end;
  1656. end;
  1657. var
  1658. _PdhValidatePathW: Pointer;
  1659. function PdhValidatePathW;
  1660. begin
  1661. GetProcedureAddress(_PdhValidatePathW, PdhLib, 'PdhValidatePathW');
  1662. asm
  1663. MOV ESP, EBP
  1664. POP EBP
  1665. JMP [_PdhValidatePathW]
  1666. end;
  1667. end;
  1668. var
  1669. _PdhValidatePath: Pointer;
  1670. function PdhValidatePath;
  1671. begin
  1672. GetProcedureAddress(_PdhValidatePath, PdhLib, 'PdhValidatePath' + AWSuffix);
  1673. asm
  1674. MOV ESP, EBP
  1675. POP EBP
  1676. JMP [_PdhValidatePath]
  1677. end;
  1678. end;
  1679. var
  1680. _PdhGetDefaultPerfObjectA: Pointer;
  1681. function PdhGetDefaultPerfObjectA;
  1682. begin
  1683. GetProcedureAddress(_PdhGetDefaultPerfObjectA, PdhLib, 'PdhGetDefaultPerfObjectA');
  1684. asm
  1685. MOV ESP, EBP
  1686. POP EBP
  1687. JMP [_PdhGetDefaultPerfObjectA]
  1688. end;
  1689. end;
  1690. var
  1691. _PdhGetDefaultPerfObjectW: Pointer;
  1692. function PdhGetDefaultPerfObjectW;
  1693. begin
  1694. GetProcedureAddress(_PdhGetDefaultPerfObjectW, PdhLib, 'PdhGetDefaultPerfObjectW');
  1695. asm
  1696. MOV ESP, EBP
  1697. POP EBP
  1698. JMP [_PdhGetDefaultPerfObjectW]
  1699. end;
  1700. end;
  1701. var
  1702. _PdhGetDefaultPerfObject: Pointer;
  1703. function PdhGetDefaultPerfObject;
  1704. begin
  1705. GetProcedureAddress(_PdhGetDefaultPerfObject, PdhLib, 'PdhGetDefaultPerfObject' + AWSuffix);
  1706. asm
  1707. MOV ESP, EBP
  1708. POP EBP
  1709. JMP [_PdhGetDefaultPerfObject]
  1710. end;
  1711. end;
  1712. var
  1713. _PdhGetDefaultPerfCounterA: Pointer;
  1714. function PdhGetDefaultPerfCounterA;
  1715. begin
  1716. GetProcedureAddress(_PdhGetDefaultPerfCounterA, PdhLib, 'PdhGetDefaultPerfCounterA');
  1717. asm
  1718. MOV ESP, EBP
  1719. POP EBP
  1720. JMP [_PdhGetDefaultPerfCounterA]
  1721. end;
  1722. end;
  1723. var
  1724. _PdhGetDefaultPerfCounterW: Pointer;
  1725. function PdhGetDefaultPerfCounterW;
  1726. begin
  1727. GetProcedureAddress(_PdhGetDefaultPerfCounterW, PdhLib, 'PdhGetDefaultPerfCounterW');
  1728. asm
  1729. MOV ESP, EBP
  1730. POP EBP
  1731. JMP [_PdhGetDefaultPerfCounterW]
  1732. end;
  1733. end;
  1734. var
  1735. _PdhGetDefaultPerfCounter: Pointer;
  1736. function PdhGetDefaultPerfCounter;
  1737. begin
  1738. GetProcedureAddress(_PdhGetDefaultPerfCounter, PdhLib, 'PdhGetDefaultPerfCounter' + AWSuffix);
  1739. asm
  1740. MOV ESP, EBP
  1741. POP EBP
  1742. JMP [_PdhGetDefaultPerfCounter]
  1743. end;
  1744. end;
  1745. var
  1746. _PdhBrowseCountersA: Pointer;
  1747. function PdhBrowseCountersA;
  1748. begin
  1749. GetProcedureAddress(_PdhBrowseCountersA, PdhLib, 'PdhBrowseCountersA');
  1750. asm
  1751. MOV ESP, EBP
  1752. POP EBP
  1753. JMP [_PdhBrowseCountersA]
  1754. end;
  1755. end;
  1756. var
  1757. _PdhBrowseCountersW: Pointer;
  1758. function PdhBrowseCountersW;
  1759. begin
  1760. GetProcedureAddress(_PdhBrowseCountersW, PdhLib, 'PdhBrowseCountersW');
  1761. asm
  1762. MOV ESP, EBP
  1763. POP EBP
  1764. JMP [_PdhBrowseCountersW]
  1765. end;
  1766. end;
  1767. var
  1768. _PdhBrowseCounters: Pointer;
  1769. function PdhBrowseCounters;
  1770. begin
  1771. GetProcedureAddress(_PdhBrowseCounters, PdhLib, 'PdhBrowseCounters' + AWSuffix);
  1772. asm
  1773. MOV ESP, EBP
  1774. POP EBP
  1775. JMP [_PdhBrowseCounters]
  1776. end;
  1777. end;
  1778. var
  1779. _PdhExpandCounterPathA: Pointer;
  1780. function PdhExpandCounterPathA;
  1781. begin
  1782. GetProcedureAddress(_PdhExpandCounterPathA, PdhLib, 'PdhExpandCounterPathA');
  1783. asm
  1784. MOV ESP, EBP
  1785. POP EBP
  1786. JMP [_PdhExpandCounterPathA]
  1787. end;
  1788. end;
  1789. var
  1790. _PdhExpandCounterPathW: Pointer;
  1791. function PdhExpandCounterPathW;
  1792. begin
  1793. GetProcedureAddress(_PdhExpandCounterPathW, PdhLib, 'PdhExpandCounterPathW');
  1794. asm
  1795. MOV ESP, EBP
  1796. POP EBP
  1797. JMP [_PdhExpandCounterPathW]
  1798. end;
  1799. end;
  1800. var
  1801. _PdhExpandCounterPath: Pointer;
  1802. function PdhExpandCounterPath;
  1803. begin
  1804. GetProcedureAddress(_PdhExpandCounterPath, PdhLib, 'PdhExpandCounterPath' + AWSuffix);
  1805. asm
  1806. MOV ESP, EBP
  1807. POP EBP
  1808. JMP [_PdhExpandCounterPath]
  1809. end;
  1810. end;
  1811. var
  1812. _PdhLookupPerfNameByIndexA: Pointer;
  1813. function PdhLookupPerfNameByIndexA;
  1814. begin
  1815. GetProcedureAddress(_PdhLookupPerfNameByIndexA, PdhLib, 'PdhLookupPerfNameByIndexA');
  1816. asm
  1817. MOV ESP, EBP
  1818. POP EBP
  1819. JMP [_PdhLookupPerfNameByIndexA]
  1820. end;
  1821. end;
  1822. var
  1823. _PdhLookupPerfNameByIndexW: Pointer;
  1824. function PdhLookupPerfNameByIndexW;
  1825. begin
  1826. GetProcedureAddress(_PdhLookupPerfNameByIndexW, PdhLib, 'PdhLookupPerfNameByIndexW');
  1827. asm
  1828. MOV ESP, EBP
  1829. POP EBP
  1830. JMP [_PdhLookupPerfNameByIndexW]
  1831. end;
  1832. end;
  1833. var
  1834. _PdhLookupPerfNameByIndex: Pointer;
  1835. function PdhLookupPerfNameByIndex;
  1836. begin
  1837. GetProcedureAddress(_PdhLookupPerfNameByIndex, PdhLib, 'PdhLookupPerfNameByIndex' + AWSuffix);
  1838. asm
  1839. MOV ESP, EBP
  1840. POP EBP
  1841. JMP [_PdhLookupPerfNameByIndex]
  1842. end;
  1843. end;
  1844. var
  1845. _PdhLookupPerfIndexByNameA: Pointer;
  1846. function PdhLookupPerfIndexByNameA;
  1847. begin
  1848. GetProcedureAddress(_PdhLookupPerfIndexByNameA, PdhLib, 'PdhLookupPerfIndexByNameA');
  1849. asm
  1850. MOV ESP, EBP
  1851. POP EBP
  1852. JMP [_PdhLookupPerfIndexByNameA]
  1853. end;
  1854. end;
  1855. var
  1856. _PdhLookupPerfIndexByNameW: Pointer;
  1857. function PdhLookupPerfIndexByNameW;
  1858. begin
  1859. GetProcedureAddress(_PdhLookupPerfIndexByNameW, PdhLib, 'PdhLookupPerfIndexByNameW');
  1860. asm
  1861. MOV ESP, EBP
  1862. POP EBP
  1863. JMP [_PdhLookupPerfIndexByNameW]
  1864. end;
  1865. end;
  1866. var
  1867. _PdhLookupPerfIndexByName: Pointer;
  1868. function PdhLookupPerfIndexByName;
  1869. begin
  1870. GetProcedureAddress(_PdhLookupPerfIndexByName, PdhLib, 'PdhLookupPerfIndexByName' + AWSuffix);
  1871. asm
  1872. MOV ESP, EBP
  1873. POP EBP
  1874. JMP [_PdhLookupPerfIndexByName]
  1875. end;
  1876. end;
  1877. var
  1878. _PdhExpandWildCardPathA: Pointer;
  1879. function PdhExpandWildCardPathA;
  1880. begin
  1881. GetProcedureAddress(_PdhExpandWildCardPathA, PdhLib, 'PdhExpandWildCardPathA');
  1882. asm
  1883. MOV ESP, EBP
  1884. POP EBP
  1885. JMP [_PdhExpandWildCardPathA]
  1886. end;
  1887. end;
  1888. var
  1889. _PdhExpandWildCardPathW: Pointer;
  1890. function PdhExpandWildCardPathW;
  1891. begin
  1892. GetProcedureAddress(_PdhExpandWildCardPathW, PdhLib, 'PdhExpandWildCardPathW');
  1893. asm
  1894. MOV ESP, EBP
  1895. POP EBP
  1896. JMP [_PdhExpandWildCardPathW]
  1897. end;
  1898. end;
  1899. var
  1900. _PdhExpandWildCardPath: Pointer;
  1901. function PdhExpandWildCardPath;
  1902. begin
  1903. GetProcedureAddress(_PdhExpandWildCardPath, PdhLib, 'PdhExpandWildCardPath' + AWSuffix);
  1904. asm
  1905. MOV ESP, EBP
  1906. POP EBP
  1907. JMP [_PdhExpandWildCardPath]
  1908. end;
  1909. end;
  1910. var
  1911. _PdhOpenLogA: Pointer;
  1912. function PdhOpenLogA;
  1913. begin
  1914. GetProcedureAddress(_PdhOpenLogA, PdhLib, 'PdhOpenLogA');
  1915. asm
  1916. MOV ESP, EBP
  1917. POP EBP
  1918. JMP [_PdhOpenLogA]
  1919. end;
  1920. end;
  1921. var
  1922. _PdhOpenLogW: Pointer;
  1923. function PdhOpenLogW;
  1924. begin
  1925. GetProcedureAddress(_PdhOpenLogW, PdhLib, 'PdhOpenLogW');
  1926. asm
  1927. MOV ESP, EBP
  1928. POP EBP
  1929. JMP [_PdhOpenLogW]
  1930. end;
  1931. end;
  1932. var
  1933. _PdhOpenLog: Pointer;
  1934. function PdhOpenLog;
  1935. begin
  1936. GetProcedureAddress(_PdhOpenLog, PdhLib, 'PdhOpenLog' + AWSuffix);
  1937. asm
  1938. MOV ESP, EBP
  1939. POP EBP
  1940. JMP [_PdhOpenLog]
  1941. end;
  1942. end;
  1943. var
  1944. _PdhUpdateLogA: Pointer;
  1945. function PdhUpdateLogA;
  1946. begin
  1947. GetProcedureAddress(_PdhUpdateLogA, PdhLib, 'PdhUpdateLogA');
  1948. asm
  1949. MOV ESP, EBP
  1950. POP EBP
  1951. JMP [_PdhUpdateLogA]
  1952. end;
  1953. end;
  1954. var
  1955. _PdhUpdateLogW: Pointer;
  1956. function PdhUpdateLogW;
  1957. begin
  1958. GetProcedureAddress(_PdhUpdateLogW, PdhLib, 'PdhUpdateLogW');
  1959. asm
  1960. MOV ESP, EBP
  1961. POP EBP
  1962. JMP [_PdhUpdateLogW]
  1963. end;
  1964. end;
  1965. var
  1966. _PdhUpdateLog: Pointer;
  1967. function PdhUpdateLog;
  1968. begin
  1969. GetProcedureAddress(_PdhUpdateLog, PdhLib, 'PdhUpdateLog' + AWSuffix);
  1970. asm
  1971. MOV ESP, EBP
  1972. POP EBP
  1973. JMP [_PdhUpdateLog]
  1974. end;
  1975. end;
  1976. var
  1977. _PdhUpdateLogFileCatalog: Pointer;
  1978. function PdhUpdateLogFileCatalog;
  1979. begin
  1980. GetProcedureAddress(_PdhUpdateLogFileCatalog, PdhLib, 'PdhUpdateLogFileCatalog');
  1981. asm
  1982. MOV ESP, EBP
  1983. POP EBP
  1984. JMP [_PdhUpdateLogFileCatalog]
  1985. end;
  1986. end;
  1987. var
  1988. _PdhGetLogFileSize: Pointer;
  1989. function PdhGetLogFileSize;
  1990. begin
  1991. GetProcedureAddress(_PdhGetLogFileSize, PdhLib, 'PdhGetLogFileSize');
  1992. asm
  1993. MOV ESP, EBP
  1994. POP EBP
  1995. JMP [_PdhGetLogFileSize]
  1996. end;
  1997. end;
  1998. var
  1999. _PdhCloseLog: Pointer;
  2000. function PdhCloseLog;
  2001. begin
  2002. GetProcedureAddress(_PdhCloseLog, PdhLib, 'PdhCloseLog');
  2003. asm
  2004. MOV ESP, EBP
  2005. POP EBP
  2006. JMP [_PdhCloseLog]
  2007. end;
  2008. end;
  2009. var
  2010. _PdhSelectDataSourceA: Pointer;
  2011. function PdhSelectDataSourceA;
  2012. begin
  2013. GetProcedureAddress(_PdhSelectDataSourceA, PdhLib, 'PdhSelectDataSourceA');
  2014. asm
  2015. MOV ESP, EBP
  2016. POP EBP
  2017. JMP [_PdhSelectDataSourceA]
  2018. end;
  2019. end;
  2020. var
  2021. _PdhSelectDataSourceW: Pointer;
  2022. function PdhSelectDataSourceW;
  2023. begin
  2024. GetProcedureAddress(_PdhSelectDataSourceW, PdhLib, 'PdhSelectDataSourceW');
  2025. asm
  2026. MOV ESP, EBP
  2027. POP EBP
  2028. JMP [_PdhSelectDataSourceW]
  2029. end;
  2030. end;
  2031. var
  2032. _PdhSelectDataSource: Pointer;
  2033. function PdhSelectDataSource;
  2034. begin
  2035. GetProcedureAddress(_PdhSelectDataSource, PdhLib, 'PdhSelectDataSource' + AWSuffix);
  2036. asm
  2037. MOV ESP, EBP
  2038. POP EBP
  2039. JMP [_PdhSelectDataSource]
  2040. end;
  2041. end;
  2042. var
  2043. _PdhIsRealTimeQuery: Pointer;
  2044. function PdhIsRealTimeQuery;
  2045. begin
  2046. GetProcedureAddress(_PdhIsRealTimeQuery, PdhLib, 'PdhIsRealTimeQuery');
  2047. asm
  2048. MOV ESP, EBP
  2049. POP EBP
  2050. JMP [_PdhIsRealTimeQuery]
  2051. end;
  2052. end;
  2053. var
  2054. _PdhSetQueryTimeRange: Pointer;
  2055. function PdhSetQueryTimeRange;
  2056. begin
  2057. GetProcedureAddress(_PdhSetQueryTimeRange, PdhLib, 'PdhSetQueryTimeRange');
  2058. asm
  2059. MOV ESP, EBP
  2060. POP EBP
  2061. JMP [_PdhSetQueryTimeRange]
  2062. end;
  2063. end;
  2064. var
  2065. _PdhGetDataSourceTimeRangeA: Pointer;
  2066. function PdhGetDataSourceTimeRangeA;
  2067. begin
  2068. GetProcedureAddress(_PdhGetDataSourceTimeRangeA, PdhLib, 'PdhGetDataSourceTimeRangeA');
  2069. asm
  2070. MOV ESP, EBP
  2071. POP EBP
  2072. JMP [_PdhGetDataSourceTimeRangeA]
  2073. end;
  2074. end;
  2075. var
  2076. _PdhGetDataSourceTimeRangeW: Pointer;
  2077. function PdhGetDataSourceTimeRangeW;
  2078. begin
  2079. GetProcedureAddress(_PdhGetDataSourceTimeRangeW, PdhLib, 'PdhGetDataSourceTimeRangeW');
  2080. asm
  2081. MOV ESP, EBP
  2082. POP EBP
  2083. JMP [_PdhGetDataSourceTimeRangeW]
  2084. end;
  2085. end;
  2086. var
  2087. _PdhGetDataSourceTimeRange: Pointer;
  2088. function PdhGetDataSourceTimeRange;
  2089. begin
  2090. GetProcedureAddress(_PdhGetDataSourceTimeRange, PdhLib, 'PdhGetDataSourceTimeRange' + AWSuffix);
  2091. asm
  2092. MOV ESP, EBP
  2093. POP EBP
  2094. JMP [_PdhGetDataSourceTimeRange]
  2095. end;
  2096. end;
  2097. var
  2098. _PdhCollectQueryDataEx: Pointer;
  2099. function PdhCollectQueryDataEx;
  2100. begin
  2101. GetProcedureAddress(_PdhCollectQueryDataEx, PdhLib, 'PdhCollectQueryDataEx');
  2102. asm
  2103. MOV ESP, EBP
  2104. POP EBP
  2105. JMP [_PdhCollectQueryDataEx]
  2106. end;
  2107. end;
  2108. var
  2109. _PdhFormatFromRawValue: Pointer;
  2110. function PdhFormatFromRawValue;
  2111. begin
  2112. GetProcedureAddress(_PdhFormatFromRawValue, PdhLib, 'PdhFormatFromRawValue');
  2113. asm
  2114. MOV ESP, EBP
  2115. POP EBP
  2116. JMP [_PdhFormatFromRawValue]
  2117. end;
  2118. end;
  2119. var
  2120. _PdhGetCounterTimeBase: Pointer;
  2121. function PdhGetCounterTimeBase;
  2122. begin
  2123. GetProcedureAddress(_PdhGetCounterTimeBase, PdhLib, 'PdhGetCounterTimeBase');
  2124. asm
  2125. MOV ESP, EBP
  2126. POP EBP
  2127. JMP [_PdhGetCounterTimeBase]
  2128. end;
  2129. end;
  2130. var
  2131. _PdhReadRawLogRecord: Pointer;
  2132. function PdhReadRawLogRecord;
  2133. begin
  2134. GetProcedureAddress(_PdhReadRawLogRecord, PdhLib, 'PdhReadRawLogRecord');
  2135. asm
  2136. MOV ESP, EBP
  2137. POP EBP
  2138. JMP [_PdhReadRawLogRecord]
  2139. end;
  2140. end;
  2141. var
  2142. _PdhSetDefaultRealTimeDataSource: Pointer;
  2143. function PdhSetDefaultRealTimeDataSource;
  2144. begin
  2145. GetProcedureAddress(_PdhSetDefaultRealTimeDataSource, PdhLib, 'PdhSetDefaultRealTimeDataSource');
  2146. asm
  2147. MOV ESP, EBP
  2148. POP EBP
  2149. JMP [_PdhSetDefaultRealTimeDataSource]
  2150. end;
  2151. end;
  2152. var
  2153. _PdhBindInputDataSourceW: Pointer;
  2154. function PdhBindInputDataSourceW;
  2155. begin
  2156. GetProcedureAddress(_PdhBindInputDataSourceW, PdhLib, 'PdhBindInputDataSourceW');
  2157. asm
  2158. MOV ESP, EBP
  2159. POP EBP
  2160. JMP [_PdhBindInputDataSourceW]
  2161. end;
  2162. end;
  2163. var
  2164. _PdhBindInputDataSourceA: Pointer;
  2165. function PdhBindInputDataSourceA;
  2166. begin
  2167. GetProcedureAddress(_PdhBindInputDataSourceA, PdhLib, 'PdhBindInputDataSourceA');
  2168. asm
  2169. MOV ESP, EBP
  2170. POP EBP
  2171. JMP [_PdhBindInputDataSourceA]
  2172. end;
  2173. end;
  2174. var
  2175. _PdhBindInputDataSource: Pointer;
  2176. function PdhBindInputDataSource;
  2177. begin
  2178. GetProcedureAddress(_PdhBindInputDataSource, PdhLib, 'PdhBindInputDataSource' + AWSuffix);
  2179. asm
  2180. MOV ESP, EBP
  2181. POP EBP
  2182. JMP [_PdhBindInputDataSource]
  2183. end;
  2184. end;
  2185. var
  2186. _PdhOpenQueryH: Pointer;
  2187. function PdhOpenQueryH;
  2188. begin
  2189. GetProcedureAddress(_PdhOpenQueryH, PdhLib, 'PdhOpenQueryH');
  2190. asm
  2191. MOV ESP, EBP
  2192. POP EBP
  2193. JMP [_PdhOpenQueryH]
  2194. end;
  2195. end;
  2196. var
  2197. _PdhEnumMachinesHW: Pointer;
  2198. function PdhEnumMachinesHW;
  2199. begin
  2200. GetProcedureAddress(_PdhEnumMachinesHW, PdhLib, 'PdhEnumMachinesHW');
  2201. asm
  2202. MOV ESP, EBP
  2203. POP EBP
  2204. JMP [_PdhEnumMachinesHW]
  2205. end;
  2206. end;
  2207. var
  2208. _PdhEnumMachinesHA: Pointer;
  2209. function PdhEnumMachinesHA;
  2210. begin
  2211. GetProcedureAddress(_PdhEnumMachinesHA, PdhLib, 'PdhEnumMachinesHA');
  2212. asm
  2213. MOV ESP, EBP
  2214. POP EBP
  2215. JMP [_PdhEnumMachinesHA]
  2216. end;
  2217. end;
  2218. var
  2219. _PdhEnumMachinesH: Pointer;
  2220. function PdhEnumMachinesH;
  2221. begin
  2222. GetProcedureAddress(_PdhEnumMachinesH, PdhLib, 'PdhEnumMachinesH' + AWSuffix);
  2223. asm
  2224. MOV ESP, EBP
  2225. POP EBP
  2226. JMP [_PdhEnumMachinesH]
  2227. end;
  2228. end;
  2229. var
  2230. _PdhEnumObjectsHW: Pointer;
  2231. function PdhEnumObjectsHW;
  2232. begin
  2233. GetProcedureAddress(_PdhEnumObjectsHW, PdhLib, 'PdhEnumObjectsHW');
  2234. asm
  2235. MOV ESP, EBP
  2236. POP EBP
  2237. JMP [_PdhEnumObjectsHW]
  2238. end;
  2239. end;
  2240. var
  2241. _PdhEnumObjectsHA: Pointer;
  2242. function PdhEnumObjectsHA;
  2243. begin
  2244. GetProcedureAddress(_PdhEnumObjectsHA, PdhLib, 'PdhEnumObjectsHA');
  2245. asm
  2246. MOV ESP, EBP
  2247. POP EBP
  2248. JMP [_PdhEnumObjectsHA]
  2249. end;
  2250. end;
  2251. var
  2252. _PdhEnumObjectsH: Pointer;
  2253. function PdhEnumObjectsH;
  2254. begin
  2255. GetProcedureAddress(_PdhEnumObjectsH, PdhLib, 'PdhEnumObjectsH' + AWSuffix);
  2256. asm
  2257. MOV ESP, EBP
  2258. POP EBP
  2259. JMP [_PdhEnumObjectsH]
  2260. end;
  2261. end;
  2262. var
  2263. _PdhEnumObjectItemsHW: Pointer;
  2264. function PdhEnumObjectItemsHW;
  2265. begin
  2266. GetProcedureAddress(_PdhEnumObjectItemsHW, PdhLib, 'PdhEnumObjectItemsHW');
  2267. asm
  2268. MOV ESP, EBP
  2269. POP EBP
  2270. JMP [_PdhEnumObjectItemsHW]
  2271. end;
  2272. end;
  2273. var
  2274. _PdhEnumObjectItemsHA: Pointer;
  2275. function PdhEnumObjectItemsHA;
  2276. begin
  2277. GetProcedureAddress(_PdhEnumObjectItemsHA, PdhLib, 'PdhEnumObjectItemsHA');
  2278. asm
  2279. MOV ESP, EBP
  2280. POP EBP
  2281. JMP [_PdhEnumObjectItemsHA]
  2282. end;
  2283. end;
  2284. var
  2285. _PdhEnumObjectItemsH: Pointer;
  2286. function PdhEnumObjectItemsH;
  2287. begin
  2288. GetProcedureAddress(_PdhEnumObjectItemsH, PdhLib, 'PdhEnumObjectItemsH' + AWSuffix);
  2289. asm
  2290. MOV ESP, EBP
  2291. POP EBP
  2292. JMP [_PdhEnumObjectItemsH]
  2293. end;
  2294. end;
  2295. var
  2296. _PdhExpandWildCardPathHW: Pointer;
  2297. function PdhExpandWildCardPathHW;
  2298. begin
  2299. GetProcedureAddress(_PdhExpandWildCardPathHW, PdhLib, 'PdhExpandWildCardPathHW');
  2300. asm
  2301. MOV ESP, EBP
  2302. POP EBP
  2303. JMP [_PdhExpandWildCardPathHW]
  2304. end;
  2305. end;
  2306. var
  2307. _PdhExpandWildCardPathHA: Pointer;
  2308. function PdhExpandWildCardPathHA;
  2309. begin
  2310. GetProcedureAddress(_PdhExpandWildCardPathHA, PdhLib, 'PdhExpandWildCardPathHA');
  2311. asm
  2312. MOV ESP, EBP
  2313. POP EBP
  2314. JMP [_PdhExpandWildCardPathHA]
  2315. end;
  2316. end;
  2317. var
  2318. _PdhExpandWildCardPathH: Pointer;
  2319. function PdhExpandWildCardPathH;
  2320. begin
  2321. GetProcedureAddress(_PdhExpandWildCardPathH, PdhLib, 'PdhExpandWildCardPathH' + AWSuffix);
  2322. asm
  2323. MOV ESP, EBP
  2324. POP EBP
  2325. JMP [_PdhExpandWildCardPathH]
  2326. end;
  2327. end;
  2328. var
  2329. _PdhGetDataSourceTimeRangeH: Pointer;
  2330. function PdhGetDataSourceTimeRangeH;
  2331. begin
  2332. GetProcedureAddress(_PdhGetDataSourceTimeRangeH, PdhLib, 'PdhGetDataSourceTimeRangeH');
  2333. asm
  2334. MOV ESP, EBP
  2335. POP EBP
  2336. JMP [_PdhGetDataSourceTimeRangeH]
  2337. end;
  2338. end;
  2339. var
  2340. _PdhGetDefaultPerfObjectHW: Pointer;
  2341. function PdhGetDefaultPerfObjectHW;
  2342. begin
  2343. GetProcedureAddress(_PdhGetDefaultPerfObjectHW, PdhLib, 'PdhGetDefaultPerfObjectHW');
  2344. asm
  2345. MOV ESP, EBP
  2346. POP EBP
  2347. JMP [_PdhGetDefaultPerfObjectHW]
  2348. end;
  2349. end;
  2350. var
  2351. _PdhGetDefaultPerfObjectHA: Pointer;
  2352. function PdhGetDefaultPerfObjectHA;
  2353. begin
  2354. GetProcedureAddress(_PdhGetDefaultPerfObjectHA, PdhLib, 'PdhGetDefaultPerfObjectHA');
  2355. asm
  2356. MOV ESP, EBP
  2357. POP EBP
  2358. JMP [_PdhGetDefaultPerfObjectHA]
  2359. end;
  2360. end;
  2361. var
  2362. _PdhGetDefaultPerfObjectH: Pointer;
  2363. function PdhGetDefaultPerfObjectH;
  2364. begin
  2365. GetProcedureAddress(_PdhGetDefaultPerfObjectH, PdhLib, 'PdhGetDefaultPerfObjectH' + AWSuffix);
  2366. asm
  2367. MOV ESP, EBP
  2368. POP EBP
  2369. JMP [_PdhGetDefaultPerfObjectH]
  2370. end;
  2371. end;
  2372. var
  2373. _PdhGetDefaultPerfCounterHW: Pointer;
  2374. function PdhGetDefaultPerfCounterHW;
  2375. begin
  2376. GetProcedureAddress(_PdhGetDefaultPerfCounterHW, PdhLib, 'PdhGetDefaultPerfCounterHW');
  2377. asm
  2378. MOV ESP, EBP
  2379. POP EBP
  2380. JMP [_PdhGetDefaultPerfCounterHW]
  2381. end;
  2382. end;
  2383. var
  2384. _PdhGetDefaultPerfCounterHA: Pointer;
  2385. function PdhGetDefaultPerfCounterHA;
  2386. begin
  2387. GetProcedureAddress(_PdhGetDefaultPerfCounterHA, PdhLib, 'PdhGetDefaultPerfCounterHA');
  2388. asm
  2389. MOV ESP, EBP
  2390. POP EBP
  2391. JMP [_PdhGetDefaultPerfCounterHA]
  2392. end;
  2393. end;
  2394. var
  2395. _PdhGetDefaultPerfCounterH: Pointer;
  2396. function PdhGetDefaultPerfCounterH;
  2397. begin
  2398. GetProcedureAddress(_PdhGetDefaultPerfCounterH, PdhLib, 'PdhGetDefaultPerfCounterH' + AWSuffix);
  2399. asm
  2400. MOV ESP, EBP
  2401. POP EBP
  2402. JMP [_PdhGetDefaultPerfCounterH]
  2403. end;
  2404. end;
  2405. var
  2406. _PdhBrowseCountersHW: Pointer;
  2407. function PdhBrowseCountersHW;
  2408. begin
  2409. GetProcedureAddress(_PdhBrowseCountersHW, PdhLib, 'PdhBrowseCountersHW');
  2410. asm
  2411. MOV ESP, EBP
  2412. POP EBP
  2413. JMP [_PdhBrowseCountersHW]
  2414. end;
  2415. end;
  2416. var
  2417. _PdhBrowseCountersHA: Pointer;
  2418. function PdhBrowseCountersHA;
  2419. begin
  2420. GetProcedureAddress(_PdhBrowseCountersHA, PdhLib, 'PdhBrowseCountersHA');
  2421. asm
  2422. MOV ESP, EBP
  2423. POP EBP
  2424. JMP [_PdhBrowseCountersHA]
  2425. end;
  2426. end;
  2427. var
  2428. _PdhBrowseCountersH: Pointer;
  2429. function PdhBrowseCountersH;
  2430. begin
  2431. GetProcedureAddress(_PdhBrowseCountersH, PdhLib, 'PdhBrowseCountersH' + AWSuffix);
  2432. asm
  2433. MOV ESP, EBP
  2434. POP EBP
  2435. JMP [_PdhBrowseCountersH]
  2436. end;
  2437. end;
  2438. var
  2439. _PdhVerifySQLDBW: Pointer;
  2440. function PdhVerifySQLDBW;
  2441. begin
  2442. GetProcedureAddress(_PdhVerifySQLDBW, PdhLib, 'PdhVerifySQLDBW');
  2443. asm
  2444. MOV ESP, EBP
  2445. POP EBP
  2446. JMP [_PdhVerifySQLDBW]
  2447. end;
  2448. end;
  2449. var
  2450. _PdhVerifySQLDBA: Pointer;
  2451. function PdhVerifySQLDBA;
  2452. begin
  2453. GetProcedureAddress(_PdhVerifySQLDBA, PdhLib, 'PdhVerifySQLDBA');
  2454. asm
  2455. MOV ESP, EBP
  2456. POP EBP
  2457. JMP [_PdhVerifySQLDBA]
  2458. end;
  2459. end;
  2460. var
  2461. _PdhVerifySQLDB: Pointer;
  2462. function PdhVerifySQLDB;
  2463. begin
  2464. GetProcedureAddress(_PdhVerifySQLDB, PdhLib, 'PdhVerifySQLDB' + AWSuffix);
  2465. asm
  2466. MOV ESP, EBP
  2467. POP EBP
  2468. JMP [_PdhVerifySQLDB]
  2469. end;
  2470. end;
  2471. var
  2472. _PdhCreateSQLTablesW: Pointer;
  2473. function PdhCreateSQLTablesW;
  2474. begin
  2475. GetProcedureAddress(_PdhCreateSQLTablesW, PdhLib, 'PdhCreateSQLTablesW');
  2476. asm
  2477. MOV ESP, EBP
  2478. POP EBP
  2479. JMP [_PdhCreateSQLTablesW]
  2480. end;
  2481. end;
  2482. var
  2483. _PdhCreateSQLTablesA: Pointer;
  2484. function PdhCreateSQLTablesA;
  2485. begin
  2486. GetProcedureAddress(_PdhCreateSQLTablesA, PdhLib, 'PdhCreateSQLTablesA');
  2487. asm
  2488. MOV ESP, EBP
  2489. POP EBP
  2490. JMP [_PdhCreateSQLTablesA]
  2491. end;
  2492. end;
  2493. var
  2494. _PdhCreateSQLTables: Pointer;
  2495. function PdhCreateSQLTables;
  2496. begin
  2497. GetProcedureAddress(_PdhCreateSQLTables, PdhLib, 'PdhCreateSQLTables' + AWSuffix);
  2498. asm
  2499. MOV ESP, EBP
  2500. POP EBP
  2501. JMP [_PdhCreateSQLTables]
  2502. end;
  2503. end;
  2504. var
  2505. _PdhEnumLogSetNamesW: Pointer;
  2506. function PdhEnumLogSetNamesW;
  2507. begin
  2508. GetProcedureAddress(_PdhEnumLogSetNamesW, PdhLib, 'PdhEnumLogSetNamesW');
  2509. asm
  2510. MOV ESP, EBP
  2511. POP EBP
  2512. JMP [_PdhEnumLogSetNamesW]
  2513. end;
  2514. end;
  2515. var
  2516. _PdhEnumLogSetNamesA: Pointer;
  2517. function PdhEnumLogSetNamesA;
  2518. begin
  2519. GetProcedureAddress(_PdhEnumLogSetNamesA, PdhLib, 'PdhEnumLogSetNamesA');
  2520. asm
  2521. MOV ESP, EBP
  2522. POP EBP
  2523. JMP [_PdhEnumLogSetNamesA]
  2524. end;
  2525. end;
  2526. var
  2527. _PdhEnumLogSetNames: Pointer;
  2528. function PdhEnumLogSetNames;
  2529. begin
  2530. GetProcedureAddress(_PdhEnumLogSetNames, PdhLib, 'PdhEnumLogSetNames' + AWSuffix);
  2531. asm
  2532. MOV ESP, EBP
  2533. POP EBP
  2534. JMP [_PdhEnumLogSetNames]
  2535. end;
  2536. end;
  2537. var
  2538. _PdhGetLogSetGUID: Pointer;
  2539. function PdhGetLogSetGUID;
  2540. begin
  2541. GetProcedureAddress(_PdhGetLogSetGUID, PdhLib, 'PdhGetLogSetGUID');
  2542. asm
  2543. MOV ESP, EBP
  2544. POP EBP
  2545. JMP [_PdhGetLogSetGUID]
  2546. end;
  2547. end;
  2548. var
  2549. _PdhSetLogSetRunID: Pointer;
  2550. function PdhSetLogSetRunID;
  2551. begin
  2552. GetProcedureAddress(_PdhSetLogSetRunID, PdhLib, 'PdhSetLogSetRunID');
  2553. asm
  2554. MOV ESP, EBP
  2555. POP EBP
  2556. JMP [_PdhSetLogSetRunID]
  2557. end;
  2558. end;
  2559. {$ELSE}
  2560. function PdhGetDllVersion; external PdhLib name 'PdhGetDllVersion';
  2561. function PdhOpenQueryA; external PdhLib name 'PdhOpenQueryA';
  2562. function PdhOpenQueryW; external PdhLib name 'PdhOpenQueryW';
  2563. function PdhOpenQuery; external PdhLib name 'PdhOpenQuery' + AWSuffix;
  2564. function PdhAddCounterA; external PdhLib name 'PdhAddCounterA';
  2565. function PdhAddCounterW; external PdhLib name 'PdhAddCounterW';
  2566. function PdhAddCounter; external PdhLib name 'PdhAddCounter' + AWSuffix;
  2567. function PdhRemoveCounter; external PdhLib name 'PdhRemoveCounter';
  2568. function PdhCollectQueryData; external PdhLib name 'PdhCollectQueryData';
  2569. function PdhCloseQuery; external PdhLib name 'PdhCloseQuery';
  2570. function PdhGetFormattedCounterValue; external PdhLib name 'PdhGetFormattedCounterValue';
  2571. function PdhGetFormattedCounterArrayA; external PdhLib name 'PdhGetFormattedCounterArrayA';
  2572. function PdhGetFormattedCounterArrayW; external PdhLib name 'PdhGetFormattedCounterArrayW';
  2573. function PdhGetFormattedCounterArray; external PdhLib name 'PdhGetFormattedCounterArray' + AWSuffix;
  2574. function PdhGetRawCounterValue; external PdhLib name 'PdhGetRawCounterValue';
  2575. function PdhGetRawCounterArrayA; external PdhLib name 'PdhGetRawCounterArrayA';
  2576. function PdhGetRawCounterArrayW; external PdhLib name 'PdhGetRawCounterArrayW';
  2577. function PdhGetRawCounterArray; external PdhLib name 'PdhGetRawCounterArray' + AWSuffix;
  2578. function PdhCalculateCounterFromRawValue; external PdhLib name 'PdhCalculateCounterFromRawValue';
  2579. function PdhComputeCounterStatistics; external PdhLib name 'PdhComputeCounterStatistics';
  2580. function PdhGetCounterInfoA; external PdhLib name 'PdhGetCounterInfoA';
  2581. function PdhGetCounterInfoW; external PdhLib name 'PdhGetCounterInfoW';
  2582. function PdhGetCounterInfo; external PdhLib name 'PdhGetCounterInfo' + AWSuffix;
  2583. function PdhSetCounterScaleFactor; external PdhLib name 'PdhSetCounterScaleFactor';
  2584. function PdhConnectMachineA; external PdhLib name 'PdhConnectMachineA';
  2585. function PdhConnectMachineW; external PdhLib name 'PdhConnectMachineW';
  2586. function PdhConnectMachine; external PdhLib name 'PdhConnectMachine' + AWSuffix;
  2587. function PdhEnumMachinesA; external PdhLib name 'PdhEnumMachinesA';
  2588. function PdhEnumMachinesW; external PdhLib name 'PdhEnumMachinesW';
  2589. function PdhEnumMachines; external PdhLib name 'PdhEnumMachines' + AWSuffix;
  2590. function PdhEnumObjectsA; external PdhLib name 'PdhEnumObjectsA';
  2591. function PdhEnumObjectsW; external PdhLib name 'PdhEnumObjectsW';
  2592. function PdhEnumObjects; external PdhLib name 'PdhEnumObjects' + AWSuffix;
  2593. function PdhEnumObjectItemsA; external PdhLib name 'PdhEnumObjectItemsA';
  2594. function PdhEnumObjectItemsW; external PdhLib name 'PdhEnumObjectItemsW';
  2595. function PdhEnumObjectItems; external PdhLib name 'PdhEnumObjectItems' + AWSuffix;
  2596. function PdhMakeCounterPathA; external PdhLib name 'PdhMakeCounterPathA';
  2597. function PdhMakeCounterPathW; external PdhLib name 'PdhMakeCounterPathW';
  2598. function PdhMakeCounterPath; external PdhLib name 'PdhMakeCounterPath' + AWSuffix;
  2599. function PdhParseCounterPathA; external PdhLib name 'PdhParseCounterPathA';
  2600. function PdhParseCounterPathW; external PdhLib name 'PdhParseCounterPathW';
  2601. function PdhParseCounterPath; external PdhLib name 'PdhParseCounterPath' + AWSuffix;
  2602. function PdhParseInstanceNameA; external PdhLib name 'PdhParseInstanceNameA';
  2603. function PdhParseInstanceNameW; external PdhLib name 'PdhParseInstanceNameW';
  2604. function PdhParseInstanceName; external PdhLib name 'PdhParseInstanceName' + AWSuffix;
  2605. function PdhValidatePathA; external PdhLib name 'PdhValidatePathA';
  2606. function PdhValidatePathW; external PdhLib name 'PdhValidatePathW';
  2607. function PdhValidatePath; external PdhLib name 'PdhValidatePath' + AWSuffix;
  2608. function PdhGetDefaultPerfObjectA; external PdhLib name 'PdhGetDefaultPerfObjectA';
  2609. function PdhGetDefaultPerfObjectW; external PdhLib name 'PdhGetDefaultPerfObjectW';
  2610. function PdhGetDefaultPerfObject; external PdhLib name 'PdhGetDefaultPerfObject' + AWSuffix;
  2611. function PdhGetDefaultPerfCounterA; external PdhLib name 'PdhGetDefaultPerfCounterA';
  2612. function PdhGetDefaultPerfCounterW; external PdhLib name 'PdhGetDefaultPerfCounterW';
  2613. function PdhGetDefaultPerfCounter; external PdhLib name 'PdhGetDefaultPerfCounter' + AWSuffix;
  2614. function PdhBrowseCountersA; external PdhLib name 'PdhBrowseCountersA';
  2615. function PdhBrowseCountersW; external PdhLib name 'PdhBrowseCountersW';
  2616. function PdhBrowseCounters; external PdhLib name 'PdhBrowseCounters' + AWSuffix;
  2617. function PdhExpandCounterPathA; external PdhLib name 'PdhExpandCounterPathA';
  2618. function PdhExpandCounterPathW; external PdhLib name 'PdhExpandCounterPathW';
  2619. function PdhExpandCounterPath; external PdhLib name 'PdhExpandCounterPath' + AWSuffix;
  2620. function PdhLookupPerfNameByIndexA; external PdhLib name 'PdhLookupPerfNameByIndexA';
  2621. function PdhLookupPerfNameByIndexW; external PdhLib name 'PdhLookupPerfNameByIndexW';
  2622. function PdhLookupPerfNameByIndex; external PdhLib name 'PdhLookupPerfNameByIndex' + AWSuffix;
  2623. function PdhLookupPerfIndexByNameA; external PdhLib name 'PdhLookupPerfIndexByNameA';
  2624. function PdhLookupPerfIndexByNameW; external PdhLib name 'PdhLookupPerfIndexByNameW';
  2625. function PdhLookupPerfIndexByName; external PdhLib name 'PdhLookupPerfIndexByName' + AWSuffix;
  2626. function PdhExpandWildCardPathA; external PdhLib name 'PdhExpandWildCardPathA';
  2627. function PdhExpandWildCardPathW; external PdhLib name 'PdhExpandWildCardPathW';
  2628. function PdhExpandWildCardPath; external PdhLib name 'PdhExpandWildCardPath' + AWSuffix;
  2629. function PdhOpenLogA; external PdhLib name 'PdhOpenLogA';
  2630. function PdhOpenLogW; external PdhLib name 'PdhOpenLogW';
  2631. function PdhOpenLog; external PdhLib name 'PdhOpenLog' + AWSuffix;
  2632. function PdhUpdateLogA; external PdhLib name 'PdhUpdateLogA';
  2633. function PdhUpdateLogW; external PdhLib name 'PdhUpdateLogW';
  2634. function PdhUpdateLog; external PdhLib name 'PdhUpdateLog' + AWSuffix;
  2635. function PdhUpdateLogFileCatalog; external PdhLib name 'PdhUpdateLogFileCatalog';
  2636. function PdhGetLogFileSize; external PdhLib name 'PdhGetLogFileSize';
  2637. function PdhCloseLog; external PdhLib name 'PdhCloseLog';
  2638. function PdhSelectDataSourceA; external PdhLib name 'PdhSelectDataSourceA';
  2639. function PdhSelectDataSourceW; external PdhLib name 'PdhSelectDataSourceW';
  2640. function PdhSelectDataSource; external PdhLib name 'PdhSelectDataSource' + AWSuffix;
  2641. function PdhIsRealTimeQuery; external PdhLib name 'PdhIsRealTimeQuery';
  2642. function PdhSetQueryTimeRange; external PdhLib name 'PdhSetQueryTimeRange';
  2643. function PdhGetDataSourceTimeRangeA; external PdhLib name 'PdhGetDataSourceTimeRangeA';
  2644. function PdhGetDataSourceTimeRangeW; external PdhLib name 'PdhGetDataSourceTimeRangeW';
  2645. function PdhGetDataSourceTimeRange; external PdhLib name 'PdhGetDataSourceTimeRange' + AWSuffix;
  2646. function PdhCollectQueryDataEx; external PdhLib name 'PdhCollectQueryDataEx';
  2647. function PdhFormatFromRawValue; external PdhLib name 'PdhFormatFromRawValue';
  2648. function PdhGetCounterTimeBase; external PdhLib name 'PdhGetCounterTimeBase';
  2649. function PdhReadRawLogRecord; external PdhLib name 'PdhReadRawLogRecord';
  2650. function PdhSetDefaultRealTimeDataSource; external PdhLib name 'PdhSetDefaultRealTimeDataSource';
  2651. function PdhBindInputDataSourceW; external PdhLib name 'PdhBindInputDataSourceW';
  2652. function PdhBindInputDataSourceA; external PdhLib name 'PdhBindInputDataSourceA';
  2653. function PdhBindInputDataSource; external PdhLib name 'PdhBindInputDataSource' + AWSuffix;
  2654. function PdhOpenQueryH; external PdhLib name 'PdhOpenQueryH';
  2655. function PdhEnumMachinesHW; external PdhLib name 'PdhEnumMachinesHW';
  2656. function PdhEnumMachinesHA; external PdhLib name 'PdhEnumMachinesHA';
  2657. function PdhEnumMachinesH; external PdhLib name 'PdhEnumMachinesH' + AWSuffix;
  2658. function PdhEnumObjectsHW; external PdhLib name 'PdhEnumObjectsHW';
  2659. function PdhEnumObjectsHA; external PdhLib name 'PdhEnumObjectsHA';
  2660. function PdhEnumObjectsH; external PdhLib name 'PdhEnumObjectsH' + AWSuffix;
  2661. function PdhEnumObjectItemsHW; external PdhLib name 'PdhEnumObjectItemsHW';
  2662. function PdhEnumObjectItemsHA; external PdhLib name 'PdhEnumObjectItemsHA';
  2663. function PdhEnumObjectItemsH; external PdhLib name 'PdhEnumObjectItemsH' + AWSuffix;
  2664. function PdhExpandWildCardPathHW; external PdhLib name 'PdhExpandWildCardPathHW';
  2665. function PdhExpandWildCardPathHA; external PdhLib name 'PdhExpandWildCardPathHA';
  2666. function PdhExpandWildCardPathH; external PdhLib name 'PdhExpandWildCardPathH' + AWSuffix;
  2667. function PdhGetDataSourceTimeRangeH; external PdhLib name 'PdhGetDataSourceTimeRangeH';
  2668. function PdhGetDefaultPerfObjectHW; external PdhLib name 'PdhGetDefaultPerfObjectHW';
  2669. function PdhGetDefaultPerfObjectHA; external PdhLib name 'PdhGetDefaultPerfObjectHA';
  2670. function PdhGetDefaultPerfObjectH; external PdhLib name 'PdhGetDefaultPerfObjectH' + AWSuffix;
  2671. function PdhGetDefaultPerfCounterHW; external PdhLib name 'PdhGetDefaultPerfCounterHW';
  2672. function PdhGetDefaultPerfCounterHA; external PdhLib name 'PdhGetDefaultPerfCounterHA';
  2673. function PdhGetDefaultPerfCounterH; external PdhLib name 'PdhGetDefaultPerfCounterH' + AWSuffix;
  2674. function PdhBrowseCountersHW; external PdhLib name 'PdhBrowseCountersHW';
  2675. function PdhBrowseCountersHA; external PdhLib name 'PdhBrowseCountersHA';
  2676. function PdhBrowseCountersH; external PdhLib name 'PdhBrowseCountersH' + AWSuffix;
  2677. function PdhVerifySQLDBW; external PdhLib name 'PdhVerifySQLDBW';
  2678. function PdhVerifySQLDBA; external PdhLib name 'PdhVerifySQLDBA';
  2679. function PdhVerifySQLDB; external PdhLib name 'PdhVerifySQLDB' + AWSuffix;
  2680. function PdhCreateSQLTablesW; external PdhLib name 'PdhCreateSQLTablesW';
  2681. function PdhCreateSQLTablesA; external PdhLib name 'PdhCreateSQLTablesA';
  2682. function PdhCreateSQLTables; external PdhLib name 'PdhCreateSQLTables' + AWSuffix;
  2683. function PdhEnumLogSetNamesW; external PdhLib name 'PdhEnumLogSetNamesW';
  2684. function PdhEnumLogSetNamesA; external PdhLib name 'PdhEnumLogSetNamesA';
  2685. function PdhEnumLogSetNames; external PdhLib name 'PdhEnumLogSetNames' + AWSuffix;
  2686. function PdhGetLogSetGUID; external PdhLib name 'PdhGetLogSetGUID';
  2687. function PdhSetLogSetRunID; external PdhLib name 'PdhSetLogSetRunID';
  2688. {$ENDIF DYNAMIC_LINK}
  2689. end.