#1 2025-09-10 08:17:06

zed
Member
Registered: 2015-02-26
Posts: 111

ODBC: Wrong SqlHWnd type declaration

Hi,

I noticed that the type SqlHWnd is currently declared as

SqlHWnd = LongWord;

But, according to the ODBC API, SQLHWND is defined as HWND, which itself is declared as void*.

Declaring it as LongWord forces it to 32 bits, which breaks compatibility on 64-bit Windows.

It should instead be declared as a pointer type (PtrUInt).

Offline

#2 2025-09-10 08:37:47

zed
Member
Registered: 2015-02-26
Posts: 111

Re: ODBC: Wrong SqlHWnd type declaration

The variables of this type are used in two functions as parameters: SqlDriverConnectA and SqlDriverConnectW.

On Win64, since parameters are passed through registers and the HWND type fits within 32 bits, no fatal errors occur in practice.

However, the type declaration should still be corrected for proper compatibility and clarity.

Offline

#3 2025-09-10 14:14:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,181
Website

Re: ODBC: Wrong SqlHWnd type declaration

Offline

Board footer

Powered by FluxBB