Windows 中的系统调用 [英] Syscalls in Windows

查看:37
本文介绍了Windows 中的系统调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux中,我可以在C exit(0)中编程;或者在 ASM (__NR_exit 1, int 0x80) 中使用系统调用来退出我的程序,但在 Windows 中是一样的吗?我可以使用系统调用吗?我在 C 中的函数可以在用户空间使用内部系统调用吗?

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?

推荐答案

类似,但具体不同.

在 Windows 中,您的 exit 调用最终会调用 ExitProcess Windows API 函数,但您也可以直接调用它并以这种方式终止您的应用程序.不过,不一定推荐这样做,因为 Exit 可能会执行直接 API 调用无法实现的清理工作.

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.

这篇关于Windows 中的系统调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