First, please forgive me if I say something silly, I am no IT guy but electronics engineer, but I have been assigned to something that needs more skills that I do.
I
A long in C++ is 32-bits. Which makes it an int in C#. Replace long with int in the pinvoke declaration.
You should have gotten a PInvokeStackImbalance warning about that. Be sure the re-enable that warning if you turned it off. And it would have been easy to see that the value for *posicion_inicio* is wrong in the debugger. Be sure to enable unmanaged debugging, Project + Properties, Debug tab. Now you can set a breakpoint in your C++ code.