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

C / C++ / MFC

 
Questionmanifest file Pin
saisp30-Jun-07 20:56
saisp30-Jun-07 20:56 
AnswerRe: manifest file Pin
Paresh Chitte1-Jul-07 18:28
Paresh Chitte1-Jul-07 18:28 
GeneralRe: manifest file Pin
tom groezer4-Jul-07 8:59
tom groezer4-Jul-07 8:59 
GeneralRe: manifest file Pin
Paresh Chitte5-Jul-07 18:40
Paresh Chitte5-Jul-07 18:40 
QuestionCwebbrowser2 , cannot find the internet path Pin
awah30-Jun-07 17:31
awah30-Jun-07 17:31 
AnswerRe: Cwebbrowser2 , cannot find the internet path Pin
awah30-Jun-07 18:06
awah30-Jun-07 18:06 
AnswerRe: Cwebbrowser2 , cannot find the internet path Pin
Michael Dunn1-Jul-07 12:26
sitebuilderMichael Dunn1-Jul-07 12:26 
QuestionPSID,PACL Leakage Problem Pin
Akin Ocal30-Jun-07 13:10
Akin Ocal30-Jun-07 13:10 
In my main scope i declare my pointer variables :


...
PSID ownerSid = NULL ;
PACL pDACL = NULL ;
ownerSid = GetOwnerSIDFromFile (path);
pDACL = GetDACLFromFile (path);
if(ownerSid) FreeSid(ownerSid);
if(pDACL) LocalFree(pDACL);
...

PSID and PACL still cause leakages altgough i try to release them. How can i handle that situation ?

Here are 2 functions i call :


PSID GetOwnerSIDFromFile (char* sFileOrFolderName)
{
DWORD dwRtnCode = 0;
PSID pSidOwner = NULL ;
HANDLE hFile;
SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;

hFile = CreateFile(
sFileOrFolderName,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);



if (hFile == INVALID_HANDLE_VALUE)
return NULL ;




AllocateAndInitializeSid(&SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSidOwner) ;

if( !pSidOwner )
{
CloseHandle(hFile);

return NULL ;
}


dwRtnCode = GetSecurityInfo(
hFile,
SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION,
&pSidOwner,
NULL,
NULL,
NULL,
NULL);


CloseHandle(hFile);

return pSidOwner ;
}

PACL GetDACLFromFile (char* sFileOrFolderName)

{
PACL pDACL = NULL ;
DWORD dwRtnCode = 0;

HANDLE hFile;


hFile = CreateFile(
sFileOrFolderName,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);

if (hFile == INVALID_HANDLE_VALUE)
return NULL ;

pDACL = (PACL)LocalAlloc(LPTR,sizeof(PACL));

if( !pDACL )
return NULL ;



dwRtnCode = GetSecurityInfo(
hFile,
SE_FILE_OBJECT,
DACL_SECURITY_INFORMATION,
NULL,
NULL,
&pDACL,
NULL,
NULL);

CloseHandle(hFile);

return pDACL ;
}
QuestionHow to post sample code here. Pin
samal_recw9530-Jun-07 12:45
samal_recw9530-Jun-07 12:45 
AnswerRe: How to post sample code here. Pin
Christian Graus30-Jun-07 14:07
protectorChristian Graus30-Jun-07 14:07 
GeneralRe: How to post sample code here. Pin
samal_recw951-Jul-07 8:13
samal_recw951-Jul-07 8:13 
QuestionData structures Pin
tom groezer30-Jun-07 10:52
tom groezer30-Jun-07 10:52 
AnswerRe: Data structures Pin
Paresh Chitte1-Jul-07 18:21
Paresh Chitte1-Jul-07 18:21 
AnswerRe: Data structures Pin
David Crow2-Jul-07 4:55
David Crow2-Jul-07 4:55 
QuestionDebugger not catching a specific WM_KEYDOWN in OpenGL application [PROBLEM RESOLVED] [modified] Pin
Cyrilix30-Jun-07 10:29
Cyrilix30-Jun-07 10:29 
AnswerRe: Debugger not catching a specific WM_KEYDOWN in OpenGL application Pin
Cyrilix30-Jun-07 17:53
Cyrilix30-Jun-07 17:53 
AnswerRe: Debugger not catching a specific WM_KEYDOWN in OpenGL application Pin
Steve Echols30-Jun-07 19:05
Steve Echols30-Jun-07 19:05 
GeneralRe: Debugger not catching a specific WM_KEYDOWN in OpenGL application Pin
Cyrilix30-Jun-07 20:10
Cyrilix30-Jun-07 20:10 
QuestionHBITMAP size Pin
Axonn Echysttas30-Jun-07 9:37
Axonn Echysttas30-Jun-07 9:37 
AnswerRe: HBITMAP size Pin
Randor 30-Jun-07 11:24
professional Randor 30-Jun-07 11:24 
QuestionSoftware Project Pin
AprNgp30-Jun-07 5:16
AprNgp30-Jun-07 5:16 
AnswerRe: Software Project Pin
Luc Pattyn30-Jun-07 5:34
sitebuilderLuc Pattyn30-Jun-07 5:34 
AnswerRe: Software Project Pin
Cyrilix30-Jun-07 10:30
Cyrilix30-Jun-07 10:30 
AnswerRe: Software Project Pin
David Crow2-Jul-07 4:56
David Crow2-Jul-07 4:56 
Questioninstalled softwares via registry Pin
Akin Ocal30-Jun-07 4:55
Akin Ocal30-Jun-07 4:55 

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.