Compare commits

..

20 Commits
v10.5 ... v10.7

Author SHA1 Message Date
Alistair Leslie-Hughes
edfe4935ff Release v10.7 2025-05-03 15:42:07 +10:00
Alistair Leslie-Hughes
b8110be095 Updated odbc32-fixes patchset
Convert of type needs to occur not matter if fallback is being used.
2025-05-02 11:14:22 +10:00
Alistair Leslie-Hughes
42a307df67 Updated odbc32-fixes patchset
More support for the PostgreSQL ODBC ascii driver.
2025-05-01 08:42:13 +10:00
Alistair Leslie-Hughes
c89fe8069e Updated vkd3d-latest patchset 2025-05-01 06:49:44 +10:00
Alistair Leslie-Hughes
eff3de6ad2 Updated odbc32-fixes patchset 2025-04-30 14:13:01 +10:00
Alistair Leslie-Hughes
9f89b77e8f Updated vkd3d-latest patchset 2025-04-29 08:02:01 +10:00
Elizabeth Figura
74dd8bdd2a Rebase against e646263a6f048156d5cb9c63b094cd9c80d5bfb6. 2025-04-28 16:59:26 -05:00
Alistair Leslie-Hughes
f01e66252c Updated odbc32-fixes patchset
Completed patchset to get PostgreSQL ASCII driver working.
2025-04-28 11:21:27 +10:00
Alistair Leslie-Hughes
353a868136 Updated odbc32-fixes patchset
Attempt to get PostgreSQL ascii ODBC driver working.
2025-04-26 19:19:26 +10:00
Alistair Leslie-Hughes
ee5092247c Updated vkd3d-latest patchset 2025-04-26 09:07:11 +10:00
Alistair Leslie-Hughes
e54c70a009 Rebase against f7503d0a996ae1243dd6c87b39a9143624a80465. 2025-04-26 09:03:13 +10:00
Elizabeth Figura
1b8ab6cb68 Rebase against ba6adef9bfc209f1247ba88acec64b58d97100c3. 2025-04-21 17:29:53 -05:00
Alistair Leslie-Hughes
81425de332 Release v10.6 2025-04-21 15:53:41 +10:00
Alistair Leslie-Hughes
c2d96a3c91 Rebase against 040e1333b1f4cf73d6877daec15495a8be42324a. 2025-04-21 07:24:55 +10:00
Alistair Leslie-Hughes
292830fa82 Updated vkd3d-latest patchset 2025-04-17 08:55:47 +10:00
Elizabeth Figura
6912feaf65 Rebase against 661cc2a1dec5e44e074702707272228178f21487. 2025-04-15 23:07:07 -05:00
Alistair Leslie-Hughes
aa0c8391eb Updated odbc32-fixes patchset
Thanks Steve Fawcett.
2025-04-10 08:25:33 +10:00
Alistair Leslie-Hughes
36020b4a0e Updated vkd3d-latest patchset
Squash and update.
2025-04-10 08:23:17 +10:00
Elizabeth Figura
4fa7fcd631 Rebase against 647004cd5d7ee93ad8b53abb8939da87be3e25a0. 2025-04-09 17:11:35 -05:00
Elizabeth Figura
ebf36e4717 d3dx9_36-DDS: Remove patch.
This was implemented upstream by e12a1d283a0d4a14c2394a05052b06f0de16f1a6.
2025-04-09 16:47:07 -05:00
44 changed files with 12284 additions and 8874 deletions

View File

