[ruby-core:67958] [ruby-trunk - Bug #10820] [Open] Win32 Registry Delete uses ANSI instead of Wide APIs

1 view
Skip to first unread message

ferven...@gmail.com

unread,
Feb 2, 2015, 6:11:43 PM2/2/15
to ruby...@ruby-lang.org
Issue #10820 has been reported by Rob Reynolds.

----------------------------------------
Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs
https://bugs.ruby-lang.org/issues/10820

* Author: Rob Reynolds
* Status: Open
* Priority: Normal
* Assignee: Usaku NAKAMURA
* ruby -v: 2.1.5
* Backport: 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L236-L237

Contains:
~~~
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/

ferven...@gmail.com

unread,
Feb 2, 2015, 6:13:06 PM2/2/15
to ruby...@ruby-lang.org
Issue #10820 has been updated by Rob Reynolds.


Apparently markdown didn't work so well, but hopefully the gist of the issue is captured here.

----------------------------------------
Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs
https://bugs.ruby-lang.org/issues/10820#change-51344

ferven...@gmail.com

unread,
Feb 2, 2015, 6:27:10 PM2/2/15
to ruby...@ruby-lang.org
Issue #10820 has been updated by Rob Reynolds.


For the issue, without this fix, it is likely not to find registry keys/values that have unicode in them. This is what we were seeing.

----------------------------------------
Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs
https://bugs.ruby-lang.org/issues/10820#change-51345

ferven...@gmail.com

unread,
Feb 2, 2015, 6:48:00 PM2/2/15
to ruby...@ruby-lang.org
Issue #10820 has been updated by Rob Reynolds.


Looks like you may want to explore the same for `RegQueryInfoKey` as well. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms724902.aspx

----------------------------------------
Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs
https://bugs.ruby-lang.org/issues/10820#change-51346

no...@ruby-lang.org

unread,
Feb 7, 2015, 10:33:01 PM2/7/15
to ruby...@ruby-lang.org
Issue #10820 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Assigned
Assignee changed from Usaku NAKAMURA to cruby-windows
Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED

----------------------------------------
Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs
https://bugs.ruby-lang.org/issues/10820#change-51450

* Author: Rob Reynolds
* Status: Assigned
* Priority: Normal
* Assignee: cruby-windows
* ruby -v: 2.1.5
* Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L236-L237

Contains:

~~~ruby

nar...@airemix.jp

unread,
Feb 17, 2015, 1:39:34 AM2/17/15
to ruby...@ruby-lang.org
Issue #10820 has been updated by Yui NARUSE.

Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: DONE

ruby_2_2 r49622 merged revision(s) 49542.

----------------------------------------
Bug #10820: Win32 Registry Delete uses ANSI instead of Wide APIs
https://bugs.ruby-lang.org/issues/10820#change-51523

* Author: Rob Reynolds
* Status: Closed
* Priority: Normal
* Assignee: cruby-windows
* ruby -v: 2.1.5
* Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: DONE
Reply all
Reply to author
Forward
0 new messages