Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CreateFile Sharing Violation

10 views
Skip to first unread message

Timothy Jewett

unread,
May 18, 2009, 5:02:04 PM5/18/09
to
I have a service that is creating a file with a desired access setting of all
access and a sharing of FILE_SHARE_READ. If the service still has the handle
open and another application tries to read the file (open with generic_read)
I get a sharing violation on the second application.

ProcessMonitor entries:

****** Create from service *********
Date & Time: 5/18/2009 3:36:56 PM
Event Class: File System
Operation: CreateFile
Result: SUCCESS
Path: E:\TIM32\GroupReporting\Release\Logs\GroupReporting.txt
TID: 4368
Duration: 0.0010142
Desired Access: All Access
Disposition: OverwriteIf
Options: Synchronous IO Non-Alert, Non-Directory File
Attributes: N
ShareMode: Read
AllocationSize: 0
OpenResult: Overwritten


****** Read from 2nd app ********

Date & Time: 5/18/2009 3:37:04 PM
Event Class: File System
Operation: CreateFile
Result: SHARING VIOLATION
Path: E:\TIM32\GroupReporting\Release\Logs\GroupReporting.txt
TID: 5412
Duration: 0.0000481
Desired Access: Generic Read
Disposition: Open
Options: Synchronous IO Non-Alert, Non-Directory File
Attributes: N
ShareMode: Read, Write
AllocationSize: n/a

What am I doing wrong with the service ????
--
Timothy Jewett
Jewet...@online.nospam

Timothy Jewett

unread,
May 21, 2009, 1:21:02 PM5/21/09
to
Sorry Directx folks. I didn't mean to pick this group. Will post in the
correct group
--
Timothy Jewett
Jewet...@online.nospam
0 new messages