Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6570613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:46:39+00:00 2026-05-25T14:46:39+00:00

I am using CreateProcess, but I can’t start a process I am using the

  • 0

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?

#include <Windows.h>
#include <stdio.h>

//#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,
                        &startupinfo,
                        &process_information)){
        printf("We have successfully launched the process!\n");
        printf("[*] PID: %d\n", process_information.dwProcessId);
    }
    else
        printf("[*] Error: %d.\n", GetLastError());
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:46:39+00:00Added an answer on May 25, 2026 at 2:46 pm

    You have only filled in 3 fields of the startupinfo Structure.
    The remaining fields are filled with garbage, and some of that garbage is likely leading to bad problems.

    You should fully initialize the structure, explicitly putting NULL, 0 and other “empty” values where you don’t want to specify anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have executed a process using CreateProcess, but I want to fetch or dump
I am using CreateProcess function for creating the process, is there any option to
I'm spawning a process from Win32 using CreateProcess , setting the hStdOutput and hStdError
I'm using CreateProcess() with startup flags set to STARTF_USESHOWWINDOW and SW_HIDE to start an
I am trying to create a program that calls another process using CreateProcess. After
I'm creating an application with its main window hidden by using the following code:
I am using CreateProcess to create a cmd.exe process that is passed a parameter
In my main process, i create a ffmpeg child process using CreateProcess(...). I need
I am launching a process from my application using CreateProcess API and I want
I'm trying to launch VB application from Java, but I'm getting runtime error: Exception

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.