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:
authorChristopher Faylor <me@cgf.cx>2002-06-28 00:44:27 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-28 00:44:27 +0400
commit179cae11d7cf4415e1edb906d90105b2921f666d (patch)
treecd9f7f4c43586086755f4661fd8d21568509cf11 /winsup/cygwin/cygheap.h
parent54be629f41ad4c5e46a736cf988535a794c664bd (diff)
* cygheap.cc (cfree_and_set): New function.
(cygheap_user::set_name): Use cfree_and_set to reset members. * cygheap.h (cygheap_user): Delete static members. (cygheap_user::puserprof): New member. (cfree_and_set): Declare. * dcrt0.cc (almost_null): Define. * winsup.h (almost_null): Declare. * syscalls.cc (cfree_and_set): Remove unused variable. * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate. (cygheap_user::homedrive_env_buf): Ditto. (cygheap_user::userprofile_env_buf): Ditto. (cygheap_user::ontherange): YA change to try to preserve existing HOMEPATH and HOMEDRIVE. Return almost_null values when variables should not actually exist. (cygheap_user::env_logsrv): Ditto. (cygheap_user::env_domain): Ditto. (cygheap_user::env_userprofile): Ditto.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r--winsup/cygwin/cygheap.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index ff598e548..e2fcaec31 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -104,15 +104,9 @@ class cygheap_user
char *homedrive; /* User's home drive */
char *homepath; /* User's home path */
char *winname; /* User's name as far as Windows knows it */
+ char *puserprof; /* User profile */
PSID psid; /* buffer for user's SID */
PSID orig_psid; /* Remains intact even after impersonation */
- static char homedrive_env_buf[3]; /* Where the HOMEDRIVE environment variable
- info may live. */
- static char homepath_env_buf[MAX_PATH + 1]; /* Where the HOMEPATH environment
- variable info may live. */
- static char userprofile_env_buf[MAX_PATH + 1]; /* Where the USERPROFILE
- environment variable info
- may live. */
public:
__uid32_t orig_uid; /* Remains intact even after impersonation */
__gid32_t orig_gid; /* Ditto */
@@ -124,9 +118,17 @@ public:
HANDLE token;
BOOL impersonated;
+ /* CGF 2002-06-27. I removed the initializaton from this constructor
+ since this class is always allocated statically. That means that everything
+ is zero anyway so there is no need to initialize it to zero. Since the
+ token initialization is always handled during process startup as well,
+ I've removed the constructor entirely. Please reinstate this f this
+ situation ever changes.
cygheap_user () : pname (NULL), plogsrv (NULL), pdomain (NULL),
- homedrive (NULL), homepath (NULL),
- psid (NULL), token (INVALID_HANDLE_VALUE) {}
+ homedrive (NULL), homepath (NULL), psid (NULL),
+ token (INVALID_HANDLE_VALUE) {}
+ */
+
~cygheap_user ();
void set_name (const char *new_name);
@@ -289,5 +291,6 @@ void *__stdcall crealloc (void *, DWORD) __attribute__ ((regparm(2)));
void *__stdcall ccalloc (cygheap_types, DWORD, DWORD) __attribute__ ((regparm(3)));
char *__stdcall cstrdup (const char *) __attribute__ ((regparm(1)));
char *__stdcall cstrdup1 (const char *) __attribute__ ((regparm(1)));
+void __stdcall cfree_and_set (char *&, char * = NULL) __attribute__ ((regparm(2)));
void __stdcall cygheap_init ();
}