RegQueryValueEx返回ERROR_MORE_DATA
来源:互联网 发布:catia汽车设计软件 编辑:程序博客网 时间:2024/05/11 16:05
MSDN解释
LONG RegQueryValueEx( HKEY hKey, LPCTSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
the buffer specified by lpData parameter is not large enough to hold the data, the function returns ERROR_MORE_DATA and stores the required buffer size in the variable pointed to bylpcbData. In this case, the contents of thelpData buffer are undefined.
If lpData is NULL, and lpcbData is non-NULL, the function returns ERROR_SUCCESS and stores the size of the data, in bytes, in the variable pointed to bylpcbData. This enables an application to determine the best way to allocate a buffer for the value's data.
char* buffer = NULL;DWORD dwBytes=0;DWORD dwType;DWORD dwRet;dwRet = RegQueryValueExA(hKey, "...", NULL, &dwType, NULL, &dwBytes);if (ERROR_SUCCESS == dwRet){ buffer = (char*)malloc(dwBytes*sizeof(char)); ZeroMemory(buffer,sizeof(buffer)); dwRet = RegQueryValueExA(hKey, "...", NULL, &dwType, (LPBYTE)buffer, &dwBytes); if(ERROR_SUCCESS !=dwRet )free(buffer);}
- RegQueryValueEx返回ERROR_MORE_DATA
- RegEnumValue调用失败返回ERROR_MORE_DATA
- RegQueryValueEx, 返回2, windows
- 关于SHGetValue返回ERROR_MORE_DATA 234错误
- RegQueryValueEx返回234错误解决方法
- RegQueryValueEx
- RegQueryValueEx函数返回234错误解决方法
- WinCE RegQueryValueEx 返回值的问题
- RegQueryValueEx函数返回234错误解决方法
- RegQueryValueEx函数返回234错误解决方法
- RegQueryValueEx函数返回234错误解决方法
- 用RegQueryValueEx()函数读取注册表键值有时返回“234”有时返回0?
- 【小问】RegQueryValueEx函数返回居然是1,“错误的函数”?
- RegQueryValueEx(转)
- RegQueryValueEx详解
- RegQueryValueEx函数
- RegQueryValueEx理解
- RegQueryValueEx详解
- 查找命令find locate which whereis
- JavaScript图片拖动效果(ondragstart和ondrag)
- 调整Dataguard环境的Online和Standby Redo Log
- 逗号表达式
- 家具送到,最后一个门装上,两只木凳送到,结束了,终于。。。 。。。
- RegQueryValueEx返回ERROR_MORE_DATA
- 排序算法--基数排序
- 构造函数为什么不能是虚函数
- permission of Openstack nova instance directory
- PHP编译安装
- poj1548 Robots
- android开发环境搭建及配置
- 2013 北京 零分作文
- linux 如何对库和可执行文件进行裁减