getState method
Retrieves the current operational state of the sensor.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/sensorsapi/nf-sensorsapi-isensor-getstate.
Implementation
SensorState getState() {
final pState = adaptiveCalloc<Int32>();
final hr$ = HRESULT(_GetStateFn(ptr, pState));
if (hr$.isError) {
free(pState);
throw WindowsException(hr$);
}
final result$ = pState.value;
free(pState);
return .new(result$);
}