From 91d2f6eebffcc8aa492b59c99f429aa41d09e82e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 19 Jul 2007 11:41:17 +0000 Subject: * fhandler.cc (fhandler_base::open): Drop local wpath and upath variables. Call pc.get_object_attr to create object attributes. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. * syscalls.cc (unlink_nt): Ditto. * path.cc (path_conv::set_normalized_path): Set wide_path to NULL. (path_conv::get_nt_native_path): Drop parameter. Create path in wide_path/uni_path members. (path_conv::get_object_attr): New method to create object attributes. (path_conv::get_wide_win32_path): New method to create Win32 wide path. (path_conv::check): Initialize wide_path to NULL. (path_conv::~path_conv): cfree wide_path. * path.h (class path_conv): New members wide_path and uni_path. Add declarations of get_object_attr and get_wide_win32_path. (path_conv::path_conv): Initialize wide_path to NULL. (path_conv::get_nt_native_path): Drop parameter. --- winsup/cygwin/path.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/path.h') diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 272d397b2..6e553be6b 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -156,6 +156,8 @@ class path_conv { DWORD fileattr; fs_info fs; + PWCHAR wide_path; + UNICODE_STRING uni_path; void add_ext_from_sym (symlink_info&); public: @@ -236,7 +238,8 @@ class path_conv const suffix_info *suffixes = NULL) __attribute__ ((regparm(3))); path_conv (const device& in_dev): fileattr (INVALID_FILE_ATTRIBUTES), - path_flags (0), known_suffix (NULL), error (0), dev (in_dev) + wide_path (NULL), path_flags (0), known_suffix (NULL), error (0), + dev (in_dev) { strcpy (path, in_dev.native); } @@ -253,14 +256,18 @@ class path_conv check (src, opt | PC_NULLEMPTY, suffixes); } - path_conv (): fileattr (INVALID_FILE_ATTRIBUTES), path_flags (0), - known_suffix (NULL), error (0), normalized_path (NULL) + path_conv (): fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), + path_flags (0), known_suffix (NULL), error (0), + normalized_path (NULL) {path[0] = '\0';} ~path_conv (); void set_name (const char *win32, const char *posix); inline char *get_win32 () { return path; } - PUNICODE_STRING get_nt_native_path (UNICODE_STRING &upath); + PUNICODE_STRING get_nt_native_path (); + POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &attr, + SECURITY_ATTRIBUTES &sa); + PWCHAR get_wide_win32_path (PWCHAR wc); operator char *() {return path;} operator const char *() {return path;} operator DWORD &() {return fileattr;} -- cgit v1.2.3