In the original code, when the call to IVRSystem::GetStringTrackedDeviceProperty failed with error (e.g. "TrackedProp_UnknownProperty") but the returned buffer size was 0, the wrapper returned empty string, instead of signalling the error.
The fix first tests for "buffer too small" condition and only after dealing with that does the regular error code check.
In the original code, when the call to
IVRSystem::GetStringTrackedDeviceProperty
failed with error (e.g. "TrackedProp_UnknownProperty") but the returned buffer size was 0, the wrapper returned empty string, instead of signalling the error.The fix first tests for "buffer too small" condition and only after dealing with that does the regular error code check.