доступ к реестру в локальное сетке
thanx
Если подставлять другую айпиху, то гаплык
В чем трабл ?
#include "stdafx.h"
#include <windows.h>
int main(int argc, char* argv[])
{
char* serialKey = new char;
HKEY openKey;
char szRegKey[]="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
//LONG dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_WRITE, &openKey);
LONG dwResult = RegConnectRegistry("127.0.0.1",HKEY_LOCAL_MACHINE, &openKey);
if(dwResult != ERROR_SUCCESS)
{
for(;;)
printf("Error init registry\n");
return -1;
}else
{
char value[]="tunelling";
unsigned char keyValue[129] = "Quake2";
DWORD keyType=REG_SZ;
DWORD keyBufferSize=128;
::RegOpenKeyEx(HKEY_LOCAL_MACHINE,szRegKey,0,KEY_WRITE,&openKey);
::RegSetValueEx(openKey,value,0,keyType,keyValue,keyBufferSize);
RegCloseKey(openKey);
}
return 0;
}