[SOLVED] Calling code allocated in memory crashes wine

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
UnknowN-TerroR
Newbie
Newbie
Posts: 1
Joined: Sun Jun 07, 2009 5:09 am

[SOLVED] Calling code allocated in memory crashes wine

Post by UnknowN-TerroR »

Hi,

I have a program which needs to call some code manually allocated in memory.
The code is first prepared and all of its functions/variables are updated with the right address, then its init function is called through a simple __fastcall in C.

It works very well under windows, but if i try to run it under wine it crashes when it calls this init function, with the following error:

"wine: Unhandled page fault on execute access to 0x00116000 at address 0x116000 (thread 003f), starting debugger...
Unhandled exception: page fault on execute access to 0x00116000 in 32-bit code (0x00116000)"

0x00116000 is the address of the init function.
I think it's an access problem (i suppose wine doesn't allow calling a code allocated manually) or maybe a problem in the code preparation, or wine may doesn't allow running native windows code. Does anyone know something about? Thanks.

Edit: solved, you must use VirtualAlloc() with a specific flag. Sorry for the post :)
Locked