* 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.
This commit is contained in:
parent
b18cb86be7
commit
ba6aad1d73
@ -1,3 +1,14 @@
|
|||||||
|
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>
|
2011-04-19 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* Makefile.in (DLL_IMPORTS): Drop advapi32.dll.
|
* Makefile.in (DLL_IMPORTS): Drop advapi32.dll.
|
||||||
|
@ -391,9 +391,7 @@ LoadDLLfunc (GetNetworkParams, 8, iphlpapi)
|
|||||||
LoadDLLfunc (GetUdpTable, 12, iphlpapi)
|
LoadDLLfunc (GetUdpTable, 12, iphlpapi)
|
||||||
|
|
||||||
LoadDLLfuncEx (AttachConsole, 4, kernel32, 1)
|
LoadDLLfuncEx (AttachConsole, 4, kernel32, 1)
|
||||||
LoadDLLfunc (GetConsoleWindow, 0, kernel32)
|
|
||||||
LoadDLLfuncEx (GetNamedPipeClientProcessId, 8, kernel32, 1)
|
LoadDLLfuncEx (GetNamedPipeClientProcessId, 8, kernel32, 1)
|
||||||
LoadDLLfuncEx (GetSystemWindowsDirectoryW, 8, kernel32, 1)
|
|
||||||
LoadDLLfunc (LocaleNameToLCID, 8, kernel32)
|
LoadDLLfunc (LocaleNameToLCID, 8, kernel32)
|
||||||
|
|
||||||
LoadDLLfunc (WNetCloseEnum, 4, mpr)
|
LoadDLLfunc (WNetCloseEnum, 4, mpr)
|
||||||
|
@ -67,9 +67,9 @@ beep ()
|
|||||||
if (r.created ())
|
if (r.created ())
|
||||||
{
|
{
|
||||||
PWCHAR buf = NULL;
|
PWCHAR buf = NULL;
|
||||||
UINT len = GetWindowsDirectoryW (buf, 0) * sizeof (WCHAR);
|
UINT len = GetSystemWindowsDirectoryW (buf, 0) * sizeof (WCHAR);
|
||||||
buf = (PWCHAR) alloca (len += sizeof (ding));
|
buf = (PWCHAR) alloca (len += sizeof (ding));
|
||||||
UINT res = GetWindowsDirectoryW (buf, len);
|
UINT res = GetSystemWindowsDirectoryW (buf, len);
|
||||||
if (res && res <= len)
|
if (res && res <= len)
|
||||||
r.set_string (L"", wcscat (buf, ding));
|
r.set_string (L"", wcscat (buf, ding));
|
||||||
}
|
}
|
||||||
|
@ -454,19 +454,16 @@ cygheap_user::env_systemroot (const char *name, size_t namelen)
|
|||||||
{
|
{
|
||||||
if (!psystemroot)
|
if (!psystemroot)
|
||||||
{
|
{
|
||||||
int size = GetWindowsDirectory (NULL, 0);
|
int size = GetSystemWindowsDirectoryW (NULL, 0);
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
psystemroot = (char *) cmalloc_abort (HEAP_STR, ++size);
|
WCHAR wsystemroot[size];
|
||||||
size = GetWindowsDirectory (psystemroot, size);
|
size = GetSystemWindowsDirectoryW (wsystemroot, size);
|
||||||
if (size <= 0)
|
if (size > 0)
|
||||||
{
|
sys_wcstombs_alloc (&psystemroot, HEAP_STR, wsystemroot);
|
||||||
cfree (psystemroot);
|
|
||||||
psystemroot = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
debug_printf ("GetWindowsDirectory(), %E");
|
debug_printf ("GetSystemWindowsDirectoryW(), %E");
|
||||||
}
|
}
|
||||||
return psystemroot;
|
return psystemroot;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,9 @@ details. */
|
|||||||
/* When Terminal Services are installed, the GetWindowsDirectory function
|
/* When Terminal Services are installed, the GetWindowsDirectory function
|
||||||
does not return the system installation dir, but a user specific directory
|
does not return the system installation dir, but a user specific directory
|
||||||
instead. That's not what we have in mind when calling GetWindowsDirectory
|
instead. That's not what we have in mind when calling GetWindowsDirectory
|
||||||
from within Cygwin. So we redefine GetWindowsDirectory to call the
|
from within Cygwin. So we redefine GetWindowsDirectory to something
|
||||||
GetSystemWindowsDirectory function here. */
|
invalid here to avoid that it's called accidentally in Cygwin. Don't
|
||||||
#define GetWindowsDirectoryW GetSystemWindowsDirectoryW
|
use this function. Use GetSystemWindowsDirectoryW. */
|
||||||
#define GetWindowsDirectoryA GetSystemWindowsDirectoryA
|
#define GetWindowsDirectoryW dont_use_GetWindowsDirectory
|
||||||
|
#define GetWindowsDirectoryA dont_use_GetWindowsDirectory
|
||||||
#endif /*_WINLEAN_H*/
|
#endif /*_WINLEAN_H*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user