* fhandler.h (class fhandler_mailslot): Declare new private method
get_object_attr. * fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Implement. (fhandler_mailslot::open): Replace calls to path_conv::get_object_attr with calls to fhandler_mailslot::get_object_attr.
This commit is contained in:
parent
afb7f5666d
commit
c08f09ab78
|
@ -1,3 +1,11 @@
|
||||||
|
2009-11-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler.h (class fhandler_mailslot): Declare new private method
|
||||||
|
get_object_attr.
|
||||||
|
* fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Implement.
|
||||||
|
(fhandler_mailslot::open): Replace calls to path_conv::get_object_attr
|
||||||
|
with calls to fhandler_mailslot::get_object_attr.
|
||||||
|
|
||||||
2009-11-10 Corinna Vinschen <corinna@vinschen.de>
|
2009-11-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_console.cc (fhandler_console::read): Revert change from
|
* fhandler_console.cc (fhandler_console::read): Revert change from
|
||||||
|
|
|
@ -397,6 +397,7 @@ class fhandler_base
|
||||||
|
|
||||||
class fhandler_mailslot : public fhandler_base
|
class fhandler_mailslot : public fhandler_base
|
||||||
{
|
{
|
||||||
|
POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &, PUNICODE_STRING);
|
||||||
public:
|
public:
|
||||||
fhandler_mailslot ();
|
fhandler_mailslot ();
|
||||||
int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
|
int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "fhandler.h"
|
#include "fhandler.h"
|
||||||
#include "ntdll.h"
|
#include "ntdll.h"
|
||||||
|
#include "shared_info.h"
|
||||||
|
#include "tls_pbuf.h"
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/* fhandler_mailslot */
|
/* fhandler_mailslot */
|
||||||
|
@ -43,6 +45,18 @@ fhandler_mailslot::fstat (struct __stat64 *buf)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POBJECT_ATTRIBUTES
|
||||||
|
fhandler_mailslot::get_object_attr (OBJECT_ATTRIBUTES &attr,
|
||||||
|
PUNICODE_STRING path)
|
||||||
|
{
|
||||||
|
|
||||||
|
RtlCopyUnicodeString (path, pc.get_nt_native_path ());
|
||||||
|
RtlAppendUnicodeStringToString (path, &installation_key);
|
||||||
|
InitializeObjectAttributes (&attr, path, OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
|
||||||
|
NULL, NULL);
|
||||||
|
return &attr;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
fhandler_mailslot::open (int flags, mode_t mode)
|
fhandler_mailslot::open (int flags, mode_t mode)
|
||||||
{
|
{
|
||||||
|
@ -52,13 +66,17 @@ fhandler_mailslot::open (int flags, mode_t mode)
|
||||||
OBJECT_ATTRIBUTES attr;
|
OBJECT_ATTRIBUTES attr;
|
||||||
HANDLE x;
|
HANDLE x;
|
||||||
LARGE_INTEGER timeout;
|
LARGE_INTEGER timeout;
|
||||||
|
tmp_pathbuf tp;
|
||||||
|
UNICODE_STRING path;
|
||||||
|
|
||||||
|
tp.u_get (&path);
|
||||||
|
|
||||||
switch (flags & O_ACCMODE)
|
switch (flags & O_ACCMODE)
|
||||||
{
|
{
|
||||||
case O_RDONLY: /* Server */
|
case O_RDONLY: /* Server */
|
||||||
timeout.QuadPart = (flags & O_NONBLOCK) ? 0LL : 0x8000000000000000LL;
|
timeout.QuadPart = (flags & O_NONBLOCK) ? 0LL : 0x8000000000000000LL;
|
||||||
status = NtCreateMailslotFile (&x, GENERIC_READ | SYNCHRONIZE,
|
status = NtCreateMailslotFile (&x, GENERIC_READ | SYNCHRONIZE,
|
||||||
pc.get_object_attr (attr, sec_none),
|
get_object_attr (attr, &path),
|
||||||
&io, FILE_SYNCHRONOUS_IO_NONALERT,
|
&io, FILE_SYNCHRONOUS_IO_NONALERT,
|
||||||
0, 0, &timeout);
|
0, 0, &timeout);
|
||||||
if (!NT_SUCCESS (status))
|
if (!NT_SUCCESS (status))
|
||||||
|
@ -79,7 +97,7 @@ fhandler_mailslot::open (int flags, mode_t mode)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
status = NtOpenFile (&x, GENERIC_READ | SYNCHRONIZE,
|
status = NtOpenFile (&x, GENERIC_READ | SYNCHRONIZE,
|
||||||
pc.get_object_attr (attr, sec_none), &io,
|
get_object_attr (attr, &path), &io,
|
||||||
FILE_SHARE_VALID_FLAGS,
|
FILE_SHARE_VALID_FLAGS,
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT);
|
FILE_SYNCHRONOUS_IO_NONALERT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -104,7 +122,7 @@ fhandler_mailslot::open (int flags, mode_t mode)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
status = NtOpenFile (&x, GENERIC_WRITE | SYNCHRONIZE,
|
status = NtOpenFile (&x, GENERIC_WRITE | SYNCHRONIZE,
|
||||||
pc.get_object_attr (attr, sec_none), &io,
|
get_object_attr (attr, &path), &io,
|
||||||
FILE_SHARE_VALID_FLAGS,
|
FILE_SHARE_VALID_FLAGS,
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT);
|
FILE_SYNCHRONOUS_IO_NONALERT);
|
||||||
if (!NT_SUCCESS (status))
|
if (!NT_SUCCESS (status))
|
||||||
|
|
Loading…
Reference in New Issue