all groups > dotnet interop > march 2005 >
You're in the

dotnet interop

group:

Problems accessing shared memory


Problems accessing shared memory Terje Henriksen
3/31/2005 2:54:00 PM
dotnet interop:

We have a set of .Net programs that uses a shared memory segment. (see 1 for
details)
The problem is that in some cases, a normal domain user is no longer able to
create or access the shared memory segment on a specific computer.
It works on other computers for the same user.
The problem persists even if the computer is restarted. Other domain users
or local users on the same computer does not have the problem.
The user can run other DotNet framework programs that does not try to
connect to the shared memory.
The problem seems to occur the first time or one of the first times that a
user logs on to the computer.
We have not found any method or workaround for the problem once it has
occured (except making a new user..)
For most users, the problem never occurs.

The problem is associated with the specific user on the specific computer.
This could perhaps mean that there is a problem with the local user policy.
I suspect that there might be a problem with the DotNet framework security
settings for the user... These settings are all default - we do not adjust
them.

We use Windows 2000 SP3 workstations and servers in a domain. (see 2 for
details)
We use DotNet framework 1.1 SP1, but all computers also has DotNet framework
1.0 SP2 installed. The problem did not appear until we upgraded to DotNet
framework 1.1.
The problem also appeared on a system using Windows 2003 server and Windows
XP, but we found a fix (see 3 for details). The fix does not work on Windows
2000.

We have done a number of things trying to fix the problem (see 4 for
details) but with no luck. The solution we have is to create a new user.
Unfortunately, I do not have the exact text of the error message, but the
error occurs as a program tries to connect to the shared memory. (We have
several different programs - all fail at the same place). I am not sure if
it is the DotNet framework security that gives an exception, or if it is an
error inside one of the Win32 system calls...

I would appreciate any help on this!

-Morgan, Navtek


1) Shared memory segment
The shared memory segment is created/accessed through the use of:
- CreateFileMapping (Kernel32.dll)
- SetSecurityInfo (Advapi32.dll) - Set permissions to allow full access for
all, to allow both local services and the logged in user access to the
shared memory.
- MapViewOfFile (Kernel32.dll)
Shared memory segments are created by the first process to open it. In our
system, this is normally a service, which is running as a specific domain
user.
However, the problem appears even if the user himself creates the shared
memory segment (the service is disabled, system rebooted, error still
appears..).

2) Windows 2000 Domain
The system run in a quite small domain with some Windows 2000 servers and
some Windows 2000 workstations, all with SP3. The problem has only been
observed on workstations, not servers. Active Directory policies are used
extensively. User permissions are very rescricted through AD (no access to
local drives etc).

3) Windows XP fix
The following solved the problem on Windows XP computers:
- Restart computer. Log in as local administrator. Stop all services
accessing the shared memory.
- Delete folder "c:\documents and settings\<username>"
- Restart computer.
This does not solve the problems on Windows 2000 workstations.

4) Things done to fix the problem:
These thing were tested (And yes, we did reboot after :-)
- Log the "problem user" on to a new workstation that he had not used before
(creates new lcoal profile). Works fine.
- Log in on the "problem computer" with a new user that has not used it
before (creates new local profile). Works fine
- Tried the fix described in 3). Did not help
- Used regedit, and deleted items that seemed to be specific to the "problem
user". Did not help.
- Tried to replace the files under c:\documents and settings\<problem user
name>\Application Data\Microsoft\CLR Security Config\ with files from
another user that did not have any problems. Did not help.

RE: Problems accessing shared memory v-phuang NO[at]SPAM online.microsoft.com (
4/1/2005 5:08:57 AM
Hi

Since the problem user is a Domain User which is authenticated by DC.
So I think you may also try to change the machine from the domain to
workgroup, restart machine and then change it back into domain and restart
again to see if that works.

If that does not work, I think we may have to create a new user with the
same name and password in the domain.
Please perform the test and let me know the result.

Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button