Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-04-19 14:02:06 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-04-19 14:02:06 +0400
commitb18cb86be7509b4125732f2b25ff3a6e5f423fa2 (patch)
tree164ae9a4323b29a4e444114b747a1c12558f8889 /winsup/cygwin/registry.h
parentcbc26145e8aeb272ae0df172c1dd84be11b75b81 (diff)
* Makefile.in (DLL_IMPORTS): Drop advapi32.dll.
* autoload.cc: Enable autoloading advapi32 functions. * environ.cc (regopt): Use wide char arguments in reg_key functions. * fhandler_console.cc (beep): Ditto. Use WCHAR throughout. * registry.cc (reg_key): Rewrite reg_key class to use native NT registry functions. Use WCHAR string parameters throughout. Use PCWSTR rather than const WCHAR. Drop multibyte char functionality. Drop unused methods. (get_registry_hive_path): Use RtlQueryRegistryValues to fetch path from registry. (load_registry_hive): Drop useless check for user hive being available. Load hive using NtLoadKey. * registry.h: Accommodate above changes. * sched.cc (sched_rr_get_interval): Use wide char arguments in reg_key functions. * shared.cc (init_installation_root): Ditto. (shared_info::init_obcaseinsensitive): Use RtlQueryRegistryValues to fetch obcaseinsensitive value. (shared_info::heap_slop_size): Use wide char arguments in reg_key functions. (shared_info::heap_chunk_size): Ditto. * syscalls.cc (gethostid): Ditto. * winsup.h (__WIDE): Define. (_WIDE): Define. * libc/minires-os-if.c (get_registry_dns_items): Don't fetch values from registry. Just extract them from given UNICODE_STRING parameter. (get_registry_dns): Fetch all registry values at once using RtlQueryRegistryValues.
Diffstat (limited to 'winsup/cygwin/registry.h')
-rw-r--r--winsup/cygwin/registry.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/winsup/cygwin/registry.h b/winsup/cygwin/registry.h
index 2b0f4657a..640998a3b 100644
--- a/winsup/cygwin/registry.h
+++ b/winsup/cygwin/registry.h
@@ -1,6 +1,7 @@
/* registry.h: shared info for cygwin
- Copyright 2000, 2001, 2004, 2006, 2008 Red Hat, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -12,8 +13,8 @@ class reg_key
{
private:
- HKEY key;
- LONG key_is_invalid;
+ HANDLE key;
+ NTSTATUS key_is_invalid;
DWORD _disposition;
public:
@@ -24,22 +25,13 @@ public:
void *operator new (size_t, void *p) {return p;}
void build_reg (HKEY key, REGSAM access, va_list av);
- int error () {return key == (HKEY) INVALID_HANDLE_VALUE;}
+ int error () {return key == NULL;}
- int kill (const char *child);
- int killvalue (const char *name);
+ int get_int (PCWSTR, int);
+ int get_string (PCWSTR, PWCHAR, size_t, PCWSTR);
- HKEY get_key ();
-
- int get_int (const char *, int);
- int get_int (const WCHAR *, int);
- int get_string (const char *, char *, size_t, const char *);
- int get_string (const WCHAR *, PWCHAR, size_t, const WCHAR *);
-
- int set_int (const char *, int);
- int set_int (const PWCHAR, int);
- int set_string (const char *, const char *);
- int set_string (const PWCHAR, const PWCHAR);
+ int set_int (PCWSTR, int);
+ int set_string (PCWSTR, PCWSTR);
bool created () const {return _disposition & REG_CREATED_NEW_KEY;}
@@ -47,5 +39,5 @@ public:
};
/* Evaluates path to the directory of the local user registry hive */
-PWCHAR __stdcall get_registry_hive_path (const PWCHAR name, PWCHAR path);
-void __stdcall load_registry_hive (const PWCHAR name);
+PWCHAR __stdcall get_registry_hive_path (PCWSTR name, PWCHAR path);
+void __stdcall load_registry_hive (PCWSTR name);