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. Windows API
  4. OpenFileMapping call Fails on VISTA

OpenFileMapping call Fails on VISTA

Scheduled Pinned Locked Moved Windows API
helpsecurityworkspace
2 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.
  • P Offline
    P Offline
    praveenpl
    wrote on last edited by
    #1

    I start process which does CreateFilemapping as follows. ===================================================================================== hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, // Current file handle. &sa, // Default security. PAGE_READWRITE, // Read/write permission. 0, // Max. object size. 1, // Size of hFile. NONWTS_SERVICE_FILE_MAPOBJ); // Name of mapping object. lpMapAddress = MapViewOfFile(hMapFile, // Handle to mapping object. FILE_MAP_ALL_ACCESS, // Read/write permission 0, // Max. object size. 0, // Size of hFile. 0); // Map entire file. ..... FlushViewOfFile(lpMapAddress, 0); ===================================================================================== This process is running under session id = 1 and running under administrator user without Administrative previlages. From my other application(process) i call OpenFileMapping. This process is running under system context with session id = 0. ===================================================================================== hMapFile = OpenFileMapping( FILE_MAP_ALL_ACCESS, // Read permission. FALSE, // Inherit handle NONWTS_SERVICE_FILE_MAPOBJ); // Name of mapping object. //Non WTS Environment ===================================================================================== Here the OpenFileMapping call fails. This same thing works fine if i have done the CreateFilemapping from an application running under administrator user with Administrative previlages. Can any one please help me in overcoming this problem. Thanks in advance, Praveen

    M 1 Reply Last reply
    0
    • P praveenpl

      I start process which does CreateFilemapping as follows. ===================================================================================== hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, // Current file handle. &sa, // Default security. PAGE_READWRITE, // Read/write permission. 0, // Max. object size. 1, // Size of hFile. NONWTS_SERVICE_FILE_MAPOBJ); // Name of mapping object. lpMapAddress = MapViewOfFile(hMapFile, // Handle to mapping object. FILE_MAP_ALL_ACCESS, // Read/write permission 0, // Max. object size. 0, // Size of hFile. 0); // Map entire file. ..... FlushViewOfFile(lpMapAddress, 0); ===================================================================================== This process is running under session id = 1 and running under administrator user without Administrative previlages. From my other application(process) i call OpenFileMapping. This process is running under system context with session id = 0. ===================================================================================== hMapFile = OpenFileMapping( FILE_MAP_ALL_ACCESS, // Read permission. FALSE, // Inherit handle NONWTS_SERVICE_FILE_MAPOBJ); // Name of mapping object. //Non WTS Environment ===================================================================================== Here the OpenFileMapping call fails. This same thing works fine if i have done the CreateFilemapping from an application running under administrator user with Administrative previlages. Can any one please help me in overcoming this problem. Thanks in advance, Praveen

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Kernel object aren't visible between sessions unless you prefix the name with "Global\"

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

      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