<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey Igor,<div class=""><br class=""></div><div class="">Thanks a lot for your e-mail! I am Cc’ing Stefan Gränitz who is the one actually working on this project, hope this will be helpful.</div><div class=""><br class=""></div><div class="">Cheers, Timur<br class=""><div class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="gmail_signature"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><font color="#444444" face="Arial" size="2" class=""></font></div></div></div></div></div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 10 Jun 2016, at 15:07, Igor Minin <<a href="mailto:igorm6387@gmail.com" class="">igorm6387@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    <pre wrap="" class="">Hi, Timur. I may be wrong, but it seems that I faced similar problem before. 

The problem is that Windows checks memory region of exception handler for <span id="posttext-379491" class="">MEM_EXECUTE_OPTION_EXECUTE_DISPATCH_ENABLE flag</span>, that is not set by default and can't be set easily.

Before Windows passes control to your handler it does the following checks:

KiUserExceptionDispatcher ->RtlDispatchException -> RtlIsValidHandler (FAIL)

So you need to enable this flag for your memory-generated code. As far as I know it is impossible if permanent DEP is enabled. So you can either run your process without DEP (not an option in the most cases), or use another way to deal with exceptions. One of the possible workarounds is VEH. You can look through OpenJDK as an example.</pre>
  </div>

</div></blockquote></div><br class=""></div></body></html>