JwaLoadPerf.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:17k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Performance Monitoring Installer 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: loadperf.h, released June 2000. The original Pascal    }
  9. { code is: LoadPerf.pas, released December 2000. The initial developer of the  }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.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 home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaLoadPerf;
  44. interface
  45. uses
  46.   JwaWinType;
  47. // flags for dwFlags Argument
  48. const
  49.   LOADPERF_FLAGS_DELETE_MOF_ON_EXIT  = ULONG_PTR(1);
  50.   {$EXTERNALSYM LOADPERF_FLAGS_DELETE_MOF_ON_EXIT}
  51.   LOADPERF_FLAGS_LOAD_REGISTRY_ONLY  = ULONG_PTR(2);
  52.   {$EXTERNALSYM LOADPERF_FLAGS_LOAD_REGISTRY_ONLY}
  53.   LOADPERF_FLAGS_CREATE_MOF_ONLY     = ULONG_PTR(4);
  54.   {$EXTERNALSYM LOADPERF_FLAGS_CREATE_MOF_ONLY}
  55.   LOADPERF_FLAGS_DISPLAY_USER_MSGS   = ULONG_PTR(8);
  56.   {$EXTERNALSYM LOADPERF_FLAGS_DISPLAY_USER_MSGS}
  57. (* removed PSDK XP SP1
  58. // note: LOADPERF_FLAGS_LOAD_REGISTRY_ONLY is not a valid flag for
  59. // LoadMofFromInstalledServiceA/W as the service must already be installed
  60. function LoadMofFromInstalledServiceA(szServiceName, szMofFilename: LPCSTR;
  61.   dwFlags: ULONG_PTR): DWORD; stdcall;
  62. {$EXTERNALSYM LoadMofFromInstalledServiceA}
  63. function LoadMofFromInstalledServiceW(szServiceName, szMofFilename: LPCWSTR;
  64.   dwFlags: ULONG_PTR): DWORD; stdcall;
  65. {$EXTERNALSYM LoadMofFromInstalledServiceW}
  66. {$IFDEF UNICODE}
  67. function LoadMofFromInstalledService(szServiceName, szMofFilename: LPCWSTR;
  68.   dwFlags: ULONG_PTR): DWORD; stdcall;
  69. {$EXTERNALSYM LoadMofFromInstalledService}
  70. {$ELSE}
  71. function LoadMofFromInstalledService(szServiceName, szMofFilename: LPCSTR;
  72.   dwFlags: ULONG_PTR): DWORD; stdcall;
  73. {$EXTERNALSYM LoadMofFromInstalledService}
  74. {$ENDIF}
  75. *)
  76. function InstallPerfDllA(szComputerName, lpIniFile: LPCSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  77. {$EXTERNALSYM InstallPerfDllA}
  78. function InstallPerfDllW(szComputerName, lpIniFile: LPCWSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  79. {$EXTERNALSYM InstallPerfDllW}
  80. {$IFDEF UNICODE}
  81. function InstallPerfDll(szComputerName, lpIniFile: LPCWSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  82. {$EXTERNALSYM InstallPerfDll}
  83. {$ELSE}
  84. function InstallPerfDll(szComputerName, lpIniFile: LPCSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  85. {$EXTERNALSYM InstallPerfDll}
  86. {$ENDIF}
  87. function LoadPerfCounterTextStringsA(lpCommandLine: LPSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  88. {$EXTERNALSYM LoadPerfCounterTextStringsA}
  89. function LoadPerfCounterTextStringsW(lpCommandLine: LPWSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  90. {$EXTERNALSYM LoadPerfCounterTextStringsW}
  91. {$IFDEF UNICODE}
  92. function LoadPerfCounterTextStrings(lpCommandLine: LPWSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  93. {$EXTERNALSYM LoadPerfCounterTextStrings}
  94. {$ELSE}
  95. function LoadPerfCounterTextStrings(lpCommandLine: LPSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  96. {$EXTERNALSYM LoadPerfCounterTextStrings}
  97. {$ENDIF}
  98. function UnloadPerfCounterTextStringsA(lpCommandLine: LPSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  99. {$EXTERNALSYM UnloadPerfCounterTextStringsA}
  100. function UnloadPerfCounterTextStringsW(lpCommandLine: LPWSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  101. {$EXTERNALSYM UnloadPerfCounterTextStringsW}
  102. {$IFDEF UNICODE}
  103. function UnloadPerfCounterTextStrings(lpCommandLine: LPWSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  104. {$EXTERNALSYM UnloadPerfCounterTextStrings}
  105. {$ELSE}
  106. function UnloadPerfCounterTextStrings(lpCommandLine: LPSTR; bQuietModeArg: BOOL): DWORD; stdcall;
  107. {$EXTERNALSYM UnloadPerfCounterTextStrings}
  108. {$ENDIF}
  109. function UpdatePerfNameFilesA(szNewCtrFilePath, szNewHlpFilePath: LPCSTR;
  110.   szLanguageID: LPSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  111. {$EXTERNALSYM UpdatePerfNameFilesA}
  112. function UpdatePerfNameFilesW(szNewCtrFilePath, szNewHlpFilePath: LPCWSTR;
  113.   szLanguageID: LPWSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  114. {$EXTERNALSYM UpdatePerfNameFilesW}
  115. {$IFDEF UNICODE}
  116. function UpdatePerfNameFiles(szNewCtrFilePath, szNewHlpFilePath: LPCWSTR;
  117.   szLanguageID: LPWSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  118. {$EXTERNALSYM UpdatePerfNameFiles}
  119. {$ELSE}
  120. function UpdatePerfNameFiles(szNewCtrFilePath, szNewHlpFilePath: LPCSTR;
  121.   szLanguageID: LPSTR; dwFlags: ULONG_PTR): DWORD; stdcall;
  122. {$EXTERNALSYM UpdatePerfNameFiles}
  123. {$ENDIF}
  124. function SetServiceAsTrustedA(szReserved, szServiceName: LPCSTR): DWORD; stdcall;
  125. {$EXTERNALSYM SetServiceAsTrustedA}
  126. function SetServiceAsTrustedW(szReserved, szServiceName: LPCWSTR): DWORD; stdcall;
  127. {$EXTERNALSYM SetServiceAsTrustedW}
  128. {$IFDEF UNICODE}
  129. function SetServiceAsTrusted(szReserved, szServiceName: LPCWSTR): DWORD; stdcall;
  130. {$EXTERNALSYM SetServiceAsTrusted}
  131. {$ELSE}
  132. function SetServiceAsTrusted(szReserved, szServiceName: LPCSTR): DWORD; stdcall;
  133. {$EXTERNALSYM SetServiceAsTrusted}
  134. {$ENDIF}
  135. function BackupPerfRegistryToFileW(szFileName: LPCWSTR; szCommentString: LPCWSTR): DWORD; stdcall;
  136. {$EXTERNALSYM BackupPerfRegistryToFileW}
  137. function RestorePerfRegistryFromFileW(szFileName: LPCWSTR; szLangId: LPCWSTR): DWORD; stdcall;
  138. {$EXTERNALSYM RestorePerfRegistryFromFileW}
  139. implementation
  140. const
  141.   loadperflib = 'loadperf.dll';
  142. {$IFDEF DYNAMIC_LINK}
  143. var
  144.   _InstallPerfDllA: Pointer;
  145. function InstallPerfDllA;
  146. begin
  147.   GetProcedureAddress(_InstallPerfDllA, loadperflib, 'InstallPerfDllA');
  148.   asm
  149.     mov esp, ebp
  150.     pop ebp
  151.     jmp [_InstallPerfDllA]
  152.   end;
  153. end;
  154. {$ELSE}
  155. function InstallPerfDllA; external loadperflib name 'InstallPerfDllA';
  156. {$ENDIF DYNAMIC_LINK}
  157. {$IFDEF DYNAMIC_LINK}
  158. var
  159.   _InstallPerfDllW: Pointer;
  160. function InstallPerfDllW;
  161. begin
  162.   GetProcedureAddress(_InstallPerfDllW, loadperflib, 'InstallPerfDllW');
  163.   asm
  164.     mov esp, ebp
  165.     pop ebp
  166.     jmp [_InstallPerfDllW]
  167.   end;
  168. end;
  169. {$ELSE}
  170. function InstallPerfDllW; external loadperflib name 'InstallPerfDllW';
  171. {$ENDIF DYNAMIC_LINK}
  172. {$IFDEF UNICODE}
  173. {$IFDEF DYNAMIC_LINK}
  174. var
  175.   _InstallPerfDll: Pointer;
  176. function InstallPerfDll;
  177. begin
  178.   GetProcedureAddress(_InstallPerfDll, loadperflib, 'InstallPerfDllW');
  179.   asm
  180.     mov esp, ebp
  181.     pop ebp
  182.     jmp [_InstallPerfDll]
  183.   end;
  184. end;
  185. {$ELSE}
  186. function InstallPerfDll; external loadperflib name 'InstallPerfDllW';
  187. {$ENDIF DYNAMIC_LINK}
  188. {$ELSE}
  189. {$IFDEF DYNAMIC_LINK}
  190. var
  191.   _InstallPerfDll: Pointer;
  192. function InstallPerfDll;
  193. begin
  194.   GetProcedureAddress(_InstallPerfDll, loadperflib, 'InstallPerfDllA');
  195.   asm
  196.     mov esp, ebp
  197.     pop ebp
  198.     jmp [_InstallPerfDll]
  199.   end;
  200. end;
  201. {$ELSE}
  202. function InstallPerfDll; external loadperflib name 'InstallPerfDllA';
  203. {$ENDIF DYNAMIC_LINK}
  204. {$ENDIF}
  205. {$IFDEF DYNAMIC_LINK}
  206. var
  207.   _LoadPerfCounterTextStringsA: Pointer;
  208. function LoadPerfCounterTextStringsA;
  209. begin
  210.   GetProcedureAddress(_LoadPerfCounterTextStringsA, loadperflib, 'LoadPerfCounterTextStringsA');
  211.   asm
  212.     mov esp, ebp
  213.     pop ebp
  214.     jmp [_LoadPerfCounterTextStringsA]
  215.   end;
  216. end;
  217. {$ELSE}
  218. function LoadPerfCounterTextStringsA; external loadperflib name 'LoadPerfCounterTextStringsA';
  219. {$ENDIF DYNAMIC_LINK}
  220. {$IFDEF DYNAMIC_LINK}
  221. var
  222.   _LoadPerfCounterTextStringsW: Pointer;
  223. function LoadPerfCounterTextStringsW;
  224. begin
  225.   GetProcedureAddress(_LoadPerfCounterTextStringsW, loadperflib, 'LoadPerfCounterTextStringsW');
  226.   asm
  227.     mov esp, ebp
  228.     pop ebp
  229.     jmp [_LoadPerfCounterTextStringsW]
  230.   end;
  231. end;
  232. {$ELSE}
  233. function LoadPerfCounterTextStringsW; external loadperflib name 'LoadPerfCounterTextStringsW';
  234. {$ENDIF DYNAMIC_LINK}
  235. {$IFDEF UNICODE}
  236. {$IFDEF DYNAMIC_LINK}
  237. var
  238.   _LoadPerfCounterTextStrings: Pointer;
  239. function LoadPerfCounterTextStrings;
  240. begin
  241.   GetProcedureAddress(_LoadPerfCounterTextStrings, loadperflib, 'LoadPerfCounterTextStringsW');
  242.   asm
  243.     mov esp, ebp
  244.     pop ebp
  245.     jmp [_LoadPerfCounterTextStrings]
  246.   end;
  247. end;
  248. {$ELSE}
  249. function LoadPerfCounterTextStrings; external loadperflib name 'LoadPerfCounterTextStringsW';
  250. {$ENDIF DYNAMIC_LINK}
  251. {$ELSE}
  252. {$IFDEF DYNAMIC_LINK}
  253. var
  254.   _LoadPerfCounterTextStrings: Pointer;
  255. function LoadPerfCounterTextStrings;
  256. begin
  257.   GetProcedureAddress(_LoadPerfCounterTextStrings, loadperflib, 'LoadPerfCounterTextStringsA');
  258.   asm
  259.     mov esp, ebp
  260.     pop ebp
  261.     jmp [_LoadPerfCounterTextStrings]
  262.   end;
  263. end;
  264. {$ELSE}
  265. function LoadPerfCounterTextStrings; external loadperflib name 'LoadPerfCounterTextStringsA';
  266. {$ENDIF DYNAMIC_LINK}
  267. {$ENDIF}
  268. {$IFDEF DYNAMIC_LINK}
  269. var
  270.   _UnloadPerfCounterTextStringsA: Pointer;
  271. function UnloadPerfCounterTextStringsA;
  272. begin
  273.   GetProcedureAddress(_UnloadPerfCounterTextStringsA, loadperflib, 'UnloadPerfCounterTextStringsA');
  274.   asm
  275.     mov esp, ebp
  276.     pop ebp
  277.     jmp [_UnloadPerfCounterTextStringsA]
  278.   end;
  279. end;
  280. {$ELSE}
  281. function UnloadPerfCounterTextStringsA; external loadperflib name 'UnloadPerfCounterTextStringsA';
  282. {$ENDIF DYNAMIC_LINK}
  283. {$IFDEF DYNAMIC_LINK}
  284. var
  285.   _UnloadPerfCounterTextStringsW: Pointer;
  286. function UnloadPerfCounterTextStringsW;
  287. begin
  288.   GetProcedureAddress(_UnloadPerfCounterTextStringsW, loadperflib, 'UnloadPerfCounterTextStringsW');
  289.   asm
  290.     mov esp, ebp
  291.     pop ebp
  292.     jmp [_UnloadPerfCounterTextStringsW]
  293.   end;
  294. end;
  295. {$ELSE}
  296. function UnloadPerfCounterTextStringsW; external loadperflib name 'UnloadPerfCounterTextStringsW';
  297. {$ENDIF DYNAMIC_LINK}
  298. {$IFDEF UNICODE}
  299. {$IFDEF DYNAMIC_LINK}
  300. var
  301.   _UnloadPerfCounterTextStrings: Pointer;
  302. function UnloadPerfCounterTextStrings;
  303. begin
  304.   GetProcedureAddress(_UnloadPerfCounterTextStrings, loadperflib, 'UnloadPerfCounterTextStringsW');
  305.   asm
  306.     mov esp, ebp
  307.     pop ebp
  308.     jmp [_UnloadPerfCounterTextStrings]
  309.   end;
  310. end;
  311. {$ELSE}
  312. function UnloadPerfCounterTextStrings; external loadperflib name 'UnloadPerfCounterTextStringsW';
  313. {$ENDIF DYNAMIC_LINK}
  314. {$ELSE}
  315. {$IFDEF DYNAMIC_LINK}
  316. var
  317.   _UnloadPerfCounterTextStrings: Pointer;
  318. function UnloadPerfCounterTextStrings;
  319. begin
  320.   GetProcedureAddress(_UnloadPerfCounterTextStrings, loadperflib, 'UnloadPerfCounterTextStringsA');
  321.   asm
  322.     mov esp, ebp
  323.     pop ebp
  324.     jmp [_UnloadPerfCounterTextStrings]
  325.   end;
  326. end;
  327. {$ELSE}
  328. function UnloadPerfCounterTextStrings; external loadperflib name 'UnloadPerfCounterTextStringsA';
  329. {$ENDIF DYNAMIC_LINK}
  330. {$ENDIF}
  331. {$IFDEF DYNAMIC_LINK}
  332. var
  333.   _UpdatePerfNameFilesA: Pointer;
  334. function UpdatePerfNameFilesA;
  335. begin
  336.   GetProcedureAddress(_UpdatePerfNameFilesA, loadperflib, 'UpdatePerfNameFilesA');
  337.   asm
  338.     mov esp, ebp
  339.     pop ebp
  340.     jmp [_UpdatePerfNameFilesA]
  341.   end;
  342. end;
  343. {$ELSE}
  344. function UpdatePerfNameFilesA; external loadperflib name 'UpdatePerfNameFilesA';
  345. {$ENDIF DYNAMIC_LINK}
  346. {$IFDEF DYNAMIC_LINK}
  347. var
  348.   _UpdatePerfNameFilesW: Pointer;
  349. function UpdatePerfNameFilesW;
  350. begin
  351.   GetProcedureAddress(_UpdatePerfNameFilesW, loadperflib, 'UpdatePerfNameFilesW');
  352.   asm
  353.     mov esp, ebp
  354.     pop ebp
  355.     jmp [_UpdatePerfNameFilesW]
  356.   end;
  357. end;
  358. {$ELSE}
  359. function UpdatePerfNameFilesW; external loadperflib name 'UpdatePerfNameFilesW';
  360. {$ENDIF DYNAMIC_LINK}
  361. {$IFDEF UNICODE}
  362. {$IFDEF DYNAMIC_LINK}
  363. var
  364.   _UpdatePerfNameFiles: Pointer;
  365. function UpdatePerfNameFiles;
  366. begin
  367.   GetProcedureAddress(_UpdatePerfNameFiles, loadperflib, 'UpdatePerfNameFilesW');
  368.   asm
  369.     mov esp, ebp
  370.     pop ebp
  371.     jmp [_UpdatePerfNameFiles]
  372.   end;
  373. end;
  374. {$ELSE}
  375. function UpdatePerfNameFiles; external loadperflib name 'UpdatePerfNameFilesW';
  376. {$ENDIF DYNAMIC_LINK}
  377. {$ELSE}
  378. {$IFDEF DYNAMIC_LINK}
  379. var
  380.   _UpdatePerfNameFiles: Pointer;
  381. function UpdatePerfNameFiles;
  382. begin
  383.   GetProcedureAddress(_UpdatePerfNameFiles, loadperflib, 'UpdatePerfNameFilesA');
  384.   asm
  385.     mov esp, ebp
  386.     pop ebp
  387.     jmp [_UpdatePerfNameFiles]
  388.   end;
  389. end;
  390. {$ELSE}
  391. function UpdatePerfNameFiles; external loadperflib name 'UpdatePerfNameFilesA';
  392. {$ENDIF DYNAMIC_LINK}
  393. {$ENDIF}
  394. {$IFDEF DYNAMIC_LINK}
  395. var
  396.   _SetServiceAsTrustedA: Pointer;
  397. function SetServiceAsTrustedA;
  398. begin
  399.   GetProcedureAddress(_SetServiceAsTrustedA, loadperflib, 'SetServiceAsTrustedA');
  400.   asm
  401.     mov esp, ebp
  402.     pop ebp
  403.     jmp [_SetServiceAsTrustedA]
  404.   end;
  405. end;
  406. {$ELSE}
  407. function SetServiceAsTrustedA; external loadperflib name 'SetServiceAsTrustedA';
  408. {$ENDIF DYNAMIC_LINK}
  409. {$IFDEF DYNAMIC_LINK}
  410. var
  411.   _SetServiceAsTrustedW: Pointer;
  412. function SetServiceAsTrustedW;
  413. begin
  414.   GetProcedureAddress(_SetServiceAsTrustedW, loadperflib, 'SetServiceAsTrustedW');
  415.   asm
  416.     mov esp, ebp
  417.     pop ebp
  418.     jmp [_SetServiceAsTrustedW]
  419.   end;
  420. end;
  421. {$ELSE}
  422. function SetServiceAsTrustedW; external loadperflib name 'SetServiceAsTrustedW';
  423. {$ENDIF DYNAMIC_LINK}
  424. {$IFDEF UNICODE}
  425. {$IFDEF DYNAMIC_LINK}
  426. var
  427.   _SetServiceAsTrusted: Pointer;
  428. function SetServiceAsTrusted;
  429. begin
  430.   GetProcedureAddress(_SetServiceAsTrusted, loadperflib, 'SetServiceAsTrustedW');
  431.   asm
  432.     mov esp, ebp
  433.     pop ebp
  434.     jmp [_SetServiceAsTrusted]
  435.   end;
  436. end;
  437. {$ELSE}
  438. function SetServiceAsTrusted; external loadperflib name 'SetServiceAsTrustedW';
  439. {$ENDIF DYNAMIC_LINK}
  440. {$ELSE}
  441. {$IFDEF DYNAMIC_LINK}
  442. var
  443.   _SetServiceAsTrusted: Pointer;
  444. function SetServiceAsTrusted;
  445. begin
  446.   GetProcedureAddress(_SetServiceAsTrusted, loadperflib, 'SetServiceAsTrustedA');
  447.   asm
  448.     mov esp, ebp
  449.     pop ebp
  450.     jmp [_SetServiceAsTrusted]
  451.   end;
  452. end;
  453. {$ELSE}
  454. function SetServiceAsTrusted; external loadperflib name 'SetServiceAsTrustedA';
  455. {$ENDIF DYNAMIC_LINK}
  456. {$ENDIF}
  457. {$IFDEF DYNAMIC_LINK}
  458. var
  459.   _BackupPerfRegistryToFileW: Pointer;
  460. function BackupPerfRegistryToFileW;
  461. begin
  462.   GetProcedureAddress(_BackupPerfRegistryToFileW, loadperflib, 'BackupPerfRegistryToFileW');
  463.   asm
  464.     mov esp, ebp
  465.     pop ebp
  466.     jmp [_BackupPerfRegistryToFileW]
  467.   end;
  468. end;
  469. {$ELSE}
  470. function BackupPerfRegistryToFileW; external loadperflib name 'BackupPerfRegistryToFileW';
  471. {$ENDIF DYNAMIC_LINK}
  472. {$IFDEF DYNAMIC_LINK}
  473. var
  474.   _RestorePerfRegistryFromFileW: Pointer;
  475. function RestorePerfRegistryFromFileW;
  476. begin
  477.   GetProcedureAddress(_RestorePerfRegistryFromFileW, loadperflib, 'RestorePerfRegistryFromFileW');
  478.   asm
  479.     mov esp, ebp
  480.     pop ebp
  481.     jmp [_RestorePerfRegistryFromFileW]
  482.   end;
  483. end;
  484. {$ELSE}
  485. function RestorePerfRegistryFromFileW; external loadperflib name 'RestorePerfRegistryFromFileW';
  486. {$ENDIF DYNAMIC_LINK}
  487. end.