@@ -1,231 +0,0 @@
From e6c1c1fe3fe2f4fe7d3e421b94d925c40063af22 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 5 Jul 2019 13:20:23 +0800
Subject: [PATCH] cryptext: Implement CryptExtOpenCER.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
configure | 1 +
configure.ac | 1 +
dlls/cryptext/Makefile.in | 3 +-
dlls/cryptext/cryptext.spec | 4 +--
dlls/cryptext/cryptext_main.c | 64 +++++++++++++++++++++++++++++++++
dlls/cryptext/tests/Makefile.in | 4 +++
dlls/cryptext/tests/cryptext.c | 61 +++++++++++++++++++++++++++++++
7 files changed, 135 insertions(+), 3 deletions(-)
create mode 100644 dlls/cryptext/tests/Makefile.in
create mode 100644 dlls/cryptext/tests/cryptext.c
diff --git a/configure b/configure
index ca6e87d4740..7033499399f 100755
--- a/configure
+++ b/configure
@@ -21660,6 +21660,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg
wine_fn_config_makefile dlls/cryptdll enable_cryptdll
wine_fn_config_makefile dlls/cryptext enable_cryptext
+wine_fn_config_makefile dlls/cryptext/tests enable_tests
wine_fn_config_makefile dlls/cryptnet enable_cryptnet
wine_fn_config_makefile dlls/cryptnet/tests enable_tests
wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt
diff --git a/configure.ac b/configure.ac
index cba55126869..57064a05fe5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2477,6 +2477,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptdlg)
WINE_CONFIG_MAKEFILE(dlls/cryptdll)
WINE_CONFIG_MAKEFILE(dlls/cryptext)
+WINE_CONFIG_MAKEFILE(dlls/cryptext/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptnet)
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptowinrt)
diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in
index 5598bfb78e0..acda4e4ac6d 100644
--- a/dlls/cryptext/Makefile.in
+++ b/dlls/cryptext/Makefile.in
@@ -1,4 +1,5 @@
-MODULE = cryptext.dll
+MODULE = cryptext.dll
+IMPORTS = crypt32 cryptui user32
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/cryptext/cryptext.spec b/dlls/cryptext/cryptext.spec
index ee3e155f457..24b4794c198 100644
--- a/dlls/cryptext/cryptext.spec
+++ b/dlls/cryptext/cryptext.spec
@@ -12,8 +12,8 @@
@ stub CryptExtAddSPCW
@ stub CryptExtOpenCAT
@ stub CryptExtOpenCATW
-@ stub CryptExtOpenCER
-@ stub CryptExtOpenCERW
+@ stdcall CryptExtOpenCER(long ptr str long)
+@ stdcall CryptExtOpenCERW(long ptr wstr long)
@ stub CryptExtOpenCRL
@ stub CryptExtOpenCRLW
@ stub CryptExtOpenCTL
diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c
index 537ba66cd3b..a4314518eac 100644
--- a/dlls/cryptext/cryptext_main.c
+++ b/dlls/cryptext/cryptext_main.c
@@ -22,10 +22,29 @@
#include "windef.h"
#include "winbase.h"
+#include "winnls.h"
+#include "wincrypt.h"
+#include "winuser.h"
+#include "cryptuiapi.h"
+
+#include "wine/heap.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(cryptext);
+static WCHAR *heap_strdupAtoW(const char *str)
+{
+ WCHAR *ret;
+ INT len;
+
+ if (!str) return NULL;
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
+ ret = heap_alloc(len * sizeof(WCHAR));
+ if (ret)
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
+ return ret;
+}
+
/***********************************************************************
* CryptExtAddPFX (CRYPTEXT.@)
*/
@@ -43,3 +62,48 @@ HRESULT WINAPI CryptExtAddPFXW(LPCWSTR filename)
FIXME("stub: %s\n", debugstr_w(filename));
return E_NOTIMPL;
}
+
+/***********************************************************************
+ * CryptExtOpenCERW (CRYPTEXT.@)
+ */
+HRESULT WINAPI CryptExtOpenCERW(HWND hwnd, HINSTANCE hinst, LPCWSTR filename, DWORD showcmd)
+{
+ PCCERT_CONTEXT ctx;
+ CRYPTUI_VIEWCERTIFICATE_STRUCTW info;
+
+ TRACE("(%p, %p, %s, %lu)\n", hwnd, hinst, debugstr_w(filename), showcmd);
+
+ if (!CryptQueryObject(CERT_QUERY_OBJECT_FILE, filename, CERT_QUERY_CONTENT_FLAG_CERT,
+ CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, NULL, NULL, NULL, NULL,
+ (const void **)&ctx))
+ {
+ /* FIXME: move to the resources */
+ static const WCHAR msg[] = {'T','h','i','s',' ','i','s',' ','n','o','t',' ','a',' ','v','a','l','i','d',' ','c','e','r','t','i','f','i','c','a','t','e',0};
+ MessageBoxW(NULL, msg, filename, MB_OK | MB_ICONERROR);
+ return S_OK; /* according to the tests */
+ }
+
+ memset(&info, 0, sizeof(info));
+ info.dwSize = sizeof(info);
+ info.pCertContext = ctx;
+ CryptUIDlgViewCertificateW(&info, NULL);
+ CertFreeCertificateContext(ctx);
+
+ return S_OK;
+}
+
+/***********************************************************************
+ * CryptExtOpenCER (CRYPTEXT.@)
+ */
+HRESULT WINAPI CryptExtOpenCER(HWND hwnd, HINSTANCE hinst, LPCSTR filename, DWORD showcmd)
+{
+ HRESULT hr;
+ LPWSTR filenameW;
+
+ TRACE("(%p, %p, %s, %lu)\n", hwnd, hinst, debugstr_a(filename), showcmd);
+
+ filenameW = heap_strdupAtoW(filename);
+ hr = CryptExtOpenCERW(hwnd, hinst, filenameW, showcmd);
+ heap_free(filenameW);
+ return hr;
+}
diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in
new file mode 100644
index 00000000000..c3f4551fc00
--- /dev/null
+++ b/dlls/cryptext/tests/Makefile.in
@@ -0,0 +1,4 @@
+TESTDLL = cryptext.dll
+
+SOURCES = \
+ cryptext.c
diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c
new file mode 100644
index 00000000000..ab1007dbd82
--- /dev/null
+++ b/dlls/cryptext/tests/cryptext.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2019 Dmitry Timoshkov
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdarg.h>
+#include <assert.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winuser.h>
+#include <winerror.h>
+
+#include "wine/test.h"
+
+static HRESULT (WINAPI *pCryptExtOpenCER)(HWND,HINSTANCE,LPCSTR,DWORD);
+
+static void test_CryptExtOpenCER(void)
+{
+ HRESULT hr;
+
+ if (!pCryptExtOpenCER)
+ {
+ win_skip("CryptExtOpenCER is not available on this platform\n");
+ return;
+ }
+
+ if (!winetest_interactive)
+ {
+ skip("CryptExtOpenCER test needs user interaction\n");
+ return;
+ }
+
+ SetLastError(0xdeadbeef);
+ hr = pCryptExtOpenCER(0, 0, "dead.beef", SW_HIDE);
+ ok(hr == S_OK, "got %#lx\n", hr);
+
+ hr = pCryptExtOpenCER(0, 0, "VeriSign Class 3 Public Primary Certification Authority - G4.txt", SW_SHOW);
+ ok(hr == S_OK, "got %#lx\n", hr);
+}
+
+START_TEST(cryptext)
+{
+ HMODULE hmod = LoadLibraryA("cryptext.dll");
+
+ pCryptExtOpenCER = (void *)GetProcAddress(hmod, "CryptExtOpenCER");
+
+ test_CryptExtOpenCER();
+}
--
2.43.0

View File

@@ -1,2 +0,0 @@
# Taken from the mailing list - July 2019.
Fixes: cryptext: Implement CryptExtOpenCER.

View File

@@ -1,118 +0,0 @@
From 71d1c176af87bdc48326d5883fbea608314ee0a4 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 11 Jan 2015 16:29:30 +0100
Subject: [PATCH] d3dx9_36: Improve D3DXSaveTextureToFile to save simple
texture to dds file.
---
dlls/d3dx9_36/d3dx9_private.h | 2 ++
dlls/d3dx9_36/surface.c | 63 +++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/texture.c | 5 +--
3 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
index 6a9b3e12b7b..0c6374f35ca 100644
--- a/dlls/d3dx9_36/d3dx9_private.h
+++ b/dlls/d3dx9_36/d3dx9_private.h
@@ -316,6 +316,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO
IDirect3DSurface9 **temp_surface, BOOL write);
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect,
IDirect3DSurface9 *temp_surface, BOOL update);
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture,
+ const PALETTEENTRY *src_palette);
HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch,
const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right,
uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels);
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 9d2dc96a979..912a3e3c849 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -628,6 +628,69 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
return D3D_OK;
}
+static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex,
+ int face, UINT level, struct IDirect3DSurface9 **surf)
+{
+ switch (type)
+ {
+ case D3DRTYPE_TEXTURE:
+ return IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9*) tex, level, surf);
+ case D3DRTYPE_CUBETEXTURE:
+ return IDirect3DCubeTexture9_GetCubeMapSurface((IDirect3DCubeTexture9*) tex, face, level, surf);
+ default:
+ ERR("Unexpected texture type\n");
+ return E_NOTIMPL;
+ }
+}
+
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
+{
+ HRESULT hr;
+ D3DRESOURCETYPE type;
+ UINT mip_levels;
+ IDirect3DSurface9 *surface;
+
+ type = IDirect3DBaseTexture9_GetType(src_texture);
+
+ if ((type != D3DRTYPE_TEXTURE) && (type != D3DRTYPE_CUBETEXTURE) && (type != D3DRTYPE_VOLUMETEXTURE))
+ return D3DERR_INVALIDCALL;
+
+ if (type == D3DRTYPE_CUBETEXTURE)
+ {
+ FIXME("Cube texture not supported yet\n");
+ return E_NOTIMPL;
+ }
+ else if (type == D3DRTYPE_VOLUMETEXTURE)
+ {
+ FIXME("Volume texture not supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ mip_levels = IDirect3DTexture9_GetLevelCount(src_texture);
+
+ if (mip_levels > 1)
+ {
+ FIXME("Mipmap not supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ if (src_palette)
+ {
+ FIXME("Saving surfaces with palettized pixel formats not implemented yet\n");
+ return E_NOTIMPL;
+ }
+
+ hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = save_dds_surface_to_memory(dst_buffer, surface, NULL, NULL);
+ IDirect3DSurface9_Release(surface);
+ }
+
+ return hr;
+}
+
static const uint8_t bmp_file_signature[] = { 'B', 'M' };
static const uint8_t jpg_file_signature[] = { 0xff, 0xd8 };
static const uint8_t png_file_signature[] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a };
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 719a2787445..3f76ec209f9 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1866,10 +1866,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
if (file_format == D3DXIFF_DDS)
- {
- FIXME("DDS file format isn't supported yet\n");
- return E_NOTIMPL;
- }
+ return save_dds_texture_to_memory(dst_buffer, src_texture, src_palette);
type = IDirect3DBaseTexture9_GetType(src_texture);
switch (type)
--
2.47.2

View File

@@ -1,2 +0,0 @@
Fixes: [26898] Support for DDS file format in D3DXSaveTextureToFileInMemory
Disabled: True

View File

@@ -1,27 +1,28 @@
From 1de2ab4f1d48391f112897c2c89d4c1d77d4ac3f Mon Sep 17 00:00:00 2001
From 05dfee93e261b38037c370611ab0f63a2785a08c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 27 Feb 2016 00:04:10 +0100
Subject: krnl386.exe16: Emulate GDT and LDT access.
Subject: [PATCH] krnl386.exe16: Emulate GDT and LDT access.
---
dlls/krnl386.exe16/instr.c | 64 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 55 insertions(+), 9 deletions(-)
dlls/krnl386.exe16/instr.c | 65 ++++++++++++++++++++++++++++++++------
1 file changed, 56 insertions(+), 9 deletions(-)
diff --git a/dlls/krnl386.exe16/instr.c b/dlls/krnl386.exe16/instr.c
index b0de30f..865d944 100644
index 666ef71363f..c6d05b7a0c9 100644
--- a/dlls/krnl386.exe16/instr.c
+++ b/dlls/krnl386.exe16/instr.c
@@ -67,7 +67,7 @@ static inline void *get_stack( CONTEXT *context )
@@ -60,7 +60,8 @@ static inline void *get_stack( CONTEXT *context )
}
#include "pshpack1.h"
#pragma pack(push,1)
-struct idtr
+
+struct dtr
{
WORD limit;
BYTE *base;
@@ -75,19 +75,41 @@ struct idtr
#include "poppack.h"
@@ -68,19 +69,41 @@ struct idtr
#pragma pack(pop)
static LDT_ENTRY idt[256];
+static LDT_ENTRY gdt[8192];
@@ -35,6 +36,18 @@ index b0de30f..865d944 100644
+ struct dtr ret;
__asm__( "sidtl %0" : "=m" (ret) );
+ *offset = data - ret.base;
+ return (*offset <= ret.limit + 1 - data_size);
+#else
+ return FALSE;
+#endif
+}
+
+static BOOL emulate_gdtr( BYTE *data, unsigned int data_size, unsigned int *offset )
+{
+#if defined(__i386__) && defined(__GNUC__)
+ struct dtr ret;
+ __asm__( "sgdtl %0" : "=m" (ret) );
+ *offset = data - ret.base;
+ return (*offset <= ret.limit + 1 - data_size);
#else
- ret.base = (BYTE *)idt;
@@ -44,18 +57,6 @@ index b0de30f..865d944 100644
- return ret;
}
+static BOOL emulate_gdtr( BYTE *data, unsigned int data_size, unsigned int *offset )
+{
+#if defined(__i386__) && defined(__GNUC__)
+ struct dtr ret;
+ __asm__( "sgdtl %0" : "=m" (ret) );
+ *offset = data - ret.base;
+ return (*offset <= ret.limit + 1 - data_size);
+#else
+ return FALSE;
+#endif
+}
+
+static inline WORD get_ldt(void)
+{
+ WORD seg = 1;
@@ -67,7 +68,7 @@ index b0de30f..865d944 100644
/***********************************************************************
* INSTR_ReplaceSelector
@@ -711,10 +733,9 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
@@ -705,10 +728,9 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
BYTE *data = INSTR_GetOperandAddr(context, instr + 1, long_addr,
segprefix, &len);
unsigned int data_size = (*instr == 0x8b) ? (long_op ? 4 : 2) : 1;
@@ -80,7 +81,7 @@ index b0de30f..865d944 100644
{
idt[1].LimitLow = 0x100; /* FIXME */
idt[2].LimitLow = 0x11E; /* FIXME */
@@ -728,6 +749,31 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
@@ -722,6 +744,31 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
context->Eip += prefixlen + len + 1;
return ExceptionContinueExecution;
}
@@ -113,5 +114,5 @@ index b0de30f..865d944 100644
break; /* Unable to emulate it */
--
2.7.1
2.47.2

View File

@@ -1,21 +1,23 @@
From 1b2068b8f8adc036d0c2b9cda00c37cd55330b41 Mon Sep 17 00:00:00 2001
From 6159b0b10211094af4f0d5b8e6bff5c589664025 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 12 Jul 2024 14:40:32 +1000
Subject: [PATCH] odbc32: SQLBindParameter handle fallback function
---
dlls/odbc32/proxyodbc.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
dlls/odbc32/proxyodbc.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 8f53fa71668..7099027c2b4 100644
index d11b4122776..3eb53288c65 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -5242,6 +5242,29 @@ static SQLRETURN bind_parameter_win32( struct statement *stmt, SQLUSMALLINT para
if (stmt->hdr.win32_funcs->SQLBindParameter)
return stmt->hdr.win32_funcs->SQLBindParameter( stmt->hdr.win32_handle, param, io_type, value_type,
param_type, size, digits, value, buflen, len );
+ else if(stmt->hdr.win32_funcs->SQLBindParam)
@@ -5522,9 +5522,37 @@ static SQLRETURN bind_parameter_win32( struct statement *stmt, SQLUSMALLINT para
SQLSMALLINT value_type, SQLSMALLINT param_type, SQLULEN size,
SQLSMALLINT digits, SQLPOINTER value, SQLLEN buflen, SQLLEN *len )
{
+ struct environment *env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+
+ if (env && env->attr_version == SQL_OV_ODBC3 && env->driver_ver == SQL_OV_ODBC2)
+ {
+ /* ODBC v2 */
+ /* TODO: Make function */
@@ -32,8 +34,14 @@ index 8f53fa71668..7099027c2b4 100644
+ else if (param_type == SQL_DATE)
+ param_type = SQL_TYPE_DATE;
+ else if (param_type == SQL_TIMESTAMP)
+ param_type = SQL_TYPE_TIMESTAMP;;;
+ param_type = SQL_TYPE_TIMESTAMP;
+ }
+
if (stmt->hdr.win32_funcs->SQLBindParameter)
return stmt->hdr.win32_funcs->SQLBindParameter( stmt->hdr.win32_handle, param, io_type, value_type,
param_type, size, digits, value, buflen, len );
+ else if(stmt->hdr.win32_funcs->SQLBindParam)
+ {
+ return stmt->hdr.win32_funcs->SQLBindParam( stmt->hdr.win32_handle, param, value_type, param_type,
+ size, digits, value, len);
+ }
@@ -42,5 +50,5 @@ index 8f53fa71668..7099027c2b4 100644
}
--
2.43.0
2.47.2

View File

@@ -1,4 +1,4 @@
From 2d897946980e67f742b9f39f5f548cf0e2340510 Mon Sep 17 00:00:00 2001
From f16a96be2b219f8e7733a36dc147f5247b618870 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2024 21:55:20 +1000
Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
@@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
1 file changed, 24 insertions(+)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 3b3b198eaa8..c2748cd33d7 100644
index c16c9a6da69..18d3df1007f 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -2450,11 +2450,35 @@ static SQLRETURN get_data_unix( struct statement *stmt, SQLUSMALLINT column, SQL
@@ -2468,11 +2468,35 @@ static SQLRETURN get_data_unix( struct statement *stmt, SQLUSMALLINT column, SQL
return ret;
}
@@ -31,7 +31,7 @@ index 3b3b198eaa8..c2748cd33d7 100644
if (stmt->hdr.win32_funcs->SQLGetData)
+ {
+ struct environment *env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+ if (env && env->attr_version == SQL_OV_ODBC2)
+ if (env && env->driver_ver == SQL_OV_ODBC2)
+ {
+ if (type == SQL_C_TYPE_TIME)
+ type = SQL_C_TIME;
@@ -48,5 +48,5 @@ index 3b3b198eaa8..c2748cd33d7 100644
}
--
2.45.2
2.47.2

View File

@@ -1,26 +1,27 @@
From 6b7448e5ebdc0b16f3af606a62e2ca465f3ae026 Mon Sep 17 00:00:00 2001
From 5874cf0a309a0ecfa97206b8b15734485920c325 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2024 22:03:03 +1000
Subject: [PATCH] odbc32: SQLColAttributesW support ODBC v2.0
---
dlls/odbc32/proxyodbc.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
dlls/odbc32/proxyodbc.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 71c853013fd..b5c0edb119e 100644
index 18d3df1007f..8d51ad37176 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6195,6 +6195,8 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
@@ -6256,6 +6256,9 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen,
SQLLEN *num_attr )
{
+ struct environment *env;
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLColAttributeW)
return stmt->hdr.win32_funcs->SQLColAttributeW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
@@ -6237,11 +6239,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
@@ -6315,11 +6318,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
return SQL_ERROR;
}
@@ -28,9 +29,9 @@ index 71c853013fd..b5c0edb119e 100644
+ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
+ /* Convert back for ODBC2 drivers */
+ env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+ if (SQL_SUCCEEDED(ret) && num_attr && field_id == SQL_COLUMN_TYPE &&
+ ((struct environment*)(stmt->hdr.parent))->attr_version == SQL_OV_ODBC2 &&
+ ((struct environment*)(stmt->hdr.parent))->driver_ver == SQL_OV_ODBC2)
+ env && env->attr_version == SQL_OV_ODBC3 && env->driver_ver == SQL_OV_ODBC2)
+ {
+ if (*num_attr == SQL_TIME)
+ *num_attr = SQL_TYPE_TIME;
@@ -47,5 +48,5 @@ index 71c853013fd..b5c0edb119e 100644
/*************************************************************************
--
2.43.0
2.47.2

View File

@@ -0,0 +1,64 @@
From 518a165d51be822ae34c89146cd6a0d75e41852b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 12:33:23 +1000
Subject: [PATCH] odbc32: SQLDriverConnectW fallback to SQLDriverConnect when
required.
---
dlls/odbc32/proxyodbc.c | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index cf9d72e8452..e26fdcb8620 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6861,11 +6861,44 @@ static SQLRETURN driver_connect_win32_w( struct connection *con, SQLHWND window,
SQLSMALLINT len, SQLWCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2,
SQLUSMALLINT completion )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (con->hdr.win32_funcs->SQLDriverConnectW)
return con->hdr.win32_funcs->SQLDriverConnectW( con->hdr.win32_handle, window, in_conn_str, len, out_conn_str,
buflen, len2, completion );
- if (con->hdr.win32_funcs->SQLDriverConnect) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ if (con->hdr.win32_funcs->SQLDriverConnect)
+ {
+ SQLCHAR *in = NULL, *out = NULL;
+ SQLSMALLINT in_len = 0, out_len = 0;
+
+ in_len = WideCharToMultiByte(CP_ACP, 0, in_conn_str, len, NULL, 0, NULL, NULL);
+ if (!(in = malloc(in_len + 1))) return SQL_ERROR;
+
+ WideCharToMultiByte(CP_ACP, 0, in_conn_str, len, (char *)in, in_len, NULL, NULL);
+ in[in_len] = 0;
+
+ if (out_conn_str && buflen > 0)
+ {
+ if (!(out = malloc(buflen)))
+ {
+ free(in);
+ return SQL_ERROR;
+ }
+ }
+
+ ret = con->hdr.win32_funcs->SQLDriverConnect( con->hdr.win32_handle, window, in, in_len, out, buflen, &out_len, completion );
+
+ if (SQL_SUCCEEDED(ret) && out_conn_str && out)
+ {
+ MultiByteToWideChar(CP_ACP, 0, (char *)out, out_len, out_conn_str, buflen);
+ if (len2) *len2 = out_len;
+ }
+
+ free(in);
+ free(out);
+ }
+
+ return ret;
}
static SQLRETURN driver_connect_unix_w( struct connection *con, SQLHWND window, SQLWCHAR *in_conn_str, SQLSMALLINT len,
--
2.47.2

View File

@@ -0,0 +1,100 @@
From 53904cea4cd192552ab26c247593c91ca0b81993 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 16:27:58 +1000
Subject: [PATCH] odbc32: SQLGetInfoW support ascii fallback.
---
dlls/odbc32/proxyodbc.c | 72 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 70 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index d11b4122776..cc7b9309562 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6924,13 +6924,81 @@ static SQLRETURN get_info_unix_w( struct connection *con, SQLUSMALLINT type, SQL
return ODBC_CALL( SQLGetInfoW, &params );
}
+static BOOL typeinfo_is_string( SQLSMALLINT type )
+{
+ switch (type)
+ {
+ case SQL_ACCESSIBLE_PROCEDURES:
+ case SQL_ACCESSIBLE_TABLES:
+ case SQL_CATALOG_NAME:
+ case SQL_CATALOG_NAME_SEPARATOR:
+ case SQL_CATALOG_TERM:
+ case SQL_COLLATION_SEQ:
+ case SQL_COLUMN_ALIAS:
+ case SQL_DATA_SOURCE_NAME:
+ case SQL_DATA_SOURCE_READ_ONLY:
+ case SQL_DATABASE_NAME:
+ case SQL_DBMS_NAME:
+ case SQL_DBMS_VER:
+ case SQL_DESCRIBE_PARAMETER:
+ case SQL_DRIVER_NAME:
+ case SQL_DRIVER_ODBC_VER:
+ case SQL_DRIVER_VER:
+ case SQL_ODBC_VER:
+ case SQL_EXPRESSIONS_IN_ORDERBY:
+ case SQL_IDENTIFIER_QUOTE_CHAR:
+ case SQL_INTEGRITY:
+ case SQL_KEYWORDS:
+ case SQL_LIKE_ESCAPE_CLAUSE:
+ case SQL_MAX_ROW_SIZE_INCLUDES_LONG:
+ case SQL_MULT_RESULT_SETS:
+ case SQL_MULTIPLE_ACTIVE_TXN:
+ case SQL_NEED_LONG_DATA_LEN:
+ case SQL_ORDER_BY_COLUMNS_IN_SELECT:
+ case SQL_PROCEDURE_TERM:
+ case SQL_PROCEDURES:
+ case SQL_ROW_UPDATES:
+ case SQL_SCHEMA_TERM:
+ case SQL_SEARCH_PATTERN_ESCAPE:
+ case SQL_SERVER_NAME:
+ case SQL_SPECIAL_CHARACTERS:
+ case SQL_TABLE_TERM:
+ case SQL_USER_NAME:
+ case SQL_XOPEN_CLI_YEAR:
+ case SQL_OUTER_JOINS:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
static SQLRETURN get_info_win32_w( struct connection *con, SQLUSMALLINT type, SQLPOINTER value, SQLSMALLINT buflen,
SQLSMALLINT *retlen )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (con->hdr.win32_funcs->SQLGetInfoW)
return con->hdr.win32_funcs->SQLGetInfoW( con->hdr.win32_handle, type, value, buflen, retlen );
- if (con->hdr.win32_funcs->SQLGetInfo) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ if (con->hdr.win32_funcs->SQLGetInfo)
+ {
+ ret = con->hdr.win32_funcs->SQLGetInfo( con->hdr.win32_handle, type, value, buflen, retlen );
+ if (SQL_SUCCEEDED(ret) && typeinfo_is_string(type))
+ {
+ if (value)
+ {
+ WCHAR *p = strnAtoW(value, -1);
+ wcscpy(value, p);
+ free(p);
+
+ if (retlen)
+ *retlen = wcslen(value) * sizeof(WCHAR);
+ }
+
+ if (retlen)
+ *retlen = *retlen * sizeof(WCHAR);
+ }
+ }
+ return ret;
}
/*************************************************************************
--
2.47.2

View File

@@ -0,0 +1,57 @@
From 6beecab75df0c60ccde26fe8571172166efd5d72 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 17:07:21 +1000
Subject: [PATCH] odbc32: SQLExecDirectW call fallback SQLExecDirect
---
dlls/odbc32/proxyodbc.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index e8b05a7b9ec..b792fcbe603 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -1099,6 +1099,20 @@ static SQLWCHAR *strnAtoW( const SQLCHAR *str, int len )
return ret;
}
+static inline char *strdupWtoA(const WCHAR *str)
+{
+ char *ret = NULL;
+
+ if(str) {
+ DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
+ ret = malloc(size);
+ if(ret)
+ WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
+ }
+
+ return ret;
+}
+
static SQLRETURN columns_unix_a( struct statement *stmt, SQLCHAR *catalog, SQLSMALLINT len1, SQLCHAR *schema,
SQLSMALLINT len2, SQLCHAR *table, SQLSMALLINT len3, SQLCHAR *column,
SQLSMALLINT len4 )
@@ -6073,10 +6087,17 @@ static SQLRETURN exec_direct_unix_w( struct statement *stmt, SQLWCHAR *text, SQL
static SQLRETURN exec_direct_win32_w( struct statement *stmt, SQLWCHAR *text, SQLINTEGER len )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLExecDirectW)
return stmt->hdr.win32_funcs->SQLExecDirectW( stmt->hdr.win32_handle, text, len );
- if (stmt->hdr.win32_funcs->SQLExecDirect) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ if (stmt->hdr.win32_funcs->SQLExecDirect)
+ {
+ SQLCHAR *textA = (SQLCHAR*)strdupWtoA( text );
+ ret = stmt->hdr.win32_funcs->SQLExecDirect( stmt->hdr.win32_handle, textA, len );
+ free(textA);
+ }
+ return ret;
}
/*************************************************************************
--
2.47.2

View File

@@ -0,0 +1,40 @@
From ff127c9da0bcfe90fbf2c9d6bcbd63e11366b43c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 17:32:49 +1000
Subject: [PATCH] odbc32: SQLDescribeColW add ascii fallback
---
dlls/odbc32/proxyodbc.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index b792fcbe603..c81ab1f39d3 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -5975,11 +5975,21 @@ static SQLRETURN describe_col_win32_w( struct statement *stmt, SQLUSMALLINT col_
SQLSMALLINT buf_len, SQLSMALLINT *name_len, SQLSMALLINT *data_type,
SQLULEN *col_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLDescribeColW)
return stmt->hdr.win32_funcs->SQLDescribeColW( stmt->hdr.win32_handle, col_number, col_name, buf_len,
name_len, data_type, col_size, decimal_digits, nullable );
- if (stmt->hdr.win32_funcs->SQLDescribeCol) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ if (stmt->hdr.win32_funcs->SQLDescribeCol)
+ {
+ SQLCHAR *name = (SQLCHAR*)strdupWtoA( (WCHAR*)col_name );
+
+ ret = stmt->hdr.win32_funcs->SQLDescribeCol( stmt->hdr.win32_handle, col_number, name, buf_len, name_len,
+ data_type, col_size, decimal_digits, nullable);
+
+ free(name);
+ }
+ return ret;
}
/*************************************************************************
--
2.47.2

View File

@@ -0,0 +1,26 @@
From a559a392ee8ff765c9784e9fe5f05c899e38c76e Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 17:35:38 +1000
Subject: [PATCH] odbc32: SQLGetStmtAttrW add ascii fallback
---
dlls/odbc32/proxyodbc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index c81ab1f39d3..1036e6cfa96 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6709,7 +6709,8 @@ static SQLRETURN get_stmt_attr_win32_w( struct statement *stmt, SQLINTEGER attr,
{
if (stmt->hdr.win32_funcs->SQLGetStmtAttrW)
return stmt->hdr.win32_funcs->SQLGetStmtAttrW( stmt->hdr.win32_handle, attr, value, buflen, retlen );
- if (stmt->hdr.win32_funcs->SQLGetStmtAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
+ if (stmt->hdr.win32_funcs->SQLGetStmtAttr)
+ return stmt->hdr.win32_funcs->SQLGetStmtAttr( stmt->hdr.win32_handle, attr, value, buflen, retlen );
return SQL_ERROR;
}
--
2.47.2

View File

@@ -0,0 +1,31 @@
From cbf28db0610f67e37193b8c7d773614a3f0674db Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 17:51:54 +1000
Subject: [PATCH] odbc32: SQLSetStmtAttrW add ascii fallback
---
dlls/odbc32/proxyodbc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index e8ce1fa944c..d72c6ff4b01 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -8032,7 +8032,13 @@ static SQLRETURN set_stmt_attr_win32_w( struct statement *stmt, SQLINTEGER attr,
{
if (stmt->hdr.win32_funcs->SQLSetStmtAttrW)
return stmt->hdr.win32_funcs->SQLSetStmtAttrW( stmt->hdr.win32_handle, attr, value, len );
- if (stmt->hdr.win32_funcs->SQLSetStmtAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
+ if (stmt->hdr.win32_funcs->SQLSetStmtAttr)
+ {
+ SQLRETURN ret = stmt->hdr.win32_funcs->SQLSetStmtAttr( stmt->hdr.win32_handle, attr, value, len );
+ if (ret == SQL_ERROR)
+ FIXME( "Unicode to ANSI conversion not handled (%d)\n", attr );
+ return ret;
+ }
else if (stmt->hdr.win32_funcs->SQLSetStmtOption)
{
/* ODBC v2.0 */
--
2.47.2

View File

@@ -0,0 +1,76 @@
From 74f21e527480e68e05913e5fa09fb5fa9d042e04 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 26 Apr 2025 19:18:17 +1000
Subject: [PATCH] odbc32: Various ascii fallback
Needs spliting.
---
dlls/odbc32/proxyodbc.c | 40 +++++++++++++++++++++++++++++++++++-----
1 file changed, 35 insertions(+), 5 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 81f5cb9a799..e965a86bf15 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6411,7 +6411,13 @@ static SQLRETURN get_connect_attr_win32_w( struct connection *con, SQLINTEGER at
{
if (con->hdr.win32_funcs->SQLGetConnectAttrW)
return con->hdr.win32_funcs->SQLGetConnectAttrW( con->hdr.win32_handle, attr, value, buflen, retlen );
- if (con->hdr.win32_funcs->SQLGetConnectAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
+ if (con->hdr.win32_funcs->SQLGetConnectAttr)
+ {
+ SQLRETURN ret = con->hdr.win32_funcs->SQLGetConnectAttr( con->hdr.win32_handle, attr, value, buflen, retlen );
+ if (ret == SQL_ERROR)
+ FIXME( "Unicode to ANSI conversion not handled\n" );
+ return ret;
+ }
return SQL_ERROR;
}
@@ -6577,7 +6583,12 @@ static SQLRETURN get_diag_field_win32_w( SQLSMALLINT type, struct object *obj, S
if (obj->win32_funcs->SQLGetDiagFieldW)
return obj->win32_funcs->SQLGetDiagFieldW( type, obj->win32_handle, rec_num, diag_id, diag_info, buflen,
retlen );
- if (obj->win32_funcs->SQLGetDiagField) FIXME( "Unicode to ANSI conversion not handled\n" );
+ if (obj->win32_funcs->SQLGetDiagField)
+ {
+ FIXME( "Unicode to ANSI conversion not handled\n" );
+ return obj->win32_funcs->SQLGetDiagField( type, obj->win32_handle, rec_num, diag_id, diag_info, buflen,
+ retlen );
+ }
return SQL_ERROR;
}
@@ -6780,7 +6791,13 @@ static SQLRETURN set_connect_attr_win32_w( struct connection *con, SQLINTEGER at
{
if (con->hdr.win32_funcs->SQLSetConnectAttrW)
return con->hdr.win32_funcs->SQLSetConnectAttrW( con->hdr.win32_handle, attr, value, len );
- if (con->hdr.win32_funcs->SQLSetConnectAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
+ if (con->hdr.win32_funcs->SQLSetConnectAttr)
+ {
+ SQLRETURN ret = con->hdr.win32_funcs->SQLSetConnectAttr( con->hdr.win32_handle, attr, value, len );
+ if (ret == SQL_ERROR)
+ FIXME( "Unicode to ANSI conversion not handled\n" );
+ return ret;
+ }
else if(con->hdr.win32_funcs->SQLSetConnectOptionW)
{
/* ODBC v2 */
@@ -7978,7 +8002,13 @@ static SQLRETURN set_desc_field_win32_w( struct descriptor *desc, SQLSMALLINT re
{
if (desc->hdr.win32_funcs->SQLSetDescFieldW)
return desc->hdr.win32_funcs->SQLSetDescFieldW( desc->hdr.win32_handle, record, id, value, len );
- if (desc->hdr.win32_funcs->SQLSetDescField) FIXME( "Unicode to ANSI conversion not handled\n" );
+ if (desc->hdr.win32_funcs->SQLSetDescField)
+ {
+ SQLRETURN ret = desc->hdr.win32_funcs->SQLSetDescField( desc->hdr.win32_handle, record, id, value, len );
+ if (ret == SQL_ERROR)
+ FIXME( "Unicode to ANSI conversion not handled (%d)\n", id );
+ return ret;
+ }
return SQL_ERROR;
}
--
2.47.2

View File

@@ -0,0 +1,83 @@
From 085539732d3dcd3aadfda4fc022de8f33be1e509 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Mon, 28 Apr 2025 10:54:55 +1000
Subject: [PATCH] odbc32: SQLColAttributesW support ascii fallback
---
dlls/odbc32/proxyodbc.c | 42 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 39 insertions(+), 3 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 31083792f8f..b490da9012f 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -4636,6 +4636,10 @@ static SQLRETURN col_attributes_unix_a( struct statement *stmt, SQLUSMALLINT col
return ret;
}
+static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col, SQLUSMALLINT field_id,
+ SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen,
+ SQLLEN *num_attr );
+
static SQLRETURN col_attributes_win32_a( struct statement *stmt, SQLUSMALLINT col, SQLUSMALLINT field_id,
SQLPOINTER char_attrs, SQLSMALLINT buflen, SQLSMALLINT *retlen,
SQLLEN *num_attrs )
@@ -5839,11 +5843,17 @@ static SQLRETURN col_attributes_win32_w( struct statement *stmt, SQLUSMALLINT co
SQLPOINTER char_attrs, SQLSMALLINT buflen, SQLSMALLINT *retlen,
SQLLEN *num_attrs )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLColAttributesW)
return stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attrs, buflen,
retlen, num_attrs );
if (stmt->hdr.win32_funcs->SQLColAttributes) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ else
+ {
+ ret = col_attribute_win32_w( stmt, col, field_id, char_attrs, buflen, retlen, num_attrs );
+ }
+ return ret;
}
/*************************************************************************
@@ -6295,8 +6305,34 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
if (stmt->hdr.win32_funcs->SQLColAttribute)
{
- FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ SQLCHAR *strA = char_attr;
+
+ if (char_attr && buflen && SQLColAttributes_KnownStringAttribute(field_id))
+ {
+ strA = malloc( buflen );
+ }
+
+ ret = stmt->hdr.win32_funcs->SQLColAttribute( stmt->hdr.win32_handle, col, field_id, strA, buflen,
+ retlen, num_attr );
+ if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(field_id))
+ {
+ if (strA)
+ {
+ WCHAR *p = strnAtoW(strA, -1);
+ wcscpy(char_attr, p);
+ free(p);
+
+ if (retlen)
+ *retlen = wcslen( char_attr ) * sizeof(WCHAR);
+ }
+ else if (retlen)
+ *retlen = *retlen * sizeof(WCHAR);
+ }
+
+ if (strA != char_attr)
+ free(strA);
+
+ return ret;
}
if (stmt->hdr.win32_funcs->SQLColAttributesW)
--
2.47.2

View File

@@ -0,0 +1,70 @@
From 9b10e9df425671cbf0811f436ccfd83e048b5cc9 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 29 Apr 2025 13:08:38 +1000
Subject: [PATCH] odbc32: SQLColAttributeW - Add ascii fallback
---
dlls/odbc32/proxyodbc.c | 39 +++++++++++++++++++++++++++++++++++++--
1 file changed, 37 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index b490da9012f..b17f8a46e0e 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6335,7 +6335,7 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
return ret;
}
- if (stmt->hdr.win32_funcs->SQLColAttributesW)
+ if (stmt->hdr.win32_funcs->SQLColAttributesW || stmt->hdr.win32_funcs->SQLColAttributes)
{
if (buflen < 0) return SQL_ERROR;
if (!col)
@@ -6383,8 +6383,43 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
FIXME( "field id %u not handled\n", field_id );
}
- ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
+ if (stmt->hdr.win32_funcs->SQLColAttributes)
+ {
+ SQLCHAR *strA = char_attr;
+
+ if (char_attr && buflen && SQLColAttributes_KnownStringAttribute(field_id))
+ {
+ strA = malloc( buflen );
+ }
+
+ ret = stmt->hdr.win32_funcs->SQLColAttributes( stmt->hdr.win32_handle, col, field_id, strA, buflen,
+ retlen, num_attr );
+
+ if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(field_id) )
+ {
+ if (strA)
+ {
+ WCHAR *p = strnAtoW(strA, -1);
+ wcscpy(char_attr, p);
+ free(p);
+
+ if (retlen)
+ *retlen = wcslen( char_attr ) * sizeof(WCHAR);
+ }
+ else if (retlen)
+ *retlen = *retlen * sizeof(WCHAR);
+ }
+
+ if (strA != char_attr)
+ free(strA);
+
+ }
+ else
+ {
+ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
+ }
+
/* Convert back for ODBC2 drivers */
env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
if (SQL_SUCCEEDED(ret) && num_attr && field_id == SQL_COLUMN_TYPE &&
--
2.47.2

View File

@@ -0,0 +1,56 @@
From 2b03235b360575563a2ffee961c9447699edce0d Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 1 May 2025 07:32:58 +1000
Subject: [PATCH] SQLGetDiagRecW: Add ascii fallback
---
dlls/odbc32/proxyodbc.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index b607c361416..377124653c1 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6716,8 +6716,9 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT type, struct object *obj, SQL
return SQL_ERROR;
}
- if (obj->win32_funcs->SQLErrorW)
+ if (obj->win32_funcs->SQLErrorW || obj->win32_funcs->SQLError)
{
+ SQLRETURN ret = SQL_ERROR;
SQLHENV env = NULL;
SQLHDBC con = NULL;
SQLHSTMT stmt = NULL;
@@ -6742,7 +6743,27 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT type, struct object *obj, SQL
return SQL_ERROR;
}
- return obj->win32_funcs->SQLErrorW( env, con, stmt, state, native_err, msg, buflen, retlen );
+ if (obj->win32_funcs->SQLErrorW)
+ ret = obj->win32_funcs->SQLErrorW( env, con, stmt, state, native_err, msg, buflen, retlen );
+ else if (obj->win32_funcs->SQLError)
+ {
+ SQLCHAR stateA[6], *msgA = NULL;
+ SQLSMALLINT lenA;
+
+ if (!(msgA = malloc( buflen ))) return SQL_ERROR;
+ ret = obj->win32_funcs->SQLError( env, con, stmt, stateA, native_err, msgA, buflen, &lenA );
+ if (SUCCESS( ret ))
+ {
+ WCHAR *p = strnAtoW(msgA, lenA);
+ wcscpy(msg, p);
+ free(p);
+
+ MultiByteToWideChar( CP_ACP, 0, (const char *)stateA, 6, state, 12 );
+ }
+ free( msgA );
+
+ }
+ return ret;
}
return SQL_ERROR;
--
2.47.2

View File

@@ -0,0 +1,52 @@
From 7f895746aa93f74933dab0f2e115c4feb2d57556 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 1 May 2025 08:05:31 +1000
Subject: [PATCH] odbc32: SQLNativeSqlW add ascii fallback
---
dlls/odbc32/proxyodbc.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index ca2f94cb250..799ea5accf2 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -7819,11 +7819,33 @@ static SQLRETURN native_sql_unix_w( struct connection *con, SQLWCHAR *in_stateme
static SQLRETURN native_sql_win32_w( struct connection *con, SQLWCHAR *in_statement, SQLINTEGER len,
SQLWCHAR *out_statement, SQLINTEGER buflen, SQLINTEGER *retlen )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (con->hdr.win32_funcs->SQLNativeSqlW)
return con->hdr.win32_funcs->SQLNativeSqlW( con->hdr.win32_handle, in_statement, len, out_statement, buflen,
retlen );
- if (con->hdr.win32_funcs->SQLNativeSql) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ if (con->hdr.win32_funcs->SQLNativeSql)
+ {
+ SQLCHAR *statement = (SQLCHAR*)strdupWtoA( (WCHAR*)in_statement );
+ SQLCHAR *out = NULL;
+ if (buflen)
+ out = malloc( buflen );
+
+ ret = con->hdr.win32_funcs->SQLNativeSql( con->hdr.win32_handle, statement, len, out, buflen, retlen );
+ if(ret == SQL_SUCCESS)
+ {
+ if (out_statement)
+ {
+ MultiByteToWideChar( CP_ACP, 0, (const char *)out, len, out_statement, buflen );
+ out_statement[buflen] = 0;
+ }
+ }
+ if (retlen) *retlen *= sizeof(WCHAR);
+
+ free( statement );
+ free( out );
+ }
+ return ret;
}
/*************************************************************************
--
2.47.2

View File

@@ -0,0 +1,36 @@
From fbc17da7bbb48155d2fe1225f159a2b50b7aaf65 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 1 May 2025 08:10:04 +1000
Subject: [PATCH] odbc32: SQLPrepareW add ascii fallback
---
dlls/odbc32/proxyodbc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 799ea5accf2..0fed17640c1 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6199,10 +6199,17 @@ static SQLRETURN prepare_unix_w( struct statement *stmt, SQLWCHAR *statement, SQ
static SQLRETURN prepare_win32_w( struct statement *stmt, SQLWCHAR *statement, SQLINTEGER len )
{
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLPrepareW)
return stmt->hdr.win32_funcs->SQLPrepareW( stmt->hdr.win32_handle, statement, len );
- if (stmt->hdr.win32_funcs->SQLPrepare) FIXME( "Unicode to ANSI conversion not handled\n" );
- return SQL_ERROR;
+ if (stmt->hdr.win32_funcs->SQLPrepare)
+ {
+ SQLCHAR *statementA = (SQLCHAR*)strdupWtoA( statement );
+ ret = stmt->hdr.win32_funcs->SQLPrepare( stmt->hdr.win32_handle, statementA, len );
+ free(statementA);
+ }
+ return ret;
}
/*************************************************************************
--
2.47.2

Some files were not shown because too many files have changed in this diff Show More