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>2008-02-25 21:32:23 +0300
committerCorinna Vinschen <corinna@vinschen.de>2008-02-25 21:32:23 +0300
commit5ab0b5cf529c3f069264b469db4aacbcb95ce760 (patch)
tree0800401dfb684fc09dbafeb0b74319e970bd4fa0 /winsup/cygwin/sec_auth.cc
parentff42f5b1e35d7c605288680b6f7de02d675143b7 (diff)
* dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is
enabled. Replace calls to GetEnvironmentVariable by calls to GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA with NULL buffer. (cygbench): Ditto, drop local buffer. * environ.cc (getearly): Call GetEnvironmentVariableA. (environ_init): Retrieve unicode environment and convert to current codepage locally. (getwinenveq): Ditto. * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling convention. * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve required buffer length. * fork.cc (frok::child): Call GetEnvironmentVariableA. * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs. * sec_auth.cc: Ditto. * strfuncs.cc (sys_wcstombs_alloc): Fix formatting. (sys_mbstowcs): Change arguments to allow specifying a source string length. (sys_mbstowcs_alloc): Ditto. * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in calls to sys_mbstowcs. * winsup.h (sys_mbstowcs): Adjust declaration. (sys_mbstowcs_alloc): Ditto.
Diffstat (limited to 'winsup/cygwin/sec_auth.cc')
-rw-r--r--winsup/cygwin/sec_auth.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
index bd9197db3..72ebcbfdf 100644
--- a/winsup/cygwin/sec_auth.cc
+++ b/winsup/cygwin/sec_auth.cc
@@ -128,7 +128,7 @@ str2buf2uni (UNICODE_STRING &tgt, WCHAR *buf, const char *srcstr)
{
tgt.Buffer = (PWCHAR) buf;
tgt.MaximumLength = (strlen (srcstr) + 1) * sizeof (WCHAR);
- tgt.Length = sys_mbstowcs (buf, srcstr, tgt.MaximumLength / sizeof (WCHAR))
+ tgt.Length = sys_mbstowcs (buf, tgt.MaximumLength / sizeof (WCHAR), srcstr)
* sizeof (WCHAR);
if (tgt.Length)
tgt.Length -= sizeof (WCHAR);
@@ -137,8 +137,9 @@ str2buf2uni (UNICODE_STRING &tgt, WCHAR *buf, const char *srcstr)
void
str2uni_cat (UNICODE_STRING &tgt, const char *srcstr)
{
- int len = sys_mbstowcs (tgt.Buffer + tgt.Length / sizeof (WCHAR), srcstr,
- (tgt.MaximumLength - tgt.Length) / sizeof (WCHAR));
+ int len = sys_mbstowcs (tgt.Buffer + tgt.Length / sizeof (WCHAR),
+ (tgt.MaximumLength - tgt.Length) / sizeof (WCHAR),
+ srcstr);
if (len)
tgt.Length += (len - 1) * sizeof (WCHAR);
else
@@ -186,7 +187,7 @@ get_logon_server (const char *domain, char *server, WCHAR *wserver,
{
server[0] = server[1] = '\\';
if (wserver)
- sys_mbstowcs (wserver, server, INTERNET_MAX_HOST_NAME_LENGTH + 1);
+ sys_mbstowcs (wserver, INTERNET_MAX_HOST_NAME_LENGTH + 1, server);
return true;
}
@@ -196,7 +197,7 @@ get_logon_server (const char *domain, char *server, WCHAR *wserver,
if (dret == ERROR_SUCCESS)
{
strcpy (server, pci->DomainControllerName);
- sys_mbstowcs (wserver, server, INTERNET_MAX_HOST_NAME_LENGTH + 1);
+ sys_mbstowcs (wserver, INTERNET_MAX_HOST_NAME_LENGTH + 1, server);
NetApiBufferFree (pci);
debug_printf ("DC: rediscovery: %d, server: %s", rediscovery, server);
return true;
@@ -204,7 +205,7 @@ get_logon_server (const char *domain, char *server, WCHAR *wserver,
else if (dret == ERROR_PROC_NOT_FOUND)
{
/* NT4 w/o DSClient */
- sys_mbstowcs (wdomain, domain, INTERNET_MAX_HOST_NAME_LENGTH + 1);
+ sys_mbstowcs (wdomain, INTERNET_MAX_HOST_NAME_LENGTH + 1, domain);
if (rediscovery)
dret = NetGetAnyDCName (NULL, wdomain, (LPBYTE *) &buf);
else
@@ -230,7 +231,7 @@ get_user_groups (WCHAR *wlogonserver, cygsidlist &grp_list, char *user,
{
char dgroup[INTERNET_MAX_HOST_NAME_LENGTH + GNLEN + 2];
WCHAR wuser[UNLEN + 1];
- sys_mbstowcs (wuser, user, UNLEN + 1);
+ sys_mbstowcs (wuser, UNLEN + 1, user);
LPGROUP_USERS_INFO_0 buf;
DWORD cnt, tot, len;
NET_API_STATUS ret;