Click here to Skip to main content
15,922,574 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: IPC on Vista (service and application) Pin
Mark Salsbery22-Sep-08 4:36
Mark Salsbery22-Sep-08 4:36 
GeneralRe: IPC on Vista (service and application) Pin
navaneethm22-Sep-08 20:51
navaneethm22-Sep-08 20:51 
GeneralRe: IPC on Vista (service and application) Pin
Mark Salsbery23-Sep-08 5:30
Mark Salsbery23-Sep-08 5:30 
GeneralRe: IPC on Vista (service and application) Pin
navaneethm23-Sep-08 20:53
navaneethm23-Sep-08 20:53 
GeneralRe: IPC on Vista (service and application) Pin
Mark Salsbery24-Sep-08 5:18
Mark Salsbery24-Sep-08 5:18 
GeneralRe: IPC on Vista (service and application) Pin
navaneethm24-Sep-08 18:02
navaneethm24-Sep-08 18:02 
GeneralRe: IPC on Vista (service and application) Pin
Mark Salsbery25-Sep-08 5:16
Mark Salsbery25-Sep-08 5:16 
GeneralRe: IPC on Vista (service and application) Pin
Mark Salsbery25-Sep-08 10:39
Mark Salsbery25-Sep-08 10:39 
OK got it. Here's code that works on Vista with the event
created in a service:
// In the service

	SECURITY_DESCRIPTOR sd = {0};
	::InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
	::SetSecurityDescriptorDacl(&sd, TRUE, 0, FALSE);
	SECURITY_ATTRIBUTES sa = {0};
	sa.nLength = sizeof(SECURITY_ATTRIBUTES);
	sa.lpSecurityDescriptor = &sd;

	HANDLE ghRequestEvent = ::CreateEvent(&sa, FALSE, FALSE, _T("Global\\Role_Set")) ; //creating the event
	if(NULL == ghRequestEvent)
	{
		//error
		return;
	}
	::WaitForSingleObject(ghRequestEvent, INFINITE);
	::CloseHandle(ghRequestEvent);

// in the second app

	HANDLE ghRequestEvent = ::OpenEvent(EVENT_MODIFY_STATE, FALSE, _T("Global\\Role_Set"));
	if(NULL == ghRequestEvent)
	{
		//error
		return;
	}
	::SetEvent(ghRequestEvent);
	::CloseHandle(ghRequestEvent);

I would expect OpenEvent() to return NULL with GetLastError returning an access
denied error but instead it returns a valid handle that does nothing when you use it.
SetEvent() succeeds as well. Unsure | :~

Hopefully that will work for you Smile | :)
Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: IPC on Vista (service and application) Pin
navaneethm25-Sep-08 19:48
navaneethm25-Sep-08 19:48 
GeneralRe: IPC on Vista (service and application) Pin
navaneethm24-Sep-08 18:30
navaneethm24-Sep-08 18:30 
QuestionHow to install updates from server system to clients systems. Pin
brucewayn18-Sep-08 21:15
brucewayn18-Sep-08 21:15 
AnswerRe: How to install updates from server system to clients systems. Pin
Rajesh R Subramanian18-Sep-08 21:53
professionalRajesh R Subramanian18-Sep-08 21:53 
GeneralRe: How to install updates from server system to clients systems. Pin
brucewayn18-Sep-08 22:31
brucewayn18-Sep-08 22:31 
GeneralRe: How to install updates from server system to clients systems. Pin
Rajesh R Subramanian19-Sep-08 1:30
professionalRajesh R Subramanian19-Sep-08 1:30 
QuestionAdd/Remove operation is impossible, because code element "MyDlg" is read only ! Pin
kapardhi18-Sep-08 20:46
kapardhi18-Sep-08 20:46 
AnswerRe: Add/Remove operation is impossible, because code element "MyDlg" is read only ! Pin
David Crow19-Sep-08 3:20
David Crow19-Sep-08 3:20 
QuestionDebug Assertion Failure Pin
bhanu_850918-Sep-08 20:39
bhanu_850918-Sep-08 20:39 
AnswerRe: Debug Assertion Failure Pin
Cedric Moonen18-Sep-08 20:46
Cedric Moonen18-Sep-08 20:46 
GeneralRe: Debug Assertion Failure Pin
bhanu_850918-Sep-08 21:52
bhanu_850918-Sep-08 21:52 
GeneralRe: Debug Assertion Failure Pin
Cedric Moonen18-Sep-08 21:54
Cedric Moonen18-Sep-08 21:54 
GeneralRe: Debug Assertion Failure Pin
bhanu_850918-Sep-08 22:03
bhanu_850918-Sep-08 22:03 
GeneralRe: Debug Assertion Failure Pin
Cedric Moonen18-Sep-08 22:13
Cedric Moonen18-Sep-08 22:13 
QuestionRe: Debug Assertion Failure Pin
Rajesh R Subramanian18-Sep-08 22:01
professionalRajesh R Subramanian18-Sep-08 22:01 
AnswerRe: Debug Assertion Failure Pin
bhanu_850918-Sep-08 22:10
bhanu_850918-Sep-08 22:10 
QuestionRe: Debug Assertion Failure Pin
Rajesh R Subramanian18-Sep-08 22:14
professionalRajesh R Subramanian18-Sep-08 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.