Root > Reference > All Functions > HookWin32API

Function HookWin32API

Previous pageReturn to chapter overviewNext page   

Adds a function to resource monitoring.

 

Unit

EResLeaks

 

Syntax

 

Code (Delphi)

function HookWin32API(

const AModuleName, AAPIName, AAPICategory, AAPIType: String;

AParamCount: Integer;

ACreate: Boolean;

ACheckType: TCheckType = ctEqual;

ACheckValue: PtrUInt = 0;

AResultParam: Integer = -1

): Pointer;

 

Parameters

AModuleName

DLL file name to hook. Case insensitive

 

AAPIName

DLL's function name to hook. Case sensitive

 

AAPICategory

Category for API.

 

AAPIType

Sub-type of API. Typically equals APICategory

 

AParamCount

Number of functions arguments

 

ACreate

True - function creates resource, False - function destroys resource

 

ACheckType

Specifies valid/invalid conditions for function call. See TCheckType description for more details

 

ACheckValue

Value for failure call. See TCheckType description for more details

 

AResultParam

Index of function's argument which returns resource (for Create-like functions) or accepts resource (for Destroy-like functions). Use -1 for functions and >= 0 for procedures. Use -2 for resources without handles at all (i.e. handle is never exposed, so you only need to watch for pairing calls)

 

Remarks

Notes:

 

- ACheckValue is ignored (and must be 0) for ctNone, ctHResult, ctNTStatus.

 

- AResultParam can't be a return value, if check type is ctHResult or ctNTStatus

 

- Dispose-like function (ACreate = False) can't return handle - handle should be only passed as argument or be an internal handle (AResultParam = -2 or AResultParam >= 0)




Send feedback... Build date: 2024-12-19
Last edited: 2024-12-19
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_eresleaks_hookwin32api.php