Article View: borland.public.cppbuilder.nativeapi
Article #9420GetSecurityInfo fails on remote PC
From: Uwe Maier
Date: Mon, 12 Jul 2004 09:48
Date: Mon, 12 Jul 2004 09:48
31 lines
1881 bytes
1881 bytes
GetSecurityInfo works fine on local pc.
On remote PC GetSecurityInfo fails with Invalid Handle
I made a separte Program for testing
DWORD dwRes;
hKey=HKEY_CURRENT_USER,hObject;
dwRes= RegConnectRegistry( "Remote PC",HKEY_CURRENT_USER,&hKey);
ErrorString(dwRes); //OK
dwRes= RegOpenKeyEx(hKey,"Software",0,KEY_READ|ACCESS_SYSTEM_SECURITY,&hObject);
// SetPrivilege (SE_SECURITY_NAME, true); needed ?
ErrorString(dwRes); // OK
PSECURITY_DESCRIPTOR psd = NULL;
PSID owner_sid;
PSID group_sid;
PACL acl = NULL
dwRes= GetSecurityInfo (hKey,SE_REGISTRY_KEY ,
OWNER_SECURITY_INFORMATION |
GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION |
SACL_SECURITY_INFORMATION ,
(PSID *) &owner_sid,
(PSID *) &group_sid,
&acl, NULL, &psd);
ErrorString(dwRes); // Invalid Handle
Could you please help me ?
Thanks
Uwe
Technical Details
Message-ID:
<40f25e78$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d174ffedd2c5d5e2,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Uwe Maier" <zsoft@freenet.de> Sender: "Uwe Maier" <zsoft@freenet.de> Reply-To: "Uwe Maier" <zsoft@freenet.de> Subject: GetSecurityInfo fails on remote PC Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 83.129.225.126 NNTP-Posting-Host: 207.105.83.66 Message-ID: <40f25e78$1@newsgroups.borland.com> Date: 12 Jul 2004 02:48:40 -0700 X-Trace: newsgroups.borland.com 1089625720 207.105.83.66 (12 Jul 2004 02:48:40 -0700) Lines: 33 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail