473,815 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
EventWaitHandle Security parameter, to get access to this event?
Aug 11 '07 #1
1 1217
Using API, i can do this by the following way:

SECURITY_DESCRI PTOR sd = {0};
InitializeSecur ityDescriptor(& sd, SECURITY_DESCRI PTOR_REVISION);
SetSecurityDesc riptorDacl(&sd, TRUE, NULL, FALSE);

SECURITY_ATTRIB UTES sa = {0};
sa.nLength = sizeof(SECURITY _ATTRIBUTES);
sa.bInheritHand le = FALSE;
sa.lpSecurityDe scriptor = &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
801
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 not! What is the Problem? How can I attach my EXE to the active desktop? Any ideas? Thanx so far! Kind regards
29
15558
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" ---Start of test.aspx---- <%@ Page language="C#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD>
27
4728
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 have so far...its builds fine but when I go to start the service i get the following error. --------------------------- Services ---------------------------
1
2640
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 ShellExecute("MyApp.appref-ms")),but not like under regular user account, some time,it acts as if the application is still not installed,it prompts to install first,especially after the Windows reboots. As we know, we need a service run in unattached situation.I don't know...
0
3689
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 from using a LocalSystem account to a user account. public static int ChangeService(string Name, string Password, string serviceName) { ManagementBaseObject inParams = null; ManagementObject srvc...
1
2343
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' account),and make it navigate to a url. The url in turns redirects to another page. This navigation/redirection is allowed in 2000 and XP ;but fails in 2003. Is this a result of difference in network privileges for localsystem account?
0
1139
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 written to the Application log. Can anyone spot my mistake? Const EVENT_LOG_SOURCE As String = "MyService" Const EVENT_LOG_NAME As String = "MyLog" Private Sub WriteEventLog(ByVal logMsg As String, ByVal type As...
1
2280
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 method of the remote object which updates the service config file, I get an access denied error. I have search the web and found out that LocalSystem account has the max priviliges. If so why do I get acces denied?
1
4047
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. Onenglish windows it is 'NT AUTHORITY\SYSTEM', but on other OSs it is something else. (e.g. In German it is 'NT AUTHORITÄT\SYSTEM ) The SID of the LocalSystem account is S-1-5-18', so we tried using Win32_Group class/table with SID='S-1-5-18' (On an...
0
9735
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10427
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10143
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7687
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5710
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.