* 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.
This commit is contained in:
@@ -234,8 +234,6 @@ try_to_bin (path_conv &win32_path, HANDLE h)
|
||||
DWORD
|
||||
unlink_nt (path_conv &win32_name, bool setattrs)
|
||||
{
|
||||
WCHAR wpath[CYG_MAX_PATH + 10];
|
||||
UNICODE_STRING upath = {0, sizeof (wpath), wpath};
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
IO_STATUS_BLOCK io;
|
||||
NTSTATUS status;
|
||||
@@ -269,9 +267,7 @@ unlink_nt (path_conv &win32_name, bool setattrs)
|
||||
if (win32_name.is_rep_symlink ())
|
||||
flags |= FILE_OPEN_REPARSE_POINT;
|
||||
|
||||
win32_name.get_nt_native_path (upath);
|
||||
InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
|
||||
NULL, sec_none_nih.lpSecurityDescriptor);
|
||||
win32_name.get_object_attr (attr, sec_none_nih);
|
||||
/* First try to open the file with sharing not allowed. If the file
|
||||
has an open handle on it, this will fail. That indicates that the
|
||||
file has to be moved to the recycle bin so that it actually disappears
|
||||
|
Reference in New Issue
Block a user