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

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

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Mapping network shares to local paths

Fernando_RobertoFernando_Roberto Member - All Emails Posts: 196

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: 196

    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: 111
    edited November 2019

    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
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA