1Fucker |
|
|
|
: 05.12.2008 |
: 4 |
|
|
|
|
... , ... ....
typedef DWORD (WINAPI *_SetAdapterIpAddress )( char *szAdapterGUID,
DWORD dwDHCP,
DWORD dwIP,
DWORD dwMask,
DWORD dwGateway );
HINSTANCE lib = (HINSTANCE) LoadLibrary( T("iphlpapi.dll") );
_SetAdapterIpAddress SetAdapterIpAddress = (_SetAdapterIpAddress) GetProcAddress( lib,"SetAdapterIpAddress" );
CRegistry Reg;
PWSTR pszGUID = NULL;
char szGUID[64] = {0};
DWORD dwSize = 0;
// GUID ( )
Reg.Read( T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards\\1"),
T("ServiceName"),
(PVOID&) pszGUID,
&dwSize );
WideCharToMultiByte( CP_ACP, 0, pszGUID, -1, szGUID, sizeof( szGUID ), NULL, NULL );
SetAdapterIpAddress( szGUID,
0,
inet_addr("192.168.1.2"),
inet_addr("255.255.255.0"),
inet_addr("192.168.1.100") ); |
|