pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: 2janbrezina@gmail.com
Subject: BUG #18219: libpq does not take into consideration UNICODE define
Date: Thu, 30 Nov 2023 15:23:23 +0000
Message-ID: <18219-e052656ac68bab94@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18219
Logged by:          Jan Březina
Email address:      2janbrezina@gmail.com
PostgreSQL version: 16.0
Operating system:   Windows
Description:        

I use libpqxx via vcpkg in Windows project build for x64 system using Visual
Studio. There is a UNICODE define, which causes **W Windows functions to be
used and hence string parameters should be passed in using L"...".
I have sslrootcert file used in my connection string. During the connection
initialization stat() function is invoked for the file. It is implemented in
win32stat.c, which then invokes pgwin32_open_handle() (open.c) and then
initialize_ntdll() (win32ntdll.c) is invoked. There is a use of
LoadLibraryEx which is just a define above LoadLibraryExA or LoadLibraryExW.
Using UNICODE implies LoadLibraryExW to be used, but the parameter passed in
is char*, not wchar_t*. This leads to failed initialization returning error
code 126 - The specified module could not be found.
There should be a switch if UNICODE is defined, then L"ntdll.dll" should be
passed in. The same applies to all other Windows functions consuming
strings.



view thread (12+ messages)  latest in thread

Message-ID: <18219-e052656ac68bab94@postgresql.org>
Permalink:  ../18219-e052656ac68bab94@postgresql.org/
Also on:    postgresql.org/message-id/18219-e052656ac68bab94@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, 2janbrezina@gmail.com
  Subject: Re: BUG #18219: libpq does not take into consideration UNICODE define
  In-Reply-To: <18219-e052656ac68bab94@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox