AOSSIE-Org / AOSSIE-Org/Ell-ena

BUG:[windows] Missing error handling for RegisterClass in win32_window.cpp

Offen
#245 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dart
Sterne
54
Forks
110
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

**Issue Overview**
Some critical WinAPI calls such as RegisterClass and DwmSetWindowAttribute are used without checking their return values. This can make debugging difficult if these calls fail silently.

**Steps to Reproduce**
Inspect the implementation of WindowClassRegistrar::GetWindowClass()
Observe that RegisterClass is called without checking its return value
Inspect Win32Window::UpdateTheme()
Observe that DwmSetWindowAttribute is called without verifying success

**Expected Behavior**
WinAPI calls should have their return values checked
Failures should be logged or handled appropriately

**Actual Behavior**
Failures in these API calls are not detected
Debugging issues related to window creation or theme updates becomes difficult

**Suggested Improvements**
Add minimal error handling for these calls:
if (!RegisterClass(&window_class)) {
OutputDebugString(L"Failed to register window class\n");
}
HRESULT hr = DwmSetWindowAttribute(...);
if (FAILED(hr)) {
OutputDebugString(L"Failed to set dark mode attribute\n");
}

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.