|
dwRet = WNetAddConnection2(&stNetResource,"Administrator","123",CONNECT_UPDATE_PROFILE);
if(dwRet != NO_ERROR)
{
printf("Make SMB Connection error:%d\n",GetLastError());
getchar();
return 0;
}
if (!(RegConnectRegistry("\\\\192.168.1.13",HKEY_LOCAL_MACHINE ,&g_hKey) == ERROR_SUCCESS))
{
printf ("Connect remote registry failed!\\n");
getchar();
return 0;
}
if (!(RegSaveKey(g_hKey,"C;\\tmp.reg",NULL))==ERROR_SUCCESS)
{
printf ("RegSaveKey registry failed!\n");
printf("%d",GetLastError());
getchar();
}
我操作远程注册表的代码如上,其中RegConnectRegistry返回的是正确的,可是我要保存的时候RegSaveKey,却返回了997(IO操作重叠)的错误,想问问这个是什么原因呢?
2.还有一个问题是我用
RegCreateKeyEx(g_hKey,"SoftWare\\Microsoft\\Windows\\CurrentVersion\\Policies\\WinOldApp",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS|KEY_SET_VALUE,NULL,&g_hKey2,&dw)来创建远程新的键值也是错误的
|
|