I think the problem is in the code that calls getProcessTime, not in the getProcessTime function itself. My guess is that you have an EVENT* that is not initialized properly and points to invalid memory. When you call getProcessTime on that pointer, the function is not able to access the memory, and the access violation occurs.
Why don't you post the code that does the calling, and I can be more specific about what is happening.
By the way--please us code tags. Click the Format button that looks like "<>" and paste your code between the tags that you create. (Sometimes the initial window when you create a thread doesn't let you click the format button. Just go back and edit your post. Highlight your code and click the "<>" button.)