Click here to Skip to main content
15,908,906 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Property page Pin
Abhi Lahare21-Jun-04 0:11
Abhi Lahare21-Jun-04 0:11 
Generalperfomance improvement Pin
Member 118907820-Jun-04 23:14
Member 118907820-Jun-04 23:14 
GeneralRe: perfomance improvement Pin
Johan Rosengren21-Jun-04 2:38
Johan Rosengren21-Jun-04 2:38 
GeneralRe: perfomance improvement Pin
basementman21-Jun-04 7:29
basementman21-Jun-04 7:29 
QuestionHow to open a file with corresponded program Pin
ngocdq20-Jun-04 23:01
ngocdq20-Jun-04 23:01 
AnswerRe: How to open a file with corresponded program Pin
Ghazi H. Wadi20-Jun-04 23:07
Ghazi H. Wadi20-Jun-04 23:07 
AnswerRe: How to open a file with corresponded program Pin
gamitech22-Jun-04 13:40
gamitech22-Jun-04 13:40 
GeneralTo Ghazi Al Wadi Pin
ngocdq20-Jun-04 21:08
ngocdq20-Jun-04 21:08 
thanks alot for your help Wadi,
Can i ask you any more...
--------------------
Ghazi Al Wadi wrote:
Hi,
Hope this helps
Retrieving the owner of a file requires:
obtain the security descriptor for the file, Use GetFileSecurity()
then using the security descriptor to get a pointer to the owner's Security Identifier (SID). GetSecurityDescriptorOwner()

Finally, you use the owner's SID to obtain the owner and domain name of the file LookupAccountSid()
------------------------

thanks, could you give me a simple example???,
i've tried but it's not resposible:

CString TheFile;
TheFile=CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2);
SECURITY_DESCRIPTOR sd;
DWORD sob;
GetFileSecurity(TheFile,OWNER_SECURITY_INFORMATION,&sd,sizeof(sd),&sob);
SID pOwner;
BOOL OwnerDefault;

GetSecurityDescriptorOwner(&sd,(PSID*)&pOwner,&OwnerDefault);
char AccountName[80];
char DomainName[80];
DWORD cbDomain;
DWORD cbName;

LookupAccountSid(NULL,&pOwner,(LPTSTR)AccountName,&cbName,(LPTSTR)DomainName,&cbDomain,NULL);
::AfxMessageBox(AccountName,0,0);


help me please???!!!



thanks
GeneralRe: To Ghazi Al Wadi Pin
Ghazi H. Wadi20-Jun-04 22:46
Ghazi H. Wadi20-Jun-04 22:46 
GeneralRe: To Ghazi Al Wadi Pin
ngocdq21-Jun-04 15:38
ngocdq21-Jun-04 15:38 
GeneralRe: Hi Wadi, my problem is: Pin
ngocdq21-Jun-04 15:42
ngocdq21-Jun-04 15:42 
GeneralRe: Hi Wadi, my problem is: Pin
Ghazi H. Wadi22-Jun-04 19:18
Ghazi H. Wadi22-Jun-04 19:18 
Generalreflection Pin
Jerome Conus20-Jun-04 20:24
Jerome Conus20-Jun-04 20:24 
GeneralRe: reflection Pin
Roger Wright20-Jun-04 21:02
professionalRoger Wright20-Jun-04 21:02 
GeneralRe: reflection Pin
wb21-Jun-04 1:05
wb21-Jun-04 1:05 
GeneralRe: reflection Pin
Prakash Nadar21-Jun-04 0:14
Prakash Nadar21-Jun-04 0:14 
GeneralRe: reflection Pin
Johnny ²21-Jun-04 1:14
Johnny ²21-Jun-04 1:14 
GeneralRe: reflection Pin
Ryan Roberts21-Jun-04 1:29
Ryan Roberts21-Jun-04 1:29 
QuestionProgram exited with code 2 (0x02). What does it mean? Pin
uus9920-Jun-04 20:13
uus9920-Jun-04 20:13 
AnswerRe: Program exited with code 2 (0x02). What does it mean? Pin
Michael Dunn20-Jun-04 20:23
sitebuilderMichael Dunn20-Jun-04 20:23 
AnswerRe: Program exited with code 2 (0x02). What does it mean? Pin
Antony M Kancidrowski21-Jun-04 2:40
Antony M Kancidrowski21-Jun-04 2:40 
GeneralRe: Program exited with code 2 (0x02). What does it mean? Pin
uus9921-Jun-04 14:04
uus9921-Jun-04 14:04 
GeneralRe: Program exited with code 2 (0x02). What does it mean? Pin
Antony M Kancidrowski22-Jun-04 10:25
Antony M Kancidrowski22-Jun-04 10:25 
Generalinverting an image Pin
Naga the bug fixer20-Jun-04 19:39
Naga the bug fixer20-Jun-04 19:39 
GeneralRe: inverting an image Pin
ThatsAlok21-Jun-04 22:31
ThatsAlok21-Jun-04 22:31 

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.