What are different error cases in Win32 APIs

Harshithraj1871 1,581 Reputation points
2025-02-06T07:59:17.4633333+00:00

Hi,

I'm working on Win32 desktop application in CPP. I'm trying to find all the error cases where a Win32 API can fail. But the documentation does not give us a clear information when can a particular API fail. It just tells to get the error status with GetLastError which has a large possible list of error codes. There are case where an API has a few list of failure cases like CreateWindow still I'm not able to get the comprehensive list of all the failure cases for a particular API.

I tried to get a list of failure cases, There are developer errors, which can fail because of passing wrong parameters, passing wrong paths etc and there are Non recoverable failure because of system resources. Excluding this are there any error cases/segment of failure cases which I need to look into?

PS : I'm looking for only rendering APIs, not file or any IO related API

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,737 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.