Click here to Skip to main content
15,904,024 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reusing an Incremented Variable within a Single Statement Pin
Niklas L25-Aug-10 8:27
Niklas L25-Aug-10 8:27 
Questiondisplaying the layout of an ogg file Pin
rukita24-Aug-10 4:40
rukita24-Aug-10 4:40 
AnswerRe: displaying the layout of an ogg file Pin
Richard MacCutchan24-Aug-10 5:31
mveRichard MacCutchan24-Aug-10 5:31 
GeneralRe: displaying the layout of an ogg file Pin
rukita24-Aug-10 22:40
rukita24-Aug-10 22:40 
GeneralRe: displaying the layout of an ogg file Pin
Richard MacCutchan25-Aug-10 0:21
mveRichard MacCutchan25-Aug-10 0:21 
QuestionGetting list of user accounts Pin
David Crow24-Aug-10 4:32
David Crow24-Aug-10 4:32 
AnswerRe: Getting list of user accounts Pin
Yusuf24-Aug-10 5:09
Yusuf24-Aug-10 5:09 
QuestionReset dwDesiredAccess, Pin
gothic_coder23-Aug-10 21:47
gothic_coder23-Aug-10 21:47 
Hello all,

I am detecting deletion of files on the system and to do this i am hooking the NtSetInformationFile function. this gets passed to it the file handle, and from this i need the file name. so i am using the API GetFileInformationByHandleEx to get the file name, But the problem is that the file name comes like this "\sample\a.txt", Now this doesn't give me device name(\device\volume) with File name, so i cannot assume from where the file has been accessed, It could be "C:\sample\a.txt" or "D:\sample\a.txt".

So it's quite clear that i must have "\Device\volume0", "\Device\volume1" etc before the filename, Further googling took me to THIS page where the file name can be retrieved from FileHandle, This uses CreateFileMapping, MapViewOfFile, GetMappedFileName, GetLogicalDriveStrings and QueryDosDevice to retrieve the file name, But when i use it CreateFileMapping fail with error 5 which is "Access Denied", Some more google and i found that the file handle must have GENERIC_READ access else CreateFileMapping will fail.

Now i'm not opening the file, explorer is.. So how could i check with which access explorer opens or access the file or how could i change the dwDesiredAccess..


Thanks All..
AnswerRe: Reset dwDesiredAccess, Pin
Luc Pattyn24-Aug-10 1:09
sitebuilderLuc Pattyn24-Aug-10 1:09 
GeneralRe: Reset dwDesiredAccess, Pin
gothic_coder24-Aug-10 2:17
gothic_coder24-Aug-10 2:17 
GeneralRe: Reset dwDesiredAccess, Pin
gothic_coder24-Aug-10 3:14
gothic_coder24-Aug-10 3:14 
GeneralRe: Reset dwDesiredAccess, Pin
gothic_coder25-Aug-10 22:41
gothic_coder25-Aug-10 22:41 
QuestionMessage Removed Pin
23-Aug-10 20:53
sayonee23-Aug-10 20:53 
AnswerRe: Bitmapped button functionality Pin
Peter_in_278023-Aug-10 20:56
professionalPeter_in_278023-Aug-10 20:56 
GeneralRe: Bitmapped button functionality Pin
sayonee23-Aug-10 21:05
sayonee23-Aug-10 21:05 
GeneralRe: Bitmapped button functionality Pin
Richard MacCutchan24-Aug-10 2:49
mveRichard MacCutchan24-Aug-10 2:49 
QuestionError Message Pin
ganesh_IT23-Aug-10 19:20
ganesh_IT23-Aug-10 19:20 
AnswerRe: Error Message Pin
Niklas L23-Aug-10 19:38
Niklas L23-Aug-10 19:38 
QuestionHow to check dll's reference count? Pin
Jack2009523-Aug-10 16:45
Jack2009523-Aug-10 16:45 
AnswerRe: How to check dll's reference count? Pin
Yusuf23-Aug-10 16:54
Yusuf23-Aug-10 16:54 
GeneralRe: How to check dll's reference count? Pin
Jack2009523-Aug-10 20:38
Jack2009523-Aug-10 20:38 
GeneralRe: How to check dll's reference count? Pin
Yusuf23-Aug-10 22:50
Yusuf23-Aug-10 22:50 
QuestionCompare/Convert Float to Text Pin
mohit`1223-Aug-10 7:11
mohit`1223-Aug-10 7:11 
AnswerRe: Compare/Convert Float to Text Pin
Chris Losinger23-Aug-10 7:17
professionalChris Losinger23-Aug-10 7:17 
AnswerRe: Compare/Convert Float to Text Pin
Richard MacCutchan23-Aug-10 7:22
mveRichard MacCutchan23-Aug-10 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.