Skip to content

Request to allow user configuration of deviceCharacteristics #1331

@lanopk-openboxlab

Description

@lanopk-openboxlab

Currently, in Dokany, network sharing is not possible when the configuration is Public (no current session set) + Network.
The netShareAdd function does not work.

To resolve this issue, you must either set the drive as a local disk or create a symbolic link to a temporary folder and then enable network sharing.

My proposed solution is to allow deviceCharacteristics to be configured externally and to treat deviceCharacteristics as similar to a network type when it is FILE_REMOTE_DEVICE.

This involves making the disk itself a local disk and setting only the type to network.

In other words:
DeviceType = FILE_DEVICE_DISK
DeviceCharacteristics = FILE_REMOTE_DEVICE

By doing this, it is recognized as a network type, and since it is a local disk, network sharing becomes possible.

In this case, to access the UNC path from the local PC, you may need to modify the NP or modify calls related to DokanRegisterUncProvider.

If you are wondering why I go out of my way to use a network drive when a local disk is sufficient, it is because network drives significantly reduce unnecessary file/folder requests generated by Windows.

If it is difficult to expose deviceCharacteristics externally, it might be a good idea to add a Dokan Option for FILE_DEVICE_DISK and FILE_REMOTE_DEVICE.

/**

  • Mount as a local disk device but with network drive appearance.
  • The device uses FILE_DEVICE_DISK with FILE_REMOTE_DEVICE characteristic
  • so the DosDevice resolves locally (enabling SMB sharing via NetShareAdd)
  • while UNC access is maintained through MUP registration.
  • Requires a drive letter mount point and UNCName to be set.
  • Cannot be combined with \ref DOKAN_OPTION_NETWORK.
    */
    #define DOKAN_OPTION_LOCAL_NETWORK (1 << 13)

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions