EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Other Ways to Create Mounting Points

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#13815
Posted: 07/06/2010 05:46:02
by Reginald Henderson (Standard support level)
Joined: 07/06/2010
Posts: 3

Is there another way to create mounting points or is X:\ and \\.\MyDisk the only way??

I'm searching around in your forums for info and ran across this.. http://www.eldos.com/forum/read.php?FID=8&TID=945

Is it possible to create mounting points as \\MyDisk ??

Just looking for another easy way to mount without it showing as a X:\ drive.

The reason I'm looking for this is because when I run the following code to create a basic text file I get an error.

Code
            StreamWriter sw = File.CreateText(@"\\.\MySecretDisk\hello_storage.txt");
            sw.Write("This is some sample text");
            sw.Flush();
            sw.Dispose();


The error I get is...

FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path.

So I'm looking for another hidden way to mount my drive.
#13816
Posted: 07/06/2010 06:29:28
by Volodymyr Zinin (EldoS Corp.)

With the current version of SolFS there are no other ways to create mounting points. But in the next major release (which is expected in a month) it will be possible to create network mounting points (like "\\server_name\share_name"). Such mounting points don't really support network features but their behavior is similar to standard network shares (but only with the local visibility). Actually it has already been implemented in another our product CallbackFS.
#13817
Posted: 07/06/2010 06:47:32
by Eugene Mayevski (EldoS Corp.)

Note, that even network mounting point won't help if FileStream class blocks all paths starting from "\\", and not only "\\.\"


Sincerely yours
Eugene Mayevski
#13818
Posted: 07/06/2010 07:05:50
by Volodymyr Zinin (EldoS Corp.)

It's easy to check by creating a microsoft network share and trying to access it locally via FileStream.
#13824
Posted: 07/06/2010 11:10:37
by Reginald Henderson (Standard support level)
Joined: 07/06/2010
Posts: 3

I just tested this out and "\\my_computer_name\file_share" works fine. No errors, no issues.

So, wanted to know 2 things.

1. Once the network share is created will it be hidden like \\.\ or will it be visible to anyone looking at network shares on the computer?

2. You said the next version of SolFS OS Edition will have this. Is it possible to get a beta version of it now or will I have to wait a month?
#13827
Posted: 07/06/2010 14:21:56
by Volodymyr Zinin (EldoS Corp.)

Quote
Reginald Henderson wrote:
1. Once the network share is created will it be hidden like \\.\ or will it be visible to anyone looking at network shares on the computer?

It can be hidden (i.e. it won't be visible during shares enumeration). The behavior of such a share is like microsoft hidden shares (that has a name with the '$' symbol in the end). For example enter the path "\\127.0.0.1\c$" in Explorer.

Quote
Reginald Henderson wrote:
2. You said the next version of SolFS OS Edition will have this. Is it possible to get a beta version of it now or will I have to wait a month?

Unfortunately not, because there hasn't yet a user API for such mounting points creation. But you can temporary use the following technique - create a "usual" hidden mounting point (like "\\.\MySecretDisk") and assign a hidden share (that has a name with the '$' symbol in the end) to it. Then use the share to access the drive.
To create a share programmatically you can use the NetShareAdd system API. Below the code I used formerly for similar testing.
Code
BOOL
OnCreateSharePointTest(
    IN DWORD StorageId
    )
{
    SHARE_INFO_2 ShareInfo2;
    NET_API_STATUS Status;
    DWORD ErrIndex;
    DWORD LastError;
    BOOL Success = FALSE;
    BOOL SymLinkCreated = FALSE;
    BOOL ShareCreated = FALSE;

#define CBFS_SHARING_LINK_NAME  L"CbFsShareTest"
#define CBFS_SHARE_NAME  L"CbFsShare"

    if (!CbFsCreateSymLink(StorageId, CBFS_SHARING_LINK_NAME, FALSE))
        goto end;
    SymLinkCreated = TRUE;

    ZeroMemory(&ShareInfo2, sizeof(ShareInfo2));

    ShareInfo2.shi2_netname = CBFS_SHARE_NAME;
    ShareInfo2.shi2_type = 0;//0x40000000;//STYPE_TEMPORARY
    ShareInfo2.shi2_remark = L"Some comment";
    ShareInfo2.shi2_permissions = ACCESS_ALL;
    ShareInfo2.shi2_max_uses = -1;
    //ShareInfo2.shi2_current_uses = 0;
    ShareInfo2.shi2_path = L"\\\\.\\" CBFS_SHARING_LINK_NAME L"\\";
    ShareInfo2.shi2_passwd = NULL;

    Status = NetShareAdd( NULL,
                          2,
                          (LPBYTE)&ShareInfo2,
                          &ErrIndex );
    if (Status != NERR_Success) {

        SetLastError(Status);
        goto end;
    }
    ShareCreated = TRUE;

    LastError = WNetAddConnection( L"\\\\127.0.0.1\\" CBFS_SHARE_NAME,
                                   NULL,
                                   L"T:" );

    if (LastError != NO_ERROR) {

        SetLastError(LastError);
        goto end;
    }  

    Success = TRUE;

end:

    LastError = GetLastError();

    if (!Success) {
    
        if (ShareCreated) {

            ASSERT(0);
        }

        if (SymLinkCreated) {

            CbFsDeleteSymLink(CBFS_SHARING_LINK_NAME);
        }
    }

    SetLastError(LastError);
    return Success;
}
#13828
Posted: 07/06/2010 15:31:48
by Reginald Henderson (Standard support level)
Joined: 07/06/2010
Posts: 3

I tried to do this manually and cant get it to work. Created a mounting point "Hello$". Then i tried to access \\my_computer\Hello$ and it didnt work.

I can wait until the next version is released since it's a month out. For now I'll use the X:\ drive letter to code and then replace the path later with the new version.

Thanks for your help.
#13831
Posted: 07/07/2010 01:15:33
by Eugene Mayevski (EldoS Corp.)

Quote
Reginald Henderson wrote:
I tried to do this manually and cant get it to work. Created a mounting point "Hello$". Then i tried to access \\my_computer\Hello$ and it didnt work.


What exactly "didn't work" means for you?

Quote
Reginald Henderson wrote:
I can wait until the next version is released since it's a month out.


It's probably a beta version that's a month away from now. And we will keep it in beta for another month or so.


Sincerely yours
Eugene Mayevski
#14054
Posted: 07/30/2010 22:16:26
by Dan  (Basic support level)
Joined: 07/27/2010
Posts: 12

I too need this feature.
#14133
Posted: 08/07/2010 17:58:03
by Dan  (Basic support level)
Joined: 07/27/2010
Posts: 12

It's exactly a month. Is this new version available yet? This feature is very important and in fact, without it, SolFS is not useful for me. I don't want to create drive letter based mounting points on end user machines. I really need the UNC type path as the \\.\ will not work with .NET FileStream.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 7777 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!