The error you are getting is not related to admin rights. The problem is that you use C and inadvertently perform illegal operations (a type of operation that, if left unchecked, is likely to crash your system).
The error you received indicates that your program is trying to write to memory address 1001, but should not write to this memory address.
This can happen for a number of reasons.
One possible reason is that the double * you pass to ReturnPulse is not as big as ReturnPulse. You probably need to at least get GetSize to work correctly ... you could get around it by simply allocating a very large array instead of calling GetSize. i.e.
ptrfdP = (c_double*100000)()
This will give out 100,000 doubles, which may be more suitable for capturing a digital pulse.
Another problem is that type conversion may not occur as expected.
You might be lucky if ctypes knows that ReturnPulse accepts five double pointers. i.e.
If none of these methods work, send the usage documentation to ReturnPulse, which should help us recognize the intended use.
Or even better, send an example of code that should work in C, and I will translate it into an equivalent implementation in ctypes.
Edit: Add an example implementation using ReturnPulse and ctypes.
I implemented something like what I expect from ReturnPulse in the C DLL:
void ReturnPulse(double *a, double*b,double*c,double*d,double*e) {
I compile this in a DLL (I call examlib) and then call it with ctypes with the following code:
LP_c_double = ctypes.POINTER(ctypes.c_double) examlib.ReturnPulse.argtypes = [LP_c_double, LP_c_double, LP_c_double, LP_c_double, LP_c_double, ] a = (ctypes.c_double*20)() b = (ctypes.c_double*20)() c = (ctypes.c_double*20)() d = (ctypes.c_double*20)() e = (ctypes.c_double*20)() examlib.ReturnPulse(a,b,c,d,e) print 'values are' for array in (a,b,c,d,e): print '\t'.join(map(str, array[:5]))
Result result
values are 0.0 1.0 2.0 3.0 4.0 0.0 3.0 6.0 9.0 12.0 0.0 5.0 10.0 15.0 20.0 0.0 7.0 14.0 21.0 28.0 0.0 13.0 26.0 39.0 52.0
Indeed, even without setting ReturnPulse.argtypes, the code works without errors.