C++ does not hoist variables, has block scope, and there's no "undefined" state/value, so it's best to wait to declare variables until you need them, and always initialize when they are declared:

```
DWORD dwWaitResult = WaitForSingleObject(hNodeMutex, INFINITE);
```