1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
|
{******************************************************************************}
{ }
{ Process Status API interface Unit for Object Pascal }
{ }
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
{ Corporation. All Rights Reserved. }
{ }
{ The original file is: psapi.h, released June 2000. The original Pascal }
{ code is: PsApi.pas, released December 2000. The initial developer of the }
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
{ }
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
{ Marcel van Brakel. All Rights Reserved. }
{ }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ You may retrieve the latest version of this file at the Project JEDI }
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
{ }
{ The contents of this file are used with permission, subject to the Mozilla }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License. }
{ }
{ Alternatively, the contents of this file may be used under the terms of the }
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
{ provisions of the LGPL License are applicable instead of those above. }
{ If you wish to allow use of your version of this file only under the terms }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting the provisions above and }
{ replace them with the notice and other provisions required by the LGPL }
{ License. If you do not delete the provisions above, a recipient may use }
{ your version of this file under either the MPL or the LGPL License. }
{ }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ }
{******************************************************************************}
// $Id: JwaPsApi.pas,v 1.12 2007/09/05 11:58:52 dezipaitor Exp $
{$IFNDEF JWA_OMIT_SECTIONS}
unit JwaPsApi;
{$WEAKPACKAGEUNIT}
{$ENDIF JWA_OMIT_SECTIONS}
{$HPPEMIT ''}
{$HPPEMIT '#include <psapi.h>'}
{$HPPEMIT ''}
{$IFNDEF JWA_OMIT_SECTIONS}
{$I jediapilib.inc}
interface
uses
JwaWinType;
{$ENDIF JWA_OMIT_SECTIONS}
{$IFNDEF JWA_IMPLEMENTATIONSECTION}
function EnumProcesses(lpidProcess: LPDWORD; cb: DWORD; var cbNeeded: DWORD): BOOL; stdcall;
{$EXTERNALSYM EnumProcesses}
function EnumProcessModules(hProcess: HANDLE; lphModule: PHMODULE; cb: DWORD;
var lpcbNeeded: DWORD): BOOL; stdcall;
{$EXTERNALSYM EnumProcessModules}
function GetModuleBaseNameA(hProcess: HANDLE; hModule: HMODULE; lpBaseName: LPSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetModuleBaseNameA}
function GetModuleBaseNameW(hProcess: HANDLE; hModule: HMODULE; lpBaseName: LPWSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetModuleBaseNameW}
function GetModuleBaseName(hProcess: HANDLE; hModule: HMODULE; lpBaseName: LPTSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetModuleBaseName}
function GetModuleFileNameExA(hProcess: HANDLE; hModule: HMODULE; lpFilename: LPSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetModuleFileNameExA}
function GetModuleFileNameExW(hProcess: HANDLE; hModule: HMODULE; lpFilename: LPWSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetModuleFileNameExW}
function GetModuleFileNameEx(hProcess: HANDLE; hModule: HMODULE; lpFilename: LPTSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetModuleFileNameEx}
type
LPMODULEINFO = ^MODULEINFO;
{$EXTERNALSYM LPMODULEINFO}
_MODULEINFO = packed record
lpBaseOfDll: LPVOID;
SizeOfImage: DWORD;
EntryPoint: LPVOID;
end;
{$EXTERNALSYM _MODULEINFO}
MODULEINFO = _MODULEINFO;
{$EXTERNALSYM MODULEINFO}
TModuleInfo = MODULEINFO;
PModuleInfo = LPMODULEINFO;
function GetModuleInformation(hProcess: HANDLE; hModule: HMODULE;
var lpmodinfo: MODULEINFO; cb: DWORD): BOOL; stdcall;
{$EXTERNALSYM GetModuleInformation}
function EmptyWorkingSet(hProcess: HANDLE): BOOL; stdcall;
{$EXTERNALSYM EmptyWorkingSet}
function QueryWorkingSet(hProcess: HANDLE; pv: PVOID; cb: DWORD): BOOL; stdcall;
{$EXTERNALSYM QueryWorkingSet}
function InitializeProcessForWsWatch(hProcess: HANDLE): BOOL; stdcall;
{$EXTERNALSYM InitializeProcessForWsWatch}
type
PPSAPI_WS_WATCH_INFORMATION = ^PSAPI_WS_WATCH_INFORMATION;
{$EXTERNALSYM PPSAPI_WS_WATCH_INFORMATION}
_PSAPI_WS_WATCH_INFORMATION = packed record
FaultingPc: LPVOID;
FaultingVa: LPVOID;
end;
{$EXTERNALSYM _PSAPI_WS_WATCH_INFORMATION}
PSAPI_WS_WATCH_INFORMATION = _PSAPI_WS_WATCH_INFORMATION;
{$EXTERNALSYM PSAPI_WS_WATCH_INFORMATION}
TPsApiWsWatchInformation = PSAPI_WS_WATCH_INFORMATION;
PPsApiWsWatchInformation = PPSAPI_WS_WATCH_INFORMATION;
function GetWsChanges(hProcess: HANDLE; var lpWatchInfo: PSAPI_WS_WATCH_INFORMATION;
cb: DWORD): BOOL; stdcall;
{$EXTERNALSYM GetWsChanges}
function GetMappedFileNameW(hProcess: HANDLE; lpv: LPVOID; lpFilename: LPWSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetMappedFileNameW}
function GetMappedFileNameA(hProcess: HANDLE; lpv: LPVOID; lpFilename: LPSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetMappedFileNameA}
function GetMappedFileName(hProcess: HANDLE; lpv: LPVOID; lpFilename: LPTSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetMappedFileName}
function EnumDeviceDrivers(lpImageBase: LPLPVOID; cb: DWORD; var lpcbNeeded: DWORD): BOOL; stdcall;
{$EXTERNALSYM EnumDeviceDrivers}
function GetDeviceDriverBaseNameA(ImageBase: LPVOID; lpBaseName: LPSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetDeviceDriverBaseNameA}
function GetDeviceDriverBaseNameW(ImageBase: LPVOID; lpBaseName: LPWSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetDeviceDriverBaseNameW}
function GetDeviceDriverBaseName(ImageBase: LPVOID; lpBaseName: LPTSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetDeviceDriverBaseName}
function GetDeviceDriverFileNameA(ImageBase: LPVOID; lpFilename: LPSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetDeviceDriverFileNameA}
function GetDeviceDriverFileNameW(ImageBase: LPVOID; lpFilename: LPWSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetDeviceDriverFileNameW}
function GetDeviceDriverFileName(ImageBase: LPVOID; lpFilename: LPTSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetDeviceDriverFileName}
// Structure for GetProcessMemoryInfo()
type
PPROCESS_MEMORY_COUNTERS = ^PROCESS_MEMORY_COUNTERS;
{$EXTERNALSYM PPROCESS_MEMORY_COUNTERS}
_PROCESS_MEMORY_COUNTERS = packed record
cb: DWORD;
PageFaultCount: DWORD;
PeakWorkingSetSize: SIZE_T;
WorkingSetSize: SIZE_T;
QuotaPeakPagedPoolUsage: SIZE_T;
QuotaPagedPoolUsage: SIZE_T;
QuotaPeakNonPagedPoolUsage: SIZE_T;
QuotaNonPagedPoolUsage: SIZE_T;
PagefileUsage: SIZE_T;
PeakPagefileUsage: SIZE_T;
end;
{$EXTERNALSYM _PROCESS_MEMORY_COUNTERS}
PROCESS_MEMORY_COUNTERS = _PROCESS_MEMORY_COUNTERS;
{$EXTERNALSYM PROCESS_MEMORY_COUNTERS}
TProcessMemoryCounters = PROCESS_MEMORY_COUNTERS;
PProcessMemoryCounters = PPROCESS_MEMORY_COUNTERS;
_PROCESS_MEMORY_COUNTERS_EX = record
cb: DWORD;
PageFaultCount: DWORD;
PeakWorkingSetSize: SIZE_T;
WorkingSetSize: SIZE_T;
QuotaPeakPagedPoolUsage: SIZE_T;
QuotaPagedPoolUsage: SIZE_T;
QuotaPeakNonPagedPoolUsage: SIZE_T;
QuotaNonPagedPoolUsage: SIZE_T;
PagefileUsage: SIZE_T;
PeakPagefileUsage: SIZE_T;
PrivateUsage: SIZE_T;
end;
{$EXTERNALSYM _PROCESS_MEMORY_COUNTERS_EX}
PROCESS_MEMORY_COUNTERS_EX = _PROCESS_MEMORY_COUNTERS_EX;
{$EXTERNALSYM PROCESS_MEMORY_COUNTERS_EX}
PPROCESS_MEMORY_COUNTERS_EX = ^PROCESS_MEMORY_COUNTERS_EX;
{$EXTERNALSYM PPROCESS_MEMORY_COUNTERS_EX}
TProcessMemoryCountersEx = PROCESS_MEMORY_COUNTERS_EX;
function GetProcessMemoryInfo(Process: HANDLE;
var ppsmemCounters: PROCESS_MEMORY_COUNTERS; cb: DWORD): BOOL; stdcall;
{$EXTERNALSYM GetProcessMemoryInfo}
type
_PERFORMANCE_INFORMATION = record
cb: DWORD;
CommitTotal: SIZE_T;
CommitLimit: SIZE_T;
CommitPeak: SIZE_T;
PhysicalTotal: SIZE_T;
PhysicalAvailable: SIZE_T;
SystemCache: SIZE_T;
KernelTotal: SIZE_T;
KernelPaged: SIZE_T;
KernelNonpaged: SIZE_T;
PageSize: SIZE_T;
HandleCount: DWORD;
ProcessCount: DWORD;
ThreadCount: DWORD;
end;
{$EXTERNALSYM _PERFORMANCE_INFORMATION}
PERFORMANCE_INFORMATION = _PERFORMANCE_INFORMATION;
{$EXTERNALSYM PERFORMANCE_INFORMATION}
PPERFORMANCE_INFORMATION = ^PERFORMANCE_INFORMATION;
{$EXTERNALSYM PPERFORMANCE_INFORMATION}
TPerformanceInformation = PERFORMANCE_INFORMATION;
PPerformanceInformation = PPERFORMANCE_INFORMATION;
{ MVB:
Please note that this function, unlike what the Platform SDK documents, is _not_ available for Windows 2000!!!
It is available starting with Windows XP and Windows.NET Server.
If needed, you can relatively easily clone the functionality of this function by using the performance monitor
API (either through the HKEY_PERFORMANCE_DATA registry interface or using the Performance Data Helper API)
}
function GetPerformanceInfo(pPerformanceInformation: PPERFORMANCE_INFORMATION;
cb: DWORD): BOOL; stdcall;
{$EXTERNALSYM GetPerformanceInfo}
type
_ENUM_PAGE_FILE_INFORMATION = record
cb: DWORD;
Reserved: DWORD;
TotalSize: SIZE_T;
TotalInUse: SIZE_T;
PeakUsage: SIZE_T;
end;
{$EXTERNALSYM _ENUM_PAGE_FILE_INFORMATION}
ENUM_PAGE_FILE_INFORMATION = _ENUM_PAGE_FILE_INFORMATION;
{$EXTERNALSYM ENUM_PAGE_FILE_INFORMATION}
PENUM_PAGE_FILE_INFORMATION = ^ENUM_PAGE_FILE_INFORMATION;
TEnumPageFileInformation = ENUM_PAGE_FILE_INFORMATION;
PEnumPageFileInformation = PENUM_PAGE_FILE_INFORMATION;
type
PENUM_PAGE_FILE_CALLBACKW = function(pContext: LPVOID;
pPageFileInfo: PENUM_PAGE_FILE_INFORMATION; lpFilename: LPCWSTR): BOOL; stdcall;
{$EXTERNALSYM PENUM_PAGE_FILE_CALLBACKW}
PENUM_PAGE_FILE_CALLBACKA = function(pContext: LPVOID;
pPageFileInfo: PENUM_PAGE_FILE_INFORMATION; lpFilename: LPCSTR): BOOL; stdcall;
{$EXTERNALSYM PENUM_PAGE_FILE_CALLBACKA}
{$IFDEF UNICODE}
PENUM_PAGE_FILE_CALLBACK = PENUM_PAGE_FILE_CALLBACKW;
{$EXTERNALSYM PENUM_PAGE_FILE_CALLBACK}
{$ELSE}
PENUM_PAGE_FILE_CALLBACK = PENUM_PAGE_FILE_CALLBACKA;
{$EXTERNALSYM PENUM_PAGE_FILE_CALLBACK}
{$ENDIF UNICODE}
function EnumPageFilesW(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW; pContext: LPVOID): BOOL; stdcall;
{$EXTERNALSYM EnumPageFilesW}
function EnumPageFilesA(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA; pContext: LPVOID): BOOL; stdcall;
{$EXTERNALSYM EnumPageFilesA}
function EnumPageFiles(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACK; pContext: LPVOID): BOOL; stdcall;
{$EXTERNALSYM EnumPageFiles}
function GetProcessImageFileNameA(hProcess: HANDLE; lpImageFileName: LPSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetProcessImageFileNameA}
function GetProcessImageFileNameW(hProcess: HANDLE; lpImageFileName: LPWSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetProcessImageFileNameW}
function GetProcessImageFileName(hProcess: HANDLE; lpImageFileName: LPTSTR;
nSize: DWORD): DWORD; stdcall;
{$EXTERNALSYM GetProcessImageFileName}
{$ENDIF JWA_IMPLEMENTATIONSECTION}
{$IFNDEF JWA_OMIT_SECTIONS}
implementation
//uses ...
{$ENDIF JWA_OMIT_SECTIONS}
{$IFNDEF JWA_INTERFACESECTION}
{$IFNDEF JWA_INCLUDEMODE}
const
PsapiLib = 'psapi.dll';
{$IFDEF UNICODE}
AWSuffix = 'W';
{$ELSE}
AWSuffix = 'A';
{$ENDIF UNICODE}
{$ENDIF JWA_INCLUDEMODE}
{$IFDEF DYNAMIC_LINK}
var
_EnumProcesses: Pointer;
function EnumProcesses;
begin
GetProcedureAddress(_EnumProcesses, PsapiLib, 'EnumProcesses');
asm
MOV ESP, EBP
POP EBP
JMP [_EnumProcesses]
end;
end;
var
_EnumProcessModules: Pointer;
function EnumProcessModules;
begin
GetProcedureAddress(_EnumProcessModules, PsapiLib, 'EnumProcessModules');
asm
MOV ESP, EBP
POP EBP
JMP [_EnumProcessModules]
end;
end;
var
_GetModuleBaseNameA: Pointer;
function GetModuleBaseNameA;
begin
GetProcedureAddress(_GetModuleBaseNameA, PsapiLib, 'GetModuleBaseNameA');
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleBaseNameA]
end;
end;
var
_GetModuleBaseNameW: Pointer;
function GetModuleBaseNameW;
begin
GetProcedureAddress(_GetModuleBaseNameW, PsapiLib, 'GetModuleBaseNameW');
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleBaseNameW]
end;
end;
var
_GetModuleBaseName: Pointer;
function GetModuleBaseName;
begin
GetProcedureAddress(_GetModuleBaseName, PsapiLib, 'GetModuleBaseName' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleBaseName]
end;
end;
var
_GetModuleFileNameExA: Pointer;
function GetModuleFileNameExA;
begin
GetProcedureAddress(_GetModuleFileNameExA, PsapiLib, 'GetModuleFileNameExA');
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleFileNameExA]
end;
end;
var
_GetModuleFileNameExW: Pointer;
function GetModuleFileNameExW;
begin
GetProcedureAddress(_GetModuleFileNameExW, PsapiLib, 'GetModuleFileNameExW');
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleFileNameExW]
end;
end;
var
_GetModuleFileNameEx: Pointer;
function GetModuleFileNameEx;
begin
GetProcedureAddress(_GetModuleFileNameEx, PsapiLib, 'GetModuleFileNameEx' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleFileNameEx]
end;
end;
var
_GetModuleInformation: Pointer;
function GetModuleInformation;
begin
GetProcedureAddress(_GetModuleInformation, PsapiLib, 'GetModuleInformation');
asm
MOV ESP, EBP
POP EBP
JMP [_GetModuleInformation]
end;
end;
var
_EmptyWorkingSet: Pointer;
function EmptyWorkingSet;
begin
GetProcedureAddress(_EmptyWorkingSet, PsapiLib, 'EmptyWorkingSet');
asm
MOV ESP, EBP
POP EBP
JMP [_EmptyWorkingSet]
end;
end;
var
_QueryWorkingSet: Pointer;
function QueryWorkingSet;
begin
GetProcedureAddress(_QueryWorkingSet, PsapiLib, 'QueryWorkingSet');
asm
MOV ESP, EBP
POP EBP
JMP [_QueryWorkingSet]
end;
end;
var
_InitializeProcessForWsWatch: Pointer;
function InitializeProcessForWsWatch;
begin
GetProcedureAddress(_InitializeProcessForWsWatch, PsapiLib, 'InitializeProcessForWsWatch');
asm
MOV ESP, EBP
POP EBP
JMP [_InitializeProcessForWsWatch]
end;
end;
var
_GetWsChanges: Pointer;
function GetWsChanges;
begin
GetProcedureAddress(_GetWsChanges, PsapiLib, 'GetWsChanges');
asm
MOV ESP, EBP
POP EBP
JMP [_GetWsChanges]
end;
end;
var
_GetMappedFileNameW: Pointer;
function GetMappedFileNameW;
begin
GetProcedureAddress(_GetMappedFileNameW, PsapiLib, 'GetMappedFileNameW');
asm
MOV ESP, EBP
POP EBP
JMP [_GetMappedFileNameW]
end;
end;
var
_GetMappedFileNameA: Pointer;
function GetMappedFileNameA;
begin
GetProcedureAddress(_GetMappedFileNameA, PsapiLib, 'GetMappedFileNameA');
asm
MOV ESP, EBP
POP EBP
JMP [_GetMappedFileNameA]
end;
end;
var
_GetMappedFileName: Pointer;
function GetMappedFileName;
begin
GetProcedureAddress(_GetMappedFileName, PsapiLib, 'GetMappedFileName' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_GetMappedFileName]
end;
end;
var
_EnumDeviceDrivers: Pointer;
function EnumDeviceDrivers;
begin
GetProcedureAddress(_EnumDeviceDrivers, PsapiLib, 'EnumDeviceDrivers');
asm
MOV ESP, EBP
POP EBP
JMP [_EnumDeviceDrivers]
end;
end;
var
_GetDeviceDriverBaseNameA: Pointer;
function GetDeviceDriverBaseNameA;
begin
GetProcedureAddress(_GetDeviceDriverBaseNameA, PsapiLib, 'GetDeviceDriverBaseNameA');
asm
MOV ESP, EBP
POP EBP
JMP [_GetDeviceDriverBaseNameA]
end;
end;
var
_GetDeviceDriverBaseNameW: Pointer;
function GetDeviceDriverBaseNameW;
begin
GetProcedureAddress(_GetDeviceDriverBaseNameW, PsapiLib, 'GetDeviceDriverBaseNameW');
asm
MOV ESP, EBP
POP EBP
JMP [_GetDeviceDriverBaseNameW]
end;
end;
var
_GetDeviceDriverBaseName: Pointer;
function GetDeviceDriverBaseName;
begin
GetProcedureAddress(_GetDeviceDriverBaseName, PsapiLib, 'GetDeviceDriverBaseName' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_GetDeviceDriverBaseName]
end;
end;
var
_GetDeviceDriverFileNameA: Pointer;
function GetDeviceDriverFileNameA;
begin
GetProcedureAddress(_GetDeviceDriverFileNameA, PsapiLib, 'GetDeviceDriverFileNameA');
asm
MOV ESP, EBP
POP EBP
JMP [_GetDeviceDriverFileNameA]
end;
end;
var
_GetDeviceDriverFileNameW: Pointer;
function GetDeviceDriverFileNameW;
begin
GetProcedureAddress(_GetDeviceDriverFileNameW, PsapiLib, 'GetDeviceDriverFileNameW');
asm
MOV ESP, EBP
POP EBP
JMP [_GetDeviceDriverFileNameW]
end;
end;
var
_GetDeviceDriverFileName: Pointer;
function GetDeviceDriverFileName;
begin
GetProcedureAddress(_GetDeviceDriverFileName, PsapiLib, 'GetDeviceDriverFileName' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_GetDeviceDriverFileName]
end;
end;
var
_GetProcessMemoryInfo: Pointer;
function GetProcessMemoryInfo;
begin
GetProcedureAddress(_GetProcessMemoryInfo, PsapiLib, 'GetProcessMemoryInfo');
asm
MOV ESP, EBP
POP EBP
JMP [_GetProcessMemoryInfo]
end;
end;
var
_GetPerformanceInfo: Pointer;
function GetPerformanceInfo;
begin
GetProcedureAddress(_GetPerformanceInfo, PsapiLib, 'GetPerformanceInfo');
asm
MOV ESP, EBP
POP EBP
JMP [_GetPerformanceInfo]
end;
end;
var
_EnumPageFilesW: Pointer;
function EnumPageFilesW;
begin
GetProcedureAddress(_EnumPageFilesW, PsapiLib, 'EnumPageFilesA');
asm
MOV ESP, EBP
POP EBP
JMP [_EnumPageFilesW]
end;
end;
var
_EnumPageFilesA: Pointer;
function EnumPageFilesA;
begin
GetProcedureAddress(_EnumPageFilesA, PsapiLib, 'EnumPageFilesW');
asm
MOV ESP, EBP
POP EBP
JMP [_EnumPageFilesA]
end;
end;
var
_EnumPageFiles: Pointer;
function EnumPageFiles;
begin
GetProcedureAddress(_EnumPageFiles, PsapiLib, 'EnumPageFiles' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_EnumPageFiles]
end;
end;
var
_GetProcessImageFileNameA: Pointer;
function GetProcessImageFileNameA;
begin
GetProcedureAddress(_GetProcessImageFileNameA, PsapiLib, 'GetProcessImageFileNameA');
asm
MOV ESP, EBP
POP EBP
JMP [_GetProcessImageFileNameA]
end;
end;
var
_GetProcessImageFileNameW: Pointer;
function GetProcessImageFileNameW;
begin
GetProcedureAddress(_GetProcessImageFileNameW, PsapiLib, 'GetProcessImageFileNameW');
asm
MOV ESP, EBP
POP EBP
JMP [_GetProcessImageFileNameW]
end;
end;
var
_GetProcessImageFileName: Pointer;
function GetProcessImageFileName;
begin
GetProcedureAddress(_GetProcessImageFileName, PsapiLib, 'GetProcessImageFileName' + AWSuffix);
asm
MOV ESP, EBP
POP EBP
JMP [_GetProcessImageFileName]
end;
end;
{$ELSE}
function EnumProcesses; external PsapiLib name 'EnumProcesses';
function EnumProcessModules; external PsapiLib name 'EnumProcessModules';
function GetModuleBaseNameA; external PsapiLib name 'GetModuleBaseNameA';
function GetModuleBaseNameW; external PsapiLib name 'GetModuleBaseNameW';
function GetModuleBaseName; external PsapiLib name 'GetModuleBaseName' + AWSuffix;
function GetModuleFileNameExA; external PsapiLib name 'GetModuleFileNameExA';
function GetModuleFileNameExW; external PsapiLib name 'GetModuleFileNameExW';
function GetModuleFileNameEx; external PsapiLib name 'GetModuleFileNameEx' + AWSuffix;
function GetModuleInformation; external PsapiLib name 'GetModuleInformation';
function EmptyWorkingSet; external PsapiLib name 'EmptyWorkingSet';
function QueryWorkingSet; external PsapiLib name 'QueryWorkingSet';
function InitializeProcessForWsWatch; external PsapiLib name 'InitializeProcessForWsWatch';
function GetWsChanges; external PsapiLib name 'GetWsChanges';
function GetMappedFileNameW; external PsapiLib name 'GetMappedFileNameW';
function GetMappedFileNameA; external PsapiLib name 'GetMappedFileNameA';
function GetMappedFileName; external PsapiLib name 'GetMappedFileName' + AWSuffix;
function EnumDeviceDrivers; external PsapiLib name 'EnumDeviceDrivers';
function GetDeviceDriverBaseNameA; external PsapiLib name 'GetDeviceDriverBaseNameA';
function GetDeviceDriverBaseNameW; external PsapiLib name 'GetDeviceDriverBaseNameW';
function GetDeviceDriverBaseName; external PsapiLib name 'GetDeviceDriverBaseName' + AWSuffix;
function GetDeviceDriverFileNameA; external PsapiLib name 'GetDeviceDriverFileNameA';
function GetDeviceDriverFileNameW; external PsapiLib name 'GetDeviceDriverFileNameW';
function GetDeviceDriverFileName; external PsapiLib name 'GetDeviceDriverFileName' + AWSuffix;
function GetProcessMemoryInfo; external PsapiLib name 'GetProcessMemoryInfo';
function GetPerformanceInfo; external PsapiLib name 'GetPerformanceInfo';
function EnumPageFilesW; external PsapiLib name 'EnumPageFilesA';
function EnumPageFilesA; external PsapiLib name 'EnumPageFilesW';
function EnumPageFiles; external PsapiLib name 'EnumPageFiles' + AWSuffix;
function GetProcessImageFileNameA; external PsapiLib name 'GetProcessImageFileNameA';
function GetProcessImageFileNameW; external PsapiLib name 'GetProcessImageFileNameW';
function GetProcessImageFileName; external PsapiLib name 'GetProcessImageFileName' + AWSuffix;
{$ENDIF DYNAMIC_LINK}
{$ENDIF JWA_INTERFACESECTION}
{$IFNDEF JWA_OMIT_SECTIONS}
end.
{$ENDIF JWA_OMIT_SECTIONS}
|