error:The handle is invalid.
来源:互联网 发布:二维数组打印杨辉三角 编辑:程序博客网 时间:2024/05/02 04:55
我的目的是想查看磁盘的信息,如磁盘信息,磁盘类型和磁盘的号,结果竟被告知是获取句柄错误,应该是权限出问题了。但是我仔细检查代码之后,才发现是CreateFile函数的参数的单词写错了。错误代码如下:
hDevice = CreateFile(lpDevicePath,FILE_GENERIC_READ | FILE_GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE ,NULL,OPEN_EXISTING,FILE_FLAG_NO_BUFFERING,hDevice);if (hDevice==NULL){cout<<"Getting Handle failed!"<<endl;return 2;}
第二个参数应为:GENERIC_READ | GENERIC_WRITE,而我的代码却是FILE_GENERIC_READ |FILE_GENERIC_WRITE。
好高兴啊,又发现了一个错误。实践是检验理论的唯一标准,我就应该多实践,找准自己的不足。
0 0
- error:The handle is invalid.
- The Binding Handle is Invalid in VS 2005 Resolved
- Vistual Stuido 2005的"The Binding Handle is Invalid"错误
- Unable to attach debugger. The binding handle is invalid
- Vistual Stuido 2005的"The Binding Handle is Invalid"错处
- VS05 与 VS08并存时编译出现 The binding handle is invalid.
- The argument is invalid.
- The MAC is invalid.
- 关于Bad Request - Invalid URL HTTP Error 400. The request URL is invalid 如何处理?
- ERROR: Kernel configuration is invalid.
- Error 47 "xxxxxxx"is an invalid value for the "InputManifest" parameter of the "GenerateApplicationM
- 队列读取器代理 遇到错误 Row handle is invalid
- The FlexSession is invalid问题
- XCode ERROR ITMS-90049 This bundle is invalid The bundle identifier contains disallowed characters
- Xcode上传App到Appstore,报错Error ITMS-90049:"This bundle is invalid.The bundle...."
- Xcode上传App到Appstore,报错Error ITMS-90049:"This bundle is invalid.The bundle...."
- ERROR ITMS-90049:"This bundle is invalid.The bundle identifier contains disallowed characters."
- Xcode上传App到Appstore,报错Error ITMS-90049:"This bundle is invalid.The bundle...."
- NanShan 折腾几天的 FTP 乱码问题 CuteFTP FTP Serv-U
- IE6实现min-width(js)
- 专访许鹏:谈C程序员修养及大型项目源码阅读与学习
- I'm determined to keep a diary i…
- 框架--frameset
- error:The handle is invalid.
- url编码规则
- golang 处理Json 数组
- 问号和冒号----条件运算符
- CSS3教程:background-clip和backg…
- css代码BACKGROUND: none transpar…
- QQ技巧:不让对方知道自己隐身在线
- IE6与IE7兼容性的资料
- Alpha滤镜