Inconsistency/bug with GetProcAddress

Vitaliy Margolen wine-devel at
Sat Aug 6 23:59:50 CDT 2005

Found an interesting inconsistency with GetProcAddress between wine and native.
On windows GetProcAddress of that's say "LoadLibraryA" exported from kernel32
always returns the same address, no matter which process it's called from.

On wine it's different. That's say there are two programs app1.exe & app2.exe.
app1.exe calls app2.exe (CreateProcess, etc.). Here is what I'm getting:
app1.exe: GetProcAddress(mKernel32, "LoadLibraryA") returns 0x404FCBCC
app2.exe: GetProcAddress(mKernel32, "LoadLibraryA") returns 0x404FFBCC

I have tested this with more then two programs. All consecutive apps return same
number as app2.exe. When any of this programs are ran under winedbg they all
return same address as app2.exe.

Running separate program doesn't change this behavior for parent-child
processes. Both programs started in parallel will return the same address as

What's more interesting, is that GetModuleHandleA("Kernel32") always returns the
same handle.

Is there are any reason why this is happening? Any ways to fix this?

Unfortunately there are some programs that depend on address returned from
GetProcAddress being the same in parent and child processes.

Best regards,

More information about the wine-devel mailing list