🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Troubles with services

#16128
From: Remy Lebeau (TeamB)
Date: Sat, 31 May 2003 21:34
32 lines
2699 bytes
"Stefano Bonifazi" <stefboombastic@libero.it> wrote in message
news:3ed90dd0@newsgroups.borland.com...

> Well I know the logged in user (only one and administrator),
> but I don't have any idea about how to grab his security
> tokens or whatever I need to access his
> HKEY_CURRENT_USER registry root key ;(

It is not a simple task to do.  You have to understand how NT's security
model works and how to manipulate it correctly.  Even then, in order to
access the HKCU key, you need to know which user account to get the tokens
for, and grabbing the current username from a service is equally a difficult
task to perform.  However, if you are only modifying the key for a specific
user each time, than LogonUser() is going to be the simpliest way to go.

> But there is a logged user, and the HKCU is not his one!

No, there is not, not from the service's perspective anyway.  A service
running under the LocalSystem account runs under its own separate
workstation from the one the user is logging in to.  It runs independantly
of the user's login session, and in fact is already running before the user
even has a chance to log in.

> My service has NULL lpServiceStartName and pPassword,
> and in Microsoft SCM program under the voice connection
> it say Local System !!

Then it will have full access to the file system.


Gambit
Technical Details
Message-ID: <3ed91f3e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ed1e176@newsgroups.borland.com> <3ed28fd7$1@newsgroups.borland.com> <3ed3a8c4@newsgroups.borland.com> <3ed3b644$4@newsgroups.borland.com> <3ed46301@newsgroups.borland.com> <3ed4eda2$1@newsgroups.borland.com> <3ed5d3fa@newsgroups.borland.com> <3ed65152$1@newsgroups.borland.com> <3ed711ab$1@newsgroups.borland.com> <3ed7865e$3@newsgroups.borland.com> <3ed90dd0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2bef8d34fe764e59
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-31 14:43:19 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ed1e176@newsgroups.borland.com> <3ed28fd7$1@newsgroups.borland.com> <3ed3a8c4@newsgroups.borland.com> <3ed3b644$4@newsgroups.borland.com> <3ed46301@newsgroups.borland.com> <3ed4eda2$1@newsgroups.borland.com> <3ed5d3fa@newsgroups.borland.com> <3ed65152$1@newsgroups.borland.com> <3ed711ab$1@newsgroups.borland.com> <3ed7865e$3@newsgroups.borland.com> <3ed90dd0@newsgroups.borland.com>
Subject: Re: Troubles with services
Date: Sat, 31 May 2003 14:34:32 -0700
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3ed91f3e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054416702 207.175.226.26 (31 May 2003 14:31:42 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail