Skip to main content
Added some detail
Source Link
Bukes
  • 3.8k
  • 1
  • 20
  • 21

The problem you're running into is that once a file handle opened with FILE_FLAG_DELETE_ON_CLOSE is closed, the operating system will no longer allow new handles to be created. In

The gory details: When processing an IRP_MJ_CLEANUP (which is what happens win a nutshellhandle is closed) for a file opened for delete-on-close, filesystem driver returnWindows file systems will set an internal flag on the file object indicating that it's on it's way out. Subsequent open attempts on the file will be failed with STATUS_DELETE_PENDING to the IO Manager , which mapsthe Win32 subsystem will map to the Win32 ERROR_ACCESS_DENIED code you're seeing.

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern. Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.

The problem you're running into is that once a file handle opened with FILE_FLAG_DELETE_ON_CLOSE is closed, the operating system will no longer allow new handles to be created. In a nutshell, filesystem driver return STATUS_DELETE_PENDING to the IO Manager , which maps to the Win32 ERROR_ACCESS_DENIED code you're seeing.

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern. Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.

The problem you're running into is that once a file handle opened with FILE_FLAG_DELETE_ON_CLOSE is closed, the operating system will no longer allow new handles to be created.

The gory details: When processing an IRP_MJ_CLEANUP (which is what happens win a handle is closed) for a file opened for delete-on-close, Windows file systems will set an internal flag on the file object indicating that it's on it's way out. Subsequent open attempts on the file will be failed with STATUS_DELETE_PENDING, which the Win32 subsystem will map to the Win32 ERROR_ACCESS_DENIED code you're seeing.

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern. Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.

Added some detail
Source Link
Bukes
  • 3.8k
  • 1
  • 20
  • 21

The problem you're running into is that once a file handle opened with FILE_FLAG_DELETE_ON_CLOSE is closed, the operating system will no longer allow new handles to be created. In a nutshell, filesystem driver return STATUS_DELETE_PENDING to the IO Manager , which maps to the Win32 ERROR_ACCESS_DENIED code you're seeing.

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern.

Basically Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern.

Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.

The problem you're running into is that once a file handle opened with FILE_FLAG_DELETE_ON_CLOSE is closed, the operating system will no longer allow new handles to be created. In a nutshell, filesystem driver return STATUS_DELETE_PENDING to the IO Manager , which maps to the Win32 ERROR_ACCESS_DENIED code you're seeing.

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern. Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.

Source Link
Bukes
  • 3.8k
  • 1
  • 20
  • 21

For your use case, you might want to consider using the Named Shared Memory (MSDN) pattern.

Basically, let the operating system manage the space for your shared memory. Just make sure you apply the appropriate security attributes, and you're good to go.