473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Event created in the LocalSystem account

I have EventWaitHandle created in the service running in the LocalSystem
account. In the client application running under user account, I try to
create event with the same name - actually to attach to existing event. I
have error "Access to the path <event namedenied".
How can I create event in the client project initializing properly
EventWaitHandleSecurity parameter, to get access to this event?
Aug 11 '07 #1
1 1200
Using API, i can do this by the following way:

SECURITY_DESCRIPTOR sd = {0};
InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE);

SECURITY_ATTRIBUTES sa = {0};
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = FALSE;
sa.lpSecurityDescriptor = &sd;

HANDLE h = CreateEvent(&sa, TRUE, FALSE, name1);

Event created by this code is available both from system and user accounts.
How to do the same with managed event?
Aug 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hex40 | last post by:
Hi, a service starts my EXE. This service runs under localsystem account. My EXE then also runs under the localsystem account. My old program in VB6 shows a form, but the VB.NET program does...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
27
by: pisquem | last post by:
I am building an windows service that is to be deployed on a windows server 2003 and I want to have activity written to the event log, I want its own log called ('CustomLog') Below is what I...
1
by: dfererer | last post by:
Dear all, I want to install and run ClickOnce Deploying application under a Windows Service,I have make the service starting the application successfully(user API...
0
by: kustavo | last post by:
Good day. I would like to know if there is an API i can use to change windows service to run under LocalSystem account from a user account. Currently I am using the API below to change the service...
1
by: ranadhirnag | last post by:
Is there any difference in the privileges of the 'localsystem' account under XP,2000 and 2003 server? We are launching a browser from an INTERACTIVE windows service (running under 'localsystem'...
0
by: =?Utf-8?B?UmljaGFyZCBTd2luZ3dvb2Q=?= | last post by:
I have a service written in VB .NET 2003, running on Server 2003 under the localsystem account, that attempts to write to a custom event log. Whilst it creates the custom log ok, all events get...
1
by: clior43 | last post by:
Hi all, I have a window service installed under LocalSystem account. In addition, I have a win form which uses a remote object (using .Net remoting) to the service. When I try to activate a...
1
by: Boaz Ben-Porat | last post by:
This message is posted in the WMI group, but since the last answer in that group is one month old I post it in C# group too. We need to find the localized name of the LocalSystem account....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.