Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Mapping network shares to local paths

Fernando_RobertoFernando_Roberto Member - All Emails Posts: 192

Hi all.

I'm intending to enumerate all network shares the local system has and list their local paths from kernel-mode code.

One way of doing so is to read the registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Shares

However, I'm not sure this key will also contain network shares that is not on SMB, like DFS and WebDAV.

Does anybody know?

Thanks in advance,

Fernando Roberto da Silva
DriverEntry Kernel Development
http:\www.driverentry.com.br


Fernando Roberto da Silva
DriverEntry Kernel Development
http://www.driverentry.com.br

Comments

  • Fernando_RobertoFernando_Roberto Member - All Emails Posts: 192

    I installed NFS Server feature on Windows Server 2019 and I saw the network shares done on NFS are listed on a different hive on registry.

    These new shares on NFS are not listed on the "Computer Management->Shared Folders->Shares" window either. This leads me to believe there isn't an unified way to list every share a system has with their respective local paths.

    The documentation says the routines NetShareEnum and its siblings are limited to SMB shares. Routines from WNet* can enumerate shares from all providers, however, they don't bring the local path regarding to each share.

    Its seems there is no way to achieve what I want using a clean and documented way even in user-mode code.

    Thanks anyway!


    Fernando Roberto da Silva
    DriverEntry Kernel Development
    http://www.driverentry.com.br

  • NtDev_GeekNtDev_Geek Member - All Emails Posts: 110
    edited November 14

    I am assuming you are working on minifilter driver. you can identify them in precreate() by checking the existence of the client token in IRP_MJ_CREATE sent by SMB server to local FSD (at SERVER SIDE!).

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE