in Education by
I am creating an appcation on Vista,which include a service and a Console application .Both running in same user account In service i am creating an event and waits for that event.In console application i am opening the same event (problem starts here) and calling SetEvent function. I can not open the event (getting error 5,Access is denied) in the console application.I searched in the net and saw something about integrity level (I am not sure that the problem is related to integrity level).Its telling that service and applicaation got differnt integrity levels. here is the part of the code,where IPC occures service DWORD WINAPI IpcThread(LPVOID lpParam) { HANDLE ghRequestEvent = NULL ; ghRequestEvent = CreateEvent(NULL, FALSE, FALSE, "Global\\Event1") ; //creating the event if(NULL == ghRequestEvent) { //error } while(1) { WaitForSingleObject(ghRequestEvent, INFINITE) //waiting for the event //here some action related to event } } Console Application Here in application ,opening the event and seting the event unsigned int event_notification() { HANDLE ghRequestEvent = NULL ; ghRequestEvent = OpenEvent(SYNCHRONIZE|EVENT_MODIFY_STATE, FALSE, "Global\\Event1") ; if(NULL == ghRequestEvent) { //error } SetEvent(ghRequestEvent) ; } I am running both application (serivce and console application) with administrative privilege (i logged in as Administraor and running the console application by right clicking and using the option "run as administrator") . The error i am getting in console application (where i am opening the event) is error no 5(Access is denied. ) . So it will be very helpfull if you tell how to do the IPC between a service and an application in Vista Thanks in advance Navaneeth JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Are the service and the application running as the same user with different integrity levels, or are they running as different users? If it is the former, then this article from MSDN which talks about integrity levels might help. They have some sample code for lowering the integrity level of a file. I'm not sure that this could be relevant for an event though. #include #include #include void SetLowLabelToFile() { // The LABEL_SECURITY_INFORMATION SDDL SACL to be set for low integrity #define LOW_INTEGRITY_SDDL_SACL_W L"S:(ML;;NW;;;LW)" DWORD dwErr = ERROR_SUCCESS; PSECURITY_DESCRIPTOR pSD = NULL; PACL pSacl = NULL; // not allocated BOOL fSaclPresent = FALSE; BOOL fSaclDefaulted = FALSE; LPCWSTR pwszFileName = L"Sample.txt"; if (ConvertStringSecurityDescriptorToSecurityDescriptorW( LOW_INTEGRITY_SDDL_SACL_W, SDDL_REVISION_1, &pSD;, NULL)) { if (GetSecurityDescriptorSacl(pSD, &fSaclPresent;, &pSacl;, &fSaclDefaulted;)) { // Note that psidOwner, psidGroup, and pDacl are // all NULL and set the new LABEL_SECURITY_INFORMATION dwErr = SetNamedSecurityInfoW((LPWSTR) pwszFileName, SE_FILE_OBJECT, LABEL_SECURITY_INFORMATION, NULL, NULL, NULL, pSacl); } LocalFree(pSD); } } If it is the latter you might look at this link which suggests creating a NULL ACL and associating it with the object (in the example it is a named pipe, but the approach is similar for an event I'm sure: BYTE sd[SECURITY_DESCRIPTOR_MIN_LENGTH]; SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = &sd; InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(&sd, TRUE, (PACL) 0, FALSE); CreateNamedPipe(..., &sa);

Related questions

0 votes
    I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Is there a reliable way to detect whether or not WinHelp is installed on Windows Vista or newer versions of ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    I have a legacy VB6 executable that runs on Vista. This executable shells out another legacy MFC C++ ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 22, 2022 in Education by JackTerrance
0 votes
    What is Windows Vista? (a) Processor (b) Output Device (c) Storage Device (d) Input Device (e) Operating System Select the correct answer from above options...
asked Dec 11, 2021 in Education by JackTerrance
0 votes
    Which of the following service is used for fast and reliable application updates and bug fixes? Select ... AWS Interview Questions and Answers Agile Interview Questions Answers...
asked Jul 21, 2021 in Technology by Editorial Staff
0 votes
    Which of the following is not an application layer service? A. Network virtual terminal B. File transfer, access, and management C. Mail service D. Error control...
asked Jan 6, 2023 in Education by JackTerrance
0 votes
    What are the various K8's services running on nodes and describe the role of each service?...
asked Jul 15, 2021 in Technology by JackTerrance
0 votes
    I want to implement Web sockets for a couple of Web services. How will the stateful HTTP connections impact Blue- ... . Please help. Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    ______________ perform automated DoS (Denial of Service) attacks on a targeted web address. (a) DDoS-Trojan ... -Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Nov 1, 2021 in Education by JackTerrance
0 votes
    On providing a service in two components’ “providers” section of @Component decorator, the number of instances of service that will be created is 1 2 3 4...
asked Jun 29, 2021 in Technology by JackTerrance
+1 vote
    SQL Azure is a cloud-based relational database service that is based on _________....
asked Oct 20, 2020 in Technology by JackTerrance
0 votes
    write a short note on the following 1] Characteristic of computer 2] Application of computer 3] Storage devices ... , Plz answer Select the correct answer from above options...
asked Dec 11, 2021 in Education by JackTerrance
0 votes
    A company is planning on hosting an application on an Azure Virtual Machine. It needs to be ensured that the application ... plan. Would this satisfy the requirement A. Yes B. No...
asked Nov 20, 2022 in Education by JackTerrance
...