Hi,
I'm hooking FindResourceExA API from kernel32.dll. This is my hooked function:
Function FindResourceExA_API(hModule: HMODULE; lpType, lpName: PAnsiChar; wLanguage: Word): HRSRC; stdcall;
Begin
{$IFDEF DEBUG}
Try
writeDebug(Format('findResourceExA: API lpName=%s',[StrPas(lpName)]));
Except
On E:Exception do MessageBox(0,PChar(E.Message),'FindResourceExA Exception 3',MB_OK);
End;
{$ENDIF}
Result:=FindResourceExA_Next(hModule,lpType,lpName,wLanguage);
End;
The problem is the line with the writeDebug procedure is allways signaling an Access Violation Exception. Why?
Thanks in advance for your help.
Hooking FindResourceExA problem
-
- Posts: 46
- Joined: Fri Apr 28, 2006 1:17 pm
lpName can be a string pointer or a resource identifier (see MakeIntResource).
Code: Select all
function IsIntResource(AName: Pointer): Boolean; inline;
begin
Result := (Cardinal(AName) shr 16) = 0;
end;