Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Access Disk Sector for non-admin user

Access Disk Sector for non-admin user

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    khehwan
    wrote on last edited by
    #1

    Hi, Currently, I need to do read/write on disk sector under Win2000/XP. I found out that the statement below is only valid for administrator. hDisk=CreateFile("\\\\.\\C:", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL); ... For non-admin user, the above statement will always return hDisk=INVALID_HANDLE_VALUE. My question is how can we solve this problem? Can we assign access right or privilege in our program in order to access disk sector? or do we need to develop VXD to solve this problem? Hope that some of you can give me some hints. Thanks in advance! Best Regards, K Wan

    U 1 Reply Last reply
    0
    • K khehwan

      Hi, Currently, I need to do read/write on disk sector under Win2000/XP. I found out that the statement below is only valid for administrator. hDisk=CreateFile("\\\\.\\C:", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL); ... For non-admin user, the above statement will always return hDisk=INVALID_HANDLE_VALUE. My question is how can we solve this problem? Can we assign access right or privilege in our program in order to access disk sector? or do we need to develop VXD to solve this problem? Hope that some of you can give me some hints. Thanks in advance! Best Regards, K Wan

      U Offline
      U Offline
      User 423850
      wrote on last edited by
      #2

      Yes my friend As far as my Knowledge u will neet a service to do the above work and not a VXD cause VXD is required on 9X M/C and No such funda like aadministrator in 9X M/C ok i hope this solev ur prob.. Thanx TAKE CARE

      K 1 Reply Last reply
      0
      • U User 423850

        Yes my friend As far as my Knowledge u will neet a service to do the above work and not a VXD cause VXD is required on 9X M/C and No such funda like aadministrator in 9X M/C ok i hope this solev ur prob.. Thanx TAKE CARE

        K Offline
        K Offline
        khehwan
        wrote on last edited by
        #3

        Thanks for pointed out my mistake and confusion. Basically, what does the service do in this problem? Can the service use 'CreateFile' to access the disk sector for non-admin user? Since the security context for file system root (eg: 'c:','d:') will be lost every time we restart the computer, how do we solve this problem? More hints and guides for me? Thanks!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups