Throughout avoid having to initialize constant UNICODE_STRINGs.

* globals.cc: Define constant UNICODE_STRINGs and store in .rdata
	section.
	* fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs
	rather then initializing local UNICODE_STRING variable where
	applicable.
	* fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
	* flock.cc (inode_t::inode_t): Ditto.
	* mmap.cc: Ditto.
	* syscalls.cc: Ditto.
	* mount.cc (fs_info::update): Ditto.
	* path.cc: Ditto.

	* ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as
	UNICODE_STRING.
	(RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING.
	* fhandler_disk_file.cc: Accommodate throughout.
	* mount.cc (fs_info::update): Ditto.
	* path.cc (cwdstuff::set): Ditto.
	* syscalls.cc: Ditto.
This commit is contained in:
Corinna Vinschen
2009-07-14 17:37:42 +00:00
parent 472345a06c
commit 8deb411836
10 changed files with 98 additions and 75 deletions

View File

@@ -453,8 +453,7 @@ inode_t::inode_t (__dev32_t dev, __ino64_t ino)
api_fatal ("NtCreateDirectoryObject(inode): %p", status);
/* Create a mutex object in the file specific dir, which is used for
access synchronization on the dir and its objects. */
RtlInitUnicodeString (&uname, L"mtx");
InitializeObjectAttributes (&attr, &uname, OBJ_INHERIT | OBJ_OPENIF, i_dir,
InitializeObjectAttributes (&attr, &ro_u_mtx, OBJ_INHERIT | OBJ_OPENIF, i_dir,
everyone_sd (CYG_MUTANT_ACCESS));
status = NtCreateMutant (&i_mtx, CYG_MUTANT_ACCESS, &attr, FALSE);
if (!NT_SUCCESS (status))