//Register the interfaces\r
if(RpcServerRegisterIf3) { //Windows 8\r
for(int i=0;i<ARRAYSIZE(availableInterfaces);i++) {\r
- if((status=RpcServerRegisterIf3(availableInterfaces[i],NULL,NULL,RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH,RPC_C_LISTEN_MAX_CALLS_DEFAULT,0,NULL,psd))!=RPC_S_OK) {\r
+ if((status=RpcServerRegisterIf3(availableInterfaces[i],NULL,NULL,RPC_IF_AUTOLISTEN|RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH,RPC_C_LISTEN_MAX_CALLS_DEFAULT,0,NULL,psd))!=RPC_S_OK) {\r
LOG_ERROR(L"RpcServerRegisterIf3 failed to register interface at index "<<i<<L", status "<<status);\r
return status;\r
}\r
}\r
} else { // Pre Windows 8\r
for(int i=0;i<ARRAYSIZE(availableInterfaces);i++) {\r
- if((status=RpcServerRegisterIf(availableInterfaces[i],NULL,NULL))!=RPC_S_OK) {\r
+ if((status=RpcServerRegisterIfEx(availableInterfaces[i],NULL,NULL,RPC_IF_AUTOLISTEN,RPC_C_LISTEN_MAX_CALLS_DEFAULT,NULL))!=RPC_S_OK) {\r
LOG_ERROR(L"RpcServerRegisterIf failed to register interface at index "<<i<<L", status "<<status);\r
return status;\r
}\r
}\r
}\r
LocalFree(psd);\r
- //Start listening\r
- if((status=RpcServerListen(1,RPC_C_LISTEN_MAX_CALLS_DEFAULT,TRUE))!=RPC_S_OK) {\r
- LOG_ERROR(L"RpcServerListen failed with status "<<status);\r
- return status;\r
- }\r
- CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)RpcMgmtWaitServerListen,NULL,0,NULL);\r
return status;\r
}\r
\r
return status;\r
}\r
}\r
- return RpcMgmtStopServerListening(NULL); \r
+ return status;\r
}\r