Turns out it indeed got the right function pointer and that function is getting called correctly. What I was trying to do however was forking a process within another.<div>One of the things I needed to do was unmapping the base module from memory from one of the exe's, align correctly and then write the second executable in the memory of the first one.</div>
<div>NtUnmapViewOfSection seems to fail with error code <span style="background-color:rgb(255,255,255);font-family:'Segoe UI',Verdana,Arial;font-size:13px;line-height:18px;text-align:left">STATUS_NOT_MAPPED_VIEW. </span></div>
<div><span style="background-color:rgb(255,255,255);font-family:'Segoe UI',Verdana,Arial;font-size:13px;line-height:18px;text-align:left"><br></span></div><div><span style="background-color:rgb(255,255,255);font-family:'Segoe UI',Verdana,Arial;font-size:13px;line-height:18px;text-align:left">I've found out this error appears on certain kinds of executable and one's written in D seem to be one of those. Is there any reason windows complains that the main module containing the code section is not mapped?</span></div>
<div><span style="background-color:rgb(255,255,255);font-family:'Segoe UI',Verdana,Arial;font-size:13px;line-height:18px;text-align:left"><br></span></div>