Can I add breakpoint on windows CreateProcess API in Visual studio like I can do in Windbg?
Yes - Go "Debug / New breakpoint / Break at function..." and paste this:
{,,kernel32.dll}_CreateProcessW@40
into the Function box.
That assumes a Unicode build - replace W
with A
for ANSI builds.
A bit of explanation: the @40
piece is part of the stdcall calling convention, and gives the number of bytes of parameters that the function takes. In win32, this is almost always 4 times the number of parameters. The underscore is also part of the stdcall calling convention.
A related note: sometimes the name of the function as seen by the debugger is different from its real name - see this blog post for an example, and how to find the right name to use: Setting a Visual Studio breakpoint on a Win32 API function in user32.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With