Skip to content

Add function overload for GetWindowLongPtr in org.lwjgl.system.windows.User32 to maintain backward compatibility #1052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
HamiltonHuaji opened this issue Mar 20, 2025 · 0 comments

Comments

@HamiltonHuaji
Copy link

Version

3.3.6

Platform

Windows x64

JDK

N/A

Module

org.lwjgl.system.windows.User32

Bug description

In version 3.3.4 of the org.lwjgl.system.windows.User32 module, the function GetWindowLongPtr had the following signature:

@NativeType("LONG_PTR") 
public static long GetWindowLongPtr(@NativeType("HWND") long hWnd, int nIndex);

However, in version 3.3.6, the function signature was changed to:

@NativeType("LONG_PTR") 
public static long GetWindowLongPtr(@NativeType("DWORD *") @Nullable IntBuffer _GetLastError, @NativeType("HWND") long hWnd, int nIndex);

While it is possible to achieve the same functionality by passing null as the first argument, this change breaks existing codebases that rely on the previous signature, such as kotlin-graphics/imgui.

To maintain backward compatibility, I request to add an overloaded version of the GetWindowLongPtr function that retains the original signature:

@NativeType("LONG_PTR") 
public static long GetWindowLongPtr(@NativeType("HWND") long hWnd, int nIndex) {
    return GetWindowLongPtr(null, hWnd, nIndex);
}

Stacktrace or crash log output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant