From 78af046e8635b3176299994170f8004a14c78c52 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 8 Jun 2010 13:14:51 +0000 Subject: merge revision(s) 27667: * ext/etc/etc.c (etc_systmpdir): moved from ext/tmpdir. * ext/etc/etc.c (etc_sysconfdir): added. * lib/rubygems/config_file.rb, lib/tmpdir.rb: use etc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'win32') diff --git a/win32/win32.c b/win32/win32.c index 7f46622dd5..c3bd4dcf55 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -68,6 +68,7 @@ static int has_redirection(const char *); int rb_w32_wait_events(HANDLE *events, int num, DWORD timeout); static int rb_w32_open_osfhandle(intptr_t osfhandle, int flags); static int wstati64(const WCHAR *path, struct stati64 *st); +VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc); #define RUBY_CRITICAL(expr) do { expr; } while (0) @@ -466,6 +467,16 @@ get_system_directory(WCHAR *path, UINT len) #define numberof(array) (sizeof(array) / sizeof(*array)) +VALUE +rb_w32_special_folder(int type) +{ + WCHAR path[_MAX_PATH]; + + if (!get_special_folder(type, path)) return Qnil; + regulate_path(path); + return rb_w32_conv_from_wchar(path, rb_filesystem_encoding()); +} + UINT rb_w32_system_tmpdir(WCHAR *path, UINT len) { -- cgit v1.2.3