Re: My Service needs to acces the Registry...
From: Serguei (nospam_at_nowhere.no)
Date: 10/16/03
- Next message: Serguei: "Re: Setting IP Address (Registry)"
- Previous message: Qzg=FCr=20TU=D0RUL?=: "Re: application.hide .."
- In reply to: Alexander Bauer: "My Service needs to acces the Registry..."
- Next in thread: Alexander Bauer: "Re: My Service needs to acces the Registry..."
- Reply: Alexander Bauer: "Re: My Service needs to acces the Registry..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 16 Oct 2003 10:37:08 -0700
Hello,
By default your service runs under "local system" account,
which has low permissions.
You may configure it to run under different account:
see control panel->Adminiostrative Tools->Services->
Properties->Log On.
If it is not an option, your service may impersonate as
different user just for the time when accessing the registry.
>Also I've seen that I have to define some event-id texts
> for the loggin in the Win2K eventlog.
There are two parts for writing events:
1) You will have to define the message table resource,
and register it as an event source. You may still
write the events into the log without this step,
but the message text
containg your text along with the warning:
"The description for Event ID ( 0 ) in Source ( Application ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event:" YOUR TEXT HERE.
2) Call ReportEvent api function.
See also TNTEventLog component:
http://www.online-admin.com/ntset.html#TNTEventLog
Hope this helps,
Serguei
"Alexander Bauer" <Alexander.Bauer@AlBaWare.de> wrote:
>Hi all,
>
>It's my verry first Service I'm trying to write and I have some problems.
>
>The sevice should scan a MS Access DB for some special field values via ADO.
>This is tested in an app and working fine so far.
>
>The problem is:
>I first get the name of the System-DSN out of an INI-File (works fine).
>Now I try to read data from this System-DSN from the Registry.
>Anything is OK but the service seems not to be allowed to access the
>registry - My test-app can read anything fine, so I think it's nothing wrong
>with me reg-access stuff (it's omply copied to the service). Can any one
>tell me what I'd miss?
>
>Also I've seen that I have to define some event-id texts for the loggin in
>the Win2K eventlog.
>How / where to do that?
>
>Thanks in advance.
>
>Regards,
> Alexander Bauer
>
>
- Next message: Serguei: "Re: Setting IP Address (Registry)"
- Previous message: Qzg=FCr=20TU=D0RUL?=: "Re: application.hide .."
- In reply to: Alexander Bauer: "My Service needs to acces the Registry..."
- Next in thread: Alexander Bauer: "Re: My Service needs to acces the Registry..."
- Reply: Alexander Bauer: "Re: My Service needs to acces the Registry..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|