GetLastError

E724275

GetLastError is a Windows API function that retrieves the calling thread’s most recent error code, commonly used for diagnosing failures in system and application calls.

All labels observed (1)

Label Occurrences
GetLastError canonical 2

How this entity was disambiguated

Statements (30)

Predicate Object
instanceOf Windows API function ⓘ
availableOn Windows desktop applications ⓘ
Windows server applications ⓘ
belongsToLibrary Kernel32.dll ⓘ
callingConvention stdcall ⓘ
category error handling API ⓘ
declaredInHeader windows.h ⓘ
definedIn Windows API ⓘ
linked to: Win32 API
documentationURL https://learn.microsoft.com/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror ⓘ
errorCodesDefinedIn WinError.h ⓘ
errorCodesInterpretedBy FormatMessage ⓘ
errorCodeSource per-thread last-error code maintained by the system ⓘ
exportedBy Kernel32.dll ⓘ
linked to: Kernel32
language C ⓘ
C++ ⓘ
mustBeCalledAfter failing Windows API function ⓘ
relatedFunction FormatMessage ⓘ
SetLastError ⓘ
WSAGetLastError ⓘ
requires including windows.h in source code ⓘ
retrieves calling thread’s last-error code value ⓘ
returnsNonZeroMeaning an error code indicating the last error ⓘ
returnsZeroMeaning no extended error information is available ⓘ
returnType DWORD ⓘ
targetPlatform Microsoft Windows ⓘ
linked to: Windows
threadLocal true ⓘ
threadSafetyNote last-error code is maintained per thread, not per process ⓘ
usedFor diagnosing failures in Windows API calls ⓘ
diagnosing failures in application calls that use Win32 API ⓘ
diagnosing failures in system calls ⓘ

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

Kernel32 → exportsFunction → GetLastError ⓘ
VirtualFree → errorRetrievalFunction → GetLastError ⓘ