Re: [sleuthkit-developers] win32 device opening
Brought to you by:
carrier
From: Brian C. <ca...@sl...> - 2008-10-28 14:13:37
|
Hi Michael, I only want read access, but I tried adding GENERIC_WRITE and it still failed. I recently added the FILE_SHARE_WRITE because someone reported that it was needed when the device has already been opened with write access because I am then willing to "share" the device with that program. I don't get the sharing violation when I use \\.\C: though, so perhaps the CreateFile arguments are correct and it is simply that PhysicalDrive0 is opened and not being shared. thanks, brian On Oct 27, 2008, at 7:52 PM, Michael Cohen wrote: > Hi Brian, > > I normally do this: > > device_handle = CreateFileA(image, GENERIC_READ | GENERIC_WRITE, > FILE_SHARE_READ | FILE_SHARE_WRITE, > NULL, OPEN_EXISTING, 0, NULL); > > To get write access to the raw device. Im not sure what it means to > specify FILE_SHARE_WRITE without specifying GENERIC_WRITE. The code > that I got it from was running fine on WinXP - not tested on Vista. > Why would sk need to open with FILE_SHARE_WRITE anyway? > > It may also be possible that another program has the raw device > already open for writing without sharing permitted. > > Hope this helps, > > Michael. > > On Tue, Oct 28, 2008 at 4:46 AM, Brian Carrier > <ca...@sl...> wrote: >> Any win32 developers know why TSK is getting a sharing error (0x20) >> with this statement: >> >> raw_info->fd = CreateFile(image, GENERIC_READ, >> FILE_SHARE_READ | FILE_SHARE_WRITE, 0, >> OPEN_EXISTING, 0, 0); >> >> when trying to open "\\.\PhysicalDrive0" ? >> >> >> --------------------------------------------------------------------- >> ---- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> sleuthkit-developers mailing list >> sle...@li... >> https://lists.sourceforge.net/lists/listinfo/sleuthkit-developers >> |