title: CreateProcess I can't start a process
body: <p>I am using CreateProcess, but I can't start a process I am using the following code but I am getting the error "Invalid access to memory location" but I don't know why.
  Is there any problem with my code?</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;stdio.h&gt;
  
  //#include "common.h"
  
  int main(void)
  {
  
      DWORD creation_flags = DEBUG_PROCESS;
      STARTUPINFO startupinfo;
      PROCESS_INFORMATION process_information;
      char *path_to_exe = "D:\\dbg\\calc.exe";
  
  
      startupinfo.dwFlags     =   0x1;
      startupinfo.wShowWindow =   0x0;
  
  
      startupinfo.cb  =   sizeof(startupinfo);
  
      if(CreateProcess(   path_to_exe,
                          NULL,
                          NULL,
                          NULL,
                          NULL,
                          creation_flags,
                          NULL,
                          NULL,
                          &amp;startupinfo,
                          &amp;process_information)){
          printf("We have successfully launched the process!\n");
          printf("[*] PID: %d\n", process_information.dwProcessId);
      }
      else
          printf("[*] Error: %d.\n", GetLastError());
  }
  </code></pre>