Getting the latest system error.
The return value is the last-error code value: You should call the GetLastError function immediately when a function's return value indicates that such a call will return useful data. That is because some functions call SetLastError(MODA_EOK) when they succeed, wiping out the error code set by the most recently failed function.
User can reset this value calling ResetLastSystemError. 'System' error is not 'device' error. See Message function to learn mode about errors.