diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-08-13 15:51:54 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-08-13 15:51:54 +0400 |
commit | 260b80740ecf07b137aa6a6711d5d56fdd861d44 (patch) | |
tree | ebc4757df509e38389108be727986091ded76215 /winsup/cygwin/cygheap.h | |
parent | 7aba919b5e74ad0c67a453f8d7ebb4356222a9d5 (diff) |
* cygheap.h (class cwdstuff): Make drive_length private.
Add "error" member.
(cwdstuff::get_error): New inline method.
(cwdstuff::get_error_desc): Declare.
(cwdstuff::set): Change first parameter to pointer to path_conv.
* path.cc (chdir): Drop doit. Align call to cwdstuff::set to
new arguments.
(cwdstuff::init): Only call cwdstuff::set if it's not already
initialized. Add comment. Drop third parameter in call to
cwdstuff::set.
(cwdstuff::set): Partially rewrite. Add lots of comments to explain
everything. Drop "doit" since it's not used anymore. Always create
new handle to CWD if not in a virtual path. Drop PEB locking when
reading PEB values in init phase. Check for accessibility to set
correct error code. Drop Vista workaround. Never write back into PEB.
Set Win32 CWD to \\?\PIPE\ on init. Simplify creation of win32 path.
Set new error member to a meaningful value.
(cwdstuff::get_error_desc): New method to generate error message
from cwd error code.
* spawn.cc (spawn_guts): Call cwdstuff::get_error_desc to create
more meaningful error message when not being able to start native
Win32 app due to CWD restrictions. When starting native Win32 app,
lock cwd and use in calls to CreateProcessW/CreateProcessAsUserW.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r-- | winsup/cygwin/cygheap.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 34c85997d..46e3c711b 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -211,9 +211,14 @@ class cwdstuff private: char *posix; HANDLE dir; + DWORD drive_length; + int error; /* This contains an errno number which corresponds + to the problem with this path when trying to start + a native Win32 application. See cwdstuff::set for + how it gets set. See spawn_guts for how it's + evaluated. */ public: UNICODE_STRING win32; - DWORD drive_length; static muto cwd_lock; const char *get_posix () const { return posix; }; void reset_posix (wchar_t *); @@ -226,8 +231,10 @@ public: cwd_lock.release (); return ret; } + int get_error () const { return error; } + const char *get_error_desc () const; void init (); - int set (PUNICODE_STRING, const char *, bool); + int set (path_conv *, const char *); }; #ifdef DEBUGGING |