Michael Stefaniuc : rpcrt4: socket() returns -1 on error so check the return value against that.