AK: Add Error::from_windows_error(void)

Also slightly improve Error::from_windows_error(int)
This commit is contained in:
stasoid 2024-12-08 22:00:56 +05:00 committed by Andrew Kaster
commit 870cce9d11
Notes: github-actions[bot] 2025-02-06 02:28:57 +00:00
5 changed files with 40 additions and 34 deletions

View file

@ -7,13 +7,8 @@
#pragma once
#include <AK/StringView.h>
#include <AK/Try.h>
#include <AK/Variant.h>
#include <errno.h>
#include <string.h>
#ifdef AK_OS_WINDOWS
typedef unsigned long DWORD;
#endif
namespace AK {
@ -29,7 +24,8 @@ public:
}
#ifdef AK_OS_WINDOWS
static Error from_windows_error(DWORD code);
static Error from_windows_error(u64 code);
static Error from_windows_error();
#endif
// NOTE: For calling this method from within kernel code, we will simply print