server: Create the named pipe and mailslot devices under \Device.
Add appropriate symlinks to them in the \?? directory.
This commit is contained in:
parent
94655c8493
commit
846dc62355
|
@ -302,55 +302,67 @@ void init_directories(void)
|
|||
static const WCHAR dir_driverW[] = {'D','r','i','v','e','r'};
|
||||
static const WCHAR dir_deviceW[] = {'D','e','v','i','c','e'};
|
||||
static const WCHAR dir_basenamedW[] = {'\\','B','a','s','e','N','a','m','e','d','O','b','j','e','c','t','s'};
|
||||
static const WCHAR dir_named_pipeW[] = {'\\','D','e','v','i','c','e','\\','N','a','m','e','d','P','i','p','e'};
|
||||
static const WCHAR dir_mailslotW[] = {'\\','D','e','v','i','c','e','\\','M','a','i','l','S','l','o','t'};
|
||||
static const struct unicode_str dir_global_str = {dir_globalW, sizeof(dir_globalW)};
|
||||
static const struct unicode_str dir_driver_str = {dir_driverW, sizeof(dir_driverW)};
|
||||
static const struct unicode_str dir_device_str = {dir_deviceW, sizeof(dir_deviceW)};
|
||||
static const struct unicode_str dir_basenamed_str = {dir_basenamedW, sizeof(dir_basenamedW)};
|
||||
static const struct unicode_str dir_named_pipe_str = {dir_named_pipeW, sizeof(dir_named_pipeW)};
|
||||
static const struct unicode_str dir_mailslot_str = {dir_mailslotW, sizeof(dir_mailslotW)};
|
||||
|
||||
/* symlinks */
|
||||
static const WCHAR link_dosdevW[] = {'D','o','s','D','e','v','i','c','e','s'};
|
||||
static const WCHAR link_globalW[] = {'G','l','o','b','a','l'};
|
||||
static const WCHAR link_localW[] = {'L','o','c','a','l'};
|
||||
static const WCHAR link_pipeW[] = {'P','I','P','E'};
|
||||
static const WCHAR link_mailslotW[] = {'M','A','I','L','S','L','O','T'};
|
||||
static const struct unicode_str link_dosdev_str = {link_dosdevW, sizeof(link_dosdevW)};
|
||||
static const struct unicode_str link_global_str = {link_globalW, sizeof(link_globalW)};
|
||||
static const struct unicode_str link_local_str = {link_localW, sizeof(link_localW)};
|
||||
static const struct unicode_str link_pipe_str = {link_pipeW, sizeof(link_pipeW)};
|
||||
static const struct unicode_str link_mailslot_str = {link_mailslotW, sizeof(link_mailslotW)};
|
||||
|
||||
/* devices */
|
||||
static const WCHAR pipeW[] = {'P','I','P','E'};
|
||||
static const WCHAR mailslotW[] = {'M','A','I','L','S','L','O','T'};
|
||||
static const struct unicode_str pipe_str = {pipeW, sizeof(pipeW)};
|
||||
static const WCHAR named_pipeW[] = {'N','a','m','e','d','P','i','p','e'};
|
||||
static const WCHAR mailslotW[] = {'M','a','i','l','S','l','o','t'};
|
||||
static const struct unicode_str named_pipe_str = {named_pipeW, sizeof(named_pipeW)};
|
||||
static const struct unicode_str mailslot_str = {mailslotW, sizeof(mailslotW)};
|
||||
|
||||
struct directory *dir_driver, *dir_device, *dir_global, *dir_basenamed;
|
||||
struct symlink *link_dosdev, *link_global1, *link_global2, *link_local;
|
||||
struct symlink *link_dosdev, *link_global1, *link_global2, *link_local, *link_pipe, *link_mailslot;
|
||||
|
||||
root_directory = create_directory( NULL, NULL, 0, HASH_SIZE );
|
||||
dir_driver = create_directory( root_directory, &dir_driver_str, 0, HASH_SIZE );
|
||||
dir_device = create_directory( root_directory, &dir_device_str, 0, HASH_SIZE );
|
||||
make_object_static( &root_directory->obj );
|
||||
make_object_static( &dir_driver->obj );
|
||||
make_object_static( &dir_device->obj );
|
||||
|
||||
dir_global = create_directory( NULL, &dir_global_str, 0, HASH_SIZE );
|
||||
/* use a larger hash table for this one since it can contain a lot of objects */
|
||||
dir_basenamed = create_directory( NULL, &dir_basenamed_str, 0, 37 );
|
||||
|
||||
/* devices */
|
||||
create_named_pipe_device( dir_device, &named_pipe_str );
|
||||
create_mailslot_device( dir_device, &mailslot_str );
|
||||
|
||||
/* symlinks */
|
||||
link_dosdev = create_symlink( root_directory, &link_dosdev_str, 0, &dir_global_str );
|
||||
link_global1 = create_symlink( dir_global, &link_global_str, 0, &dir_global_str );
|
||||
link_global2 = create_symlink( dir_basenamed, &link_global_str, 0, &dir_basenamed_str );
|
||||
link_local = create_symlink( dir_basenamed, &link_local_str, 0, &dir_basenamed_str );
|
||||
link_pipe = create_symlink( dir_global, &link_pipe_str, 0, &dir_named_pipe_str );
|
||||
link_mailslot = create_symlink( dir_global, &link_mailslot_str, 0, &dir_mailslot_str );
|
||||
make_object_static( (struct object *)link_dosdev );
|
||||
make_object_static( (struct object *)link_global1 );
|
||||
make_object_static( (struct object *)link_global2 );
|
||||
make_object_static( (struct object *)link_local );
|
||||
|
||||
/* devices */
|
||||
create_named_pipe_device( dir_global, &pipe_str );
|
||||
create_mailslot_device( dir_global, &mailslot_str );
|
||||
make_object_static( (struct object *)link_pipe );
|
||||
make_object_static( (struct object *)link_mailslot );
|
||||
|
||||
/* the symlinks or devices hold references so we can release these */
|
||||
release_object( dir_global );
|
||||
release_object( dir_device );
|
||||
release_object( dir_basenamed );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue