🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17570

Re: SystemHandleInformation

#17570
From: Boguslaw Fries
Date: Sat, 15 Mar 2003 21:09
87 lines
2110 bytes
Here is a good code, thank you. I tried to insert this code into my program,
bu the result still the same...
Additionally ,
From this article  I copied some part to verify here
bool TTCPViewWindow::AdjustDacl( HANDLE hProcess )

{

char s_message[ 256 ];

SID world = { SID_REVISION, 1, SECURITY_WORLD_SID_AUTHORITY, 0 };

LPTSTR ptstrName = ( LPTSTR ) & world;

EXPLICIT_ACCESS ea =

{

STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL,

SET_ACCESS,

NO_INHERITANCE,

{

0,

NO_MULTIPLE_TRUSTEE,

TRUSTEE_IS_SID,

TRUSTEE_IS_USER,

ptstrName

}

};

ACL * pdacl = 0;

if( SetEntriesInAcl( 1, &ea, 0, &pdacl ) != ERROR_SUCCESS )

{

sprintf( s_message, "SetEntriesInAcl Error:%d", GetLastError( ));

ShowMessage( s_message);

return false;

}

if( SetSecurityInfo( hProcess,

SE_KERNEL_OBJECT,

DACL_SECURITY_INFORMATION,

0,

0,

pdacl,

0 ) != ERROR_SUCCESS )

{

sprintf( s_message, "SetSecurityInfo Error:%d", GetLastError( ));

}

LocalFree( pdacl );

return true;

}

The function SetSecurityInfo very often returns NGATIVE result

What is wrong?



Boguslaw Fries
Technical Details
Message-ID: <3e7397d8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e71ab57@newsgroups.borland.com> <3e723745$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,dd89ba217156913d
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-03-15 13:26:21 PST
From: "Boguslaw Fries" <B.Fries@luca-online.de>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e71ab57@newsgroups.borland.com> <3e723745$1@newsgroups.borland.com>
Subject: Re: SystemHandleInformation
Date: Sat, 15 Mar 2003 22:09:53 +0100
Lines: 89
Organization: LUCA
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 217.82.82.218
Message-ID: <3e7397d8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1047762904 217.82.82.218 (15 Mar 2003 13:15:04 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail