Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CreateProcess lpCommand buffer size

According to the Microsoft documentation, CreateProcessW can modify the contents of the LPWSTR lpCommandLine parameter.

Do I need to account for extra space in the size of the buffer for lpCommandLine?

What happens if it needs to add characters and the buffer size is too small?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

from CreateProcessW

The system adds a terminating null character to the command-line string to separate the file name from the arguments. This divides the original string into two strings for internal processing.

it just converts some spaces to null bytes, it won’t go over the end of the buffer.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading