Can not access existing shared memory segmnt

We have two applications which share memory segment for communication. Application-1 creates a shared memory segment using shmget(). Application-2 attaches to the same segment using the same key passed as first parameter to shmget. Application-2 when started from an agent application that runs as stand alone application, is able to attach the shared memory segment created by application-1. But when application-2 is fired from the same agent application running as service, then it does not get access to the shared memory segment. In this case shmget() returns -1 with errno as 2 (ENOENT)

the service is started using the same account which is used as log in account and has administrative privileges

1. Can someone explain this behavior? 2.Where does windows OS store the information about existing shared memory segment like where Linux stores in /proc/sysvipc/shmor is there any tool on windows which gives information about existing shared memory segments?

1. Can someone explain this behavior? I really can't, unless the account you're using to run this service doesn't have permissions to create such objects, or doesn't have access to your POSIX emulator. (shmget() is not in the Win32 SDK, but the equivalent function would be OpenFileMapping().)

2.Where does windows OS store the information about existing shared memory segment like where Linux stores in /proc/sysvipc/shmIt's hard to know what/how the memory is shared, but chances are you'd find what you're looking for in the Object Manager. I know there's an API to enumerate it, but I haven't looked into it. WinObj should show you, though.

The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Compnet Ventures, LLC hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.