Can not access existing shared memory segmnt

Microsoft Windows server 2003 enterprise
July 21, 2010 at 05:14:30
Specs: Windows 2003 server
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/shm
or is there any tool on windows which gives information about existing shared memory segments?



See More: Can not access existing shared memory segmnt

Report •

#1
July 22, 2010 at 15:02:35
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/shm
It'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.


Report •
Related Solutions


Ask Question