diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-04-19 10:02:06 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-04-19 10:02:06 +0000 |
commit | b18cb86be7509b4125732f2b25ff3a6e5f423fa2 (patch) | |
tree | 164ae9a4323b29a4e444114b747a1c12558f8889 /winsup/cygwin/syscalls.cc | |
parent | cbc26145e8aeb272ae0df172c1dd84be11b75b81 (diff) | |
download | cygnal-b18cb86be7509b4125732f2b25ff3a6e5f423fa2.tar.gz cygnal-b18cb86be7509b4125732f2b25ff3a6e5f423fa2.tar.bz2 cygnal-b18cb86be7509b4125732f2b25ff3a6e5f423fa2.zip |
* 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/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index a11142b2d..c05c58798 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -3682,8 +3682,8 @@ updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) updwtmp (wtmpx_file, (const struct utmp *) utmpx); } -extern "C" -long gethostid (void) +extern "C" long +gethostid (void) { unsigned data[13] = {0x92895012, 0x10293412, @@ -3766,9 +3766,11 @@ long gethostid (void) else debug_printf ("no Ethernet card installed"); - reg_key key (HKEY_LOCAL_MACHINE, KEY_READ, "SOFTWARE", "Microsoft", - "Windows NT", "CurrentVersion", NULL); - key.get_string ("ProductId", (char *)&data[6], 24, "00000-000-0000000-00000"); + WCHAR wdata[24]; + reg_key key (HKEY_LOCAL_MACHINE, KEY_READ, L"SOFTWARE", L"Microsoft", + L"Windows NT", L"CurrentVersion", NULL); + key.get_string (L"ProductId", wdata, 24, L"00000-000-0000000-00000"); + sys_wcstombs ((char *)&data[6], 24, wdata, 24); debug_printf ("Windows Product ID: %s", (char *)&data[6]); GetDiskFreeSpaceEx ("C:\\", NULL, (PULARGE_INTEGER) &data[11], NULL); |