设备对象中的标志如何清晰
这两个代码相等吗?(清除标志)
ClearFlag(NewDeviceObject->Flags, DO_DEVICE_INITIALIZING);
NewDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
Are these two Code equal?(clear flag)
ClearFlag(NewDeviceObject->Flags, DO_DEVICE_INITIALIZING);
NewDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,它们是平等的。
与API不同,
clearflag
是宏。您可以输入与之编译的ntifs.h
并查看。微软不会像这样更改宏,因为那样您将无法在任何旧窗口上使用相同的二进制文件(这不是他们喜欢的东西)。这就是为什么只有类似的小型公用事业。无论如何,使用宏是一个更好的练习,并且更清洁,因此请像使用其他赢的宏一样使用它,而不会因相同的原因而不会更改(这不是一个不使用它的错误)。
Yes they are equal.
Unlike APIs,
ClearFlag
is a macro. You can enter thentifs.h
that you compile with and see it. Microsoft doesn't change macros like this, because then you won't be able to use the same binary on any older windows (which is not something they like). This is why only small utilities like that are inlined.Anyway it's a much better practice and much cleaner to use the macro, so use it like you use other win macro that won't be changed for same reasons (it's just not a bug not using it).