I am using Microsoft Visual Studio to create a utility for firmware upgrade.
I am facing a very perplexing problem here.
printf("Before \n");
if(any_device_active())
stat=switchover(ni_handle,&SWover);
else return; <<<<--------Second ONE
printf("switch over stat =%d\n",stat);
Sleep(1000);
return; <<<<<---------Third ONE
As observed the first return is successful.
All the returns after that fail.
I don't seem to get the problem.
I don't even know what to look for.
Also by the way the switchover
function is empty and just returns a 0.
any_device_active
just returns 0 and prints a list , no problem there.
This is the error code the visual debugger throws 0xc0000409.
0xC0000409 is STATUS_STACK_BUFFER_OVERRUN: It means some write to a pointer overwrote something it shouldn't have on the stack, and the C Run-Time Library's security code in your function's epilog detected it.
You have some kind of buffer overflow bug or improper pointer use in your switchover() function.
User contributions licensed under CC BY-SA 3.0