EdwardBlack
Grünschnabel
Ah deswegen also, danke
ich habe folgenden Code, es wird zwar umgeschaltet, aber wenn ich das Programm beende bleibt die Einstellung wohl nicht erhalten :/
Vielleciht
C++:
#include <windows.h>
#include <iphlpapi.h>
#include <iostream>
using namespace std;
int test()
{
HANDLE *myHandle = NULL;
OVERLAPPED Overlapped;
DWORD ret;
SECURITY_ATTRIBUTES security_test;
security_test.bInheritHandle = true;
security_test.lpSecurityDescriptor = NULL;
security_test.nLength = sizeof (SECURITY_ATTRIBUTES);
Overlapped.Internal = 0;
Overlapped.InternalHigh = 0;
Overlapped.Offset = 0;
Overlapped.OffsetHigh = 0;
Overlapped.Pointer = 0;
Overlapped.hEvent = CreateEvent(&security_test, false, true, NULL);
ret = EnableRouter(NULL, &Overlapped);
cout << "ret enable router = " << ret << endl; //hier bekomme ich 997
WaitForSingleObject(Overlapped.hEvent, 3000);
cout << GetLastError() << endl; //hier bekomme ich 0
cin.get(); cin.get();
return 0;
}
Vielleciht