From: "nobu (Nobuyoshi Nakada)" Date: 2022-08-27T14:16:42+00:00 Subject: [ruby-core:109736] [Ruby master Bug#10820] Win32 Registry Delete uses ANSI instead of Wide APIs Issue #10820 has been updated by nobu (Nobuyoshi Nakada). headius (Charles Nutter) wrote in #note-10: > Late to the party, but why was `RegQueryInfoKey` also update to use `W`? It seems unneeded because not using any `WCHAR` arguments. > I am working on https://github.com/jruby/jruby/issues/7106 and cannot figure out how CRuby manages to locate `RegQueryInfoKey` when only the `A` and `W` versions should exist in the actual DLLs. It's done by fiddle. https://github.com/ruby/fiddle/blob/master/ext/fiddle/handle.c#L342-L380 ---------------------------------------- Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs https://bugs.ruby-lang.org/issues/10820#change-98971 * Author: ferventcoder (Rob Reynolds) * Status: Closed * Priority: Normal * Assignee: cruby-windows * ruby -v: 2.1.5 * Backport: 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE ---------------------------------------- https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L236-L237 Contains: ~~~ruby module API include Constants extend Importer dlload "advapi32.dll" [ "long RegOpenKeyExW(void *, void *, long, long, void *)", "long RegCreateKeyExW(void *, void *, long, long, long, long, void *, void *, void *)", "long RegEnumValueW(void *, long, void *, void *, void *, void *, void *, void *)", "long RegEnumKeyExW(void *, long, void *, void *, void *, void *, void *, void *)", "long RegQueryValueExW(void *, void *, void *, void *, void *, void *)", "long RegSetValueExW(void *, void *, long, long, void *, long)", "long RegDeleteValue(void *, void *)", "long RegDeleteKey(void *, void *)", "long RegFlushKey(void *)", "long RegCloseKey(void *)", "long RegQueryInfoKey(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *)", ].each do |fn| cfunc = extern fn, :stdcall const_set cfunc.name.intern, cfunc end ~~~ Should use `RegDeleteValueW` and `RegDeleteKeyW`. -- https://bugs.ruby-lang.org/ Unsubscribe: