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

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

UMDF - CreateSymbolicLink for an user

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Is it possible to create a symbolic link to for an user, or all users, from
a UMDF driver to \\DosDevice\\k: or simulair?

Was thinking using Impersonate, but the driver fails and restart as soon
as I use the device object in the impersonate callback.
Creating files or simulair works as impersonated user,
but not creating a symbolic link.

Perhaps there is an easier way also. Like using DefineDosDevice to a
special interface in the user mode app?

Regards,
Daniel

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    You cannot make any object calls in the impersonation callback.

    What happens when you call IWDFDevice::CreateSymbolicLink outside of impersonation?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 12:45 PM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] UMDF - CreateSymbolicLink for an user

    Is it possible to create a symbolic link to for an user, or all users, from
    a UMDF driver to \\DosDevice\\k: or simulair?

    Was thinking using Impersonate, but the driver fails and restart as soon
    as I use the device object in the impersonate callback.
    Creating files or simulair works as impersonated user,
    but not creating a symbolic link.

    Perhaps there is an easier way also. Like using DefineDosDevice to a
    special interface in the user mode app?

    Regards,
    Daniel

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Well, first let's say that I'm running on Windows Vista, with DDK 6000.

    The call to CreateSymbolicLink goes successfull but I assume that the
    link is created for the localservice account, because my normal user
    never recieves any new device letter. Therefore my Impersonate idea.

    But hopefully there is a better way?

    Daniel
    "Peter Wieland" skrev i meddelandet news:xxxxx@ntdev...
    You cannot make any object calls in the impersonation callback.



    What happens when you call IWDFDevice::CreateSymbolicLink outside of impersonation?



    -p



    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 12:45 PM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] UMDF - CreateSymbolicLink for an user



    Is it possible to create a symbolic link to for an user, or all users, from

    a UMDF driver to \\DosDevice\\k: or simulair?



    Was thinking using Impersonate, but the driver fails and restart as soon

    as I use the device object in the impersonate callback.

    Creating files or simulair works as impersonated user,

    but not creating a symbolic link.



    Perhaps there is an easier way also. Like using DefineDosDevice to a

    special interface in the user mode app?



    Regards,

    Daniel


    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    What path are you providing for your symbolic link?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 1:45 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] UMDF - CreateSymbolicLink for an user

    Well, first let's say that I'm running on Windows Vista, with DDK 6000.

    The call to CreateSymbolicLink goes successfull but I assume that the
    link is created for the localservice account, because my normal user
    never recieves any new device letter. Therefore my Impersonate idea.

    But hopefully there is a better way?

    Daniel
    "Peter Wieland" > skrev i meddelandet news:xxxxx@ntdev...
    You cannot make any object calls in the impersonation callback.

    What happens when you call IWDFDevice::CreateSymbolicLink outside of impersonation?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 12:45 PM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] UMDF - CreateSymbolicLink for an user

    Is it possible to create a symbolic link to for an user, or all users, from
    a UMDF driver to \\DosDevice\\k: or simulair?

    Was thinking using Impersonate, but the driver fails and restart as soon
    as I use the device object in the impersonate callback.
    Creating files or simulair works as impersonated user,
    but not creating a symbolic link.

    Perhaps there is an easier way also. Like using DefineDosDevice to a
    special interface in the user mode app?

    Regards,
    Daniel

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Tried \\DosDevice\\k: and also \\DosDevice\\Global\\k:
    and of course is these not used before.

    Also tried with DefineDosDevice, but was not really sure what to
    use for path here. It feels like it worked a bit different in the WDM
    time...

    Daniel
    "Peter Wieland" skrev i meddelandet news:xxxxx@ntdev...
    What path are you providing for your symbolic link?



    -p



    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 1:45 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] UMDF - CreateSymbolicLink for an user



    Well, first let's say that I'm running on Windows Vista, with DDK 6000.



    The call to CreateSymbolicLink goes successfull but I assume that the

    link is created for the localservice account, because my normal user

    never recieves any new device letter. Therefore my Impersonate idea.



    But hopefully there is a better way?



    Daniel

    "Peter Wieland" skrev i meddelandet news:xxxxx@ntdev...

    You cannot make any object calls in the impersonation callback.



    What happens when you call IWDFDevice::CreateSymbolicLink outside of impersonation?



    -p



    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 12:45 PM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] UMDF - CreateSymbolicLink for an user



    Is it possible to create a symbolic link to for an user, or all users, from

    a UMDF driver to \\DosDevice\\k: or simulair?



    Was thinking using Impersonate, but the driver fails and restart as soon

    as I use the device object in the impersonate callback.

    Creating files or simulair works as impersonated user,

    but not creating a symbolic link.



    Perhaps there is an easier way also. Like using DefineDosDevice to a

    special interface in the user mode app?



    Regards,

    Daniel


    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,435
    Just a guess, but you probably have to communicate with the mountmanager to dynamically bring drive letters online.

    d

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 3:15 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] Re:UMDF - CreateSymbolicLink for an user

    Tried \\DosDevice\\k: and also \\DosDevice\\Global\\k:
    and of course is these not used before.

    Also tried with DefineDosDevice, but was not really sure what to
    use for path here. It feels like it worked a bit different in the WDM
    time...

    Daniel
    "Peter Wieland" > skrev i meddelandet news:xxxxx@ntdev...
    What path are you providing for your symbolic link?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 1:45 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] UMDF - CreateSymbolicLink for an user

    Well, first let's say that I'm running on Windows Vista, with DDK 6000.

    The call to CreateSymbolicLink goes successfull but I assume that the
    link is created for the localservice account, because my normal user
    never recieves any new device letter. Therefore my Impersonate idea.

    But hopefully there is a better way?

    Daniel
    "Peter Wieland" > skrev i meddelandet news:xxxxx@ntdev...
    You cannot make any object calls in the impersonation callback.

    What happens when you call IWDFDevice::CreateSymbolicLink outside of impersonation?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 12:45 PM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] UMDF - CreateSymbolicLink for an user

    Is it possible to create a symbolic link to for an user, or all users, from
    a UMDF driver to \\DosDevice\\k: or simulair?

    Was thinking using Impersonate, but the driver fails and restart as soon
    as I use the device object in the impersonate callback.
    Creating files or simulair works as impersonated user,
    but not creating a symbolic link.

    Perhaps there is an easier way also. Like using DefineDosDevice to a
    special interface in the user mode app?

    Regards,
    Daniel

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
    d
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    You might want to look at IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER is the WDK, and mountmgr.h.

    Good luck,

    mm
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    You'll need to make the link in \DosDevices\Global or it won't be visible outside the services session.

    And how do you determine that they are not working? Are you looking for them in the explorer? Did you write a program to open \\.\k: and that's failing?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 3:15 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] Re:UMDF - CreateSymbolicLink for an user

    Tried \\DosDevice\\k: and also \\DosDevice\\Global\\k:
    and of course is these not used before.

    Also tried with DefineDosDevice, but was not really sure what to
    use for path here. It feels like it worked a bit different in the WDM
    time...

    Daniel
    "Peter Wieland" > skrev i meddelandet news:xxxxx@ntdev...
    What path are you providing for your symbolic link?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 1:45 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] UMDF - CreateSymbolicLink for an user

    Well, first let's say that I'm running on Windows Vista, with DDK 6000.

    The call to CreateSymbolicLink goes successfull but I assume that the
    link is created for the localservice account, because my normal user
    never recieves any new device letter. Therefore my Impersonate idea.

    But hopefully there is a better way?

    Daniel
    "Peter Wieland" > skrev i meddelandet news:xxxxx@ntdev...
    You cannot make any object calls in the impersonation callback.

    What happens when you call IWDFDevice::CreateSymbolicLink outside of impersonation?

    -p

    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel ?berg
    Sent: Thursday, October 11, 2007 12:45 PM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] UMDF - CreateSymbolicLink for an user

    Is it possible to create a symbolic link to for an user, or all users, from
    a UMDF driver to \\DosDevice\\k: or simulair?

    Was thinking using Impersonate, but the driver fails and restart as soon
    as I use the device object in the impersonate callback.
    Creating files or simulair works as impersonated user,
    but not creating a symbolic link.

    Perhaps there is an easier way also. Like using DefineDosDevice to a
    special interface in the user mode app?

    Regards,
    Daniel

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

    ---
    NTDEV is sponsored by OSR

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    ...or rather IOCTL_MOUNTMGR_CREATE_POINT.
  • PopAlexandraPopAlexandra Member Posts: 6

    @OSR_Community_User said:
    ...or rather IOCTL_MOUNTMGR_CREATE_POINT.

    That would work even better!


    Alexandra from NTT

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,345

    You know what would be even better? Not replying to a12 year old post!

    Peter Viscarola
    OSR
    @OSRDrivers

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
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA