1

In Linux, I can program in C exit(0); or use a syscall in ASM (__NR_exit 1, int 0x80) to exit of my program, But is the same in Windows? Can I use syscalls and my functions in C use internally syscalls in the user space?

Bill Joe
  • 51
  • 2
  • 12
  • On windows the old mechanism is with `int 0x2e`, but then you're not using the fast system call mechanisms (when available). You can just call stuff in NTDLL. – harold Nov 13 '14 at 21:09
  • Int 0x2e is not available in all Windows versions - especially not in the old 9x series. It was never officially "allowed" by Microsoft to access system calls directly so they can remove this interrupt whenever they want. – Martin Rosenau Nov 14 '14 at 18:23

1 Answers1

3

It's similar, but the specifics are different.

In Windows, your exit call will eventually wind up in a call to the ExitProcess Windows API function, but you can also call that directly and terminate your application that way. It isn't necessarily recommended, though, as Exit may do cleanup that you would not get with the direct API call.