PATH_NOT_FOUND和NAME_NOT_FOUND有什么区别 [英] What's the difference between PATH_NOT_FOUND and NAME_NOT_FOUND

查看:646
本文介绍了PATH_NOT_FOUND和NAME_NOT_FOUND有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Win32层中,我们经常遇见 ERROR_PATH_NOT_FOUND ERROR_NAME_NOT_FOUND



何时 WinAPI(例如CreateFileW,RemoveDirectoryW)返回这些值?
有什么区别?

如果我写一个文件系统驱动,我什么时候设置 STATUS_OBJECT_PATH_NOT_FOUND STATUS_OBJECT_NAME_NOT_FOUND



您如何确定?

我很困惑。
有没有人可以解释清楚?

或者有没有文件解释这个?我找不到他们。 ERROR_NAME_NOT_FOUND 不是标准的Win32 API错误代码。与文件相关的文件名API返回的典型错误是 ERROR_FILE_NOT_FOUND ERROR_PATH_NOT_FOUND 。找出返回错误代码的最佳方法是使用WDK示例作为指导。例如,cdfs示例的 create.c 源代码文件。如果无法找到目录,它将返回 STATUS_OBJECT_PATH_NOT_FOUND STATUS_OBJECT_NAME_NOT_FOUND


In Win32 layer, we often meet ERROR_PATH_NOT_FOUND, ERROR_NAME_NOT_FOUND.

When does WinAPI(eg CreateFileW, RemoveDirectoryW) return these values? And What's the difference?

If I write a file system driver, when do I set STATUS_OBJECT_PATH_NOT_FOUND or STATUS_OBJECT_NAME_NOT_FOUND?

How do you determine?

I'm so confused. Is there anyone who can explain clearly?
Or are there any documents explain this? I couldn't find them.

Thanks in advance.

解决方案

ERROR_NAME_NOT_FOUND is not a standard Win32 API error code. Typical errors returned by file related APIs that take a file name are ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND. The best way to figure out what error code to return is use a WDK sample as a guide. The cdfs sample's create.c source code file for example. It returns STATUS_OBJECT_PATH_NOT_FOUND if it cannot locate a directory, STATUS_OBJECT_NAME_NOT_FOUND if it cannot locate a file.

这篇关于PATH_NOT_FOUND和NAME_NOT_FOUND有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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