Be sure to use a definition of STARTUPINFO where the three string fields are defined as IntPtr. That's because GetStartupInfo allocates the memory for the strings and does not expect it to ever be freed. See more information in the Notes section of the STARTUPINFO page.
Tips & Tricks:
Please add some!
Sample Code:
Please add some!
Alternative Managed API:
Do you know one? Please contribute it!
The GetStartupInfo API
5/3/2022 9:25:41 PM - Wade Spital-135.180.201.213
Passed in place of STARTUPINFO to extend CreateProcess
7/8/2019 11:50:55 AM - dahall-72.24.140.51
Passed in place of STARTUPINFO to extend CreateProcess
7/8/2019 11:50:55 AM - dahall-72.24.140.51
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
The GetStartupInfo API
5/3/2022 9:25:41 PM - Wade Spital-135.180.201.213
Passed in place of STARTUPINFO to extend CreateProcess