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:15:09 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-04-19 14:15:09 +0400
commitba6aad1d735126cd0e0e9c114ba3389a78779008 (patch)
treec239126e34020cf0bac1a0d1f76596ee8bca1dcf
parentb18cb86be7509b4125732f2b25ff3a6e5f423fa2 (diff)
* autoload.cc (GetConsoleWindow): Drop.
(GetSystemWindowsDirectoryW): Drop. * fhandler_console.cc (beep): Call GetSystemWindowsDirectoryW instead of GetWindowsDirectoryW. * uinfo.cc (cygheap_user::env_systemroot): Call GetSystemWindowsDirectoryW and convert to multibyte on the fly. * winlean.h (GetWindowsDirectoryW): Redefine to something invalid. Explain why.
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/autoload.cc2
-rw-r--r--winsup/cygwin/fhandler_console.cc4
-rw-r--r--winsup/cygwin/uinfo.cc15
-rw-r--r--winsup/cygwin/winlean.h9
5 files changed, 24 insertions, 17 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 95d7b5267..a97051ad1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,16 @@
2011-04-19 Corinna Vinschen <corinna@vinschen.de>
+ * autoload.cc (GetConsoleWindow): Drop.
+ (GetSystemWindowsDirectoryW): Drop.
+ * fhandler_console.cc (beep): Call GetSystemWindowsDirectoryW instead of
+ GetWindowsDirectoryW.
+ * uinfo.cc (cygheap_user::env_systemroot): Call
+ GetSystemWindowsDirectoryW and convert to multibyte on the fly.
+ * winlean.h (GetWindowsDirectoryW): Redefine to something invalid.
+ Explain why.
+
+2011-04-19 Corinna Vinschen <corinna@vinschen.de>
+
* Makefile.in (DLL_IMPORTS): Drop advapi32.dll.
* autoload.cc: Enable autoloading advapi32 functions.
* environ.cc (regopt): Use wide char arguments in reg_key functions.
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 55d1c46c4..a469663c3 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -391,9 +391,7 @@ LoadDLLfunc (GetNetworkParams, 8, iphlpapi)
LoadDLLfunc (GetUdpTable, 12, iphlpapi)
LoadDLLfuncEx (AttachConsole, 4, kernel32, 1)
-LoadDLLfunc (GetConsoleWindow, 0, kernel32)
LoadDLLfuncEx (GetNamedPipeClientProcessId, 8, kernel32, 1)
-LoadDLLfuncEx (GetSystemWindowsDirectoryW, 8, kernel32, 1)
LoadDLLfunc (LocaleNameToLCID, 8, kernel32)
LoadDLLfunc (WNetCloseEnum, 4, mpr)
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 8ce82e481..456336c65 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -67,9 +67,9 @@ beep ()
if (r.created ())
{
PWCHAR buf = NULL;
- UINT len = GetWindowsDirectoryW (buf, 0) * sizeof (WCHAR);
+ UINT len = GetSystemWindowsDirectoryW (buf, 0) * sizeof (WCHAR);
buf = (PWCHAR) alloca (len += sizeof (ding));
- UINT res = GetWindowsDirectoryW (buf, len);
+ UINT res = GetSystemWindowsDirectoryW (buf, len);
if (res && res <= len)
r.set_string (L"", wcscat (buf, ding));
}
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 25c868ce4..46d4b15a6 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -454,19 +454,16 @@ cygheap_user::env_systemroot (const char *name, size_t namelen)
{
if (!psystemroot)
{
- int size = GetWindowsDirectory (NULL, 0);
+ int size = GetSystemWindowsDirectoryW (NULL, 0);
if (size > 0)
{
- psystemroot = (char *) cmalloc_abort (HEAP_STR, ++size);
- size = GetWindowsDirectory (psystemroot, size);
- if (size <= 0)
- {
- cfree (psystemroot);
- psystemroot = NULL;
- }
+ WCHAR wsystemroot[size];
+ size = GetSystemWindowsDirectoryW (wsystemroot, size);
+ if (size > 0)
+ sys_wcstombs_alloc (&psystemroot, HEAP_STR, wsystemroot);
}
if (size <= 0)
- debug_printf ("GetWindowsDirectory(), %E");
+ debug_printf ("GetSystemWindowsDirectoryW(), %E");
}
return psystemroot;
}
diff --git a/winsup/cygwin/winlean.h b/winsup/cygwin/winlean.h
index c4955aec4..d2d7f7a56 100644
--- a/winsup/cygwin/winlean.h
+++ b/winsup/cygwin/winlean.h
@@ -30,8 +30,9 @@ details. */
/* When Terminal Services are installed, the GetWindowsDirectory function
does not return the system installation dir, but a user specific directory
instead. That's not what we have in mind when calling GetWindowsDirectory
- from within Cygwin. So we redefine GetWindowsDirectory to call the
- GetSystemWindowsDirectory function here. */
-#define GetWindowsDirectoryW GetSystemWindowsDirectoryW
-#define GetWindowsDirectoryA GetSystemWindowsDirectoryA
+ from within Cygwin. So we redefine GetWindowsDirectory to something
+ invalid here to avoid that it's called accidentally in Cygwin. Don't
+ use this function. Use GetSystemWindowsDirectoryW. */
+#define GetWindowsDirectoryW dont_use_GetWindowsDirectory
+#define GetWindowsDirectoryA dont_use_GetWindowsDirectory
#endif /*_WINLEAN_H*/