4.1.11.2.2 GetWindowsErrorCode

 procedure GetWindowsErrorCode(ntStatus: DWORD): DWORD

Returns the Windows error code corresponding to the specified STATUS code.