CreateProcess giving error code 998
Hey all you Win32-ers out there...
Can anybody tell me what could be causing CreateProcess to fail with the ERROR_NOACCESS error (error 998)?
I can't seem to find any documentation on this, beyond the unhelpful "Invalid access to memory location." that MSDN provides.
Edit: oh, I should mention that I'm calling it like so:
CreateProcess(NULL, arg_str, NULL, NULL, FALSE, 0, NULL, NULL, &comp_si, &comp_pi);
arg_str is a valid command line (with a ton of arguments), and comp_si and comp_pi are empty STARTUPINFO and PROCESS_INFORMATION structures, respectively.
- Reid
Could you provide the relevant code from your application? Chances are, your parameters are incorrect. Are you perhaps passing in a function pointer to a non-static class member?
Off the top of my head: a pointer passed to CreateProcess() was borked, one of the structures wasn't zeroed properly or had an invalid value such as a negative size entry or a dwFlags entry specified an option that wasn't actually utilized in a structure.
initial post modified.
I'm definitely not passing any function pointers around...how could I even pass one to CreateProcess?
I'm definitely not passing any function pointers around...how could I even pass one to CreateProcess?
Quote:Original post by SiCrane
When you say empty, did you remember to set the cb member of the STARTUPINFO structure?
err, no, I just used memset to zero out the whole structure. But it looks like just setting the cb member doesn't work either. What else am I supposed to initialise? CreateProcess has worked fine for me before when I just pass it an "empty" STARTUPINFO structurre (and by empty, I mean zeros).
BTW, thanks everyone for the ultra-zippy responses. This is amazing.
- Reid
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement