Why the address returned by the @ operator is not the same to the returned by the GetProcAddress function
delphi, winapi
Solution
Because static linking uses a thunk jump table to call a DLL function.
`p2` in your example is the correct address of the `FindWindowW` function in your process, while `p1` is the address of a jump instruction like this
jmp dword ptr [SomeAddress]
where `SomeAddress` points to the actual address of the `FindWindowW` function.
Problem
I need to get the address of a Win APi method (`FindWindowW`) , I'm using the `@` operator and the `GetProcAddress` but both returns differents results. ``` var p1, p2 : Pointer; begin p1:= @Winapi.Windows.FindWindowW; p2:=GetProcAddress(GetModuleHandle('user32.dll'), 'FindWindowW'); ShowMessage(Format('p1 %p p2 %p ', [p1, p2])); end; ``` Why the values returned are different?