Use ResultVal for SyncRequest and WaitSynchronization
Use ResultVal in more places.