The easiest way is to give your service the creation of shared memory and specify the DACL in CreateFileMapping, which gives regular users read access to the shared memory.
, . , , , IPC, , , DuplicateHandle, . , .
DACL - ConvertStringSecurityDescriptorToSecurityDescriptor, SDDL ACL.
DACL SDDL.
SECURITY_ATTRIBUTES security;
ZeroMemory(&security, sizeof(security));
security.nLength = sizeof(security);
ConvertStringSecurityDescriptorToSecurityDescriptor(
L"D:P(A;OICI;GA;;;SY)(A;OICI;GA;;;BA)(A;OICI;GR;;;IU)",
SDDL_REVISION_1,
&security.lpSecurityDescriptor,
NULL);
CreateFileMapping(INVALID_HANDLE_VALUE, &security,
PAGE_READWRITE, sizeHigh, sizeLow, L"Global\\MyObject");
LocalFree(securityDescriptor.lpSecurityDescriptor);
"D: P (A; OICI; GA;;; SY) (A; OICI; GA;;; BA) (A; OICI; GR;;; IU)" DACL. D: P , DACL ( SACL... SACL), ACE, , . A () (OICI). (GA - ) (SY) (BA, ). (GR) (IU), .
, OpenFileMapping, . , .
, GR GWGR. , - , , , .