Access denied while trying to create a mutex.

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

Has anybody seen an 'Access denied' error when trying to create a mutex? If
so - what does that mean? I though Mutex's were not supposed to error out.

TIA - Jeff.
 
Hello, UJ!

U> Has anybody seen an 'Access denied' error when trying to create a mutex?
U> If so - what does that mean? I though Mutex's were not supposed to error
U> out.

AFAIK to create mutex, your code has to have SecurityPermissionFlag.UnmanagedCode flag.

Also if you're "creating" mutex that already exists you can have no access to it, if its creator had set appropriate ACLs

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
The thing that is weird is it happens only occasionally. If we restart the
program, it will work.
 
Hello, UJ!

Interesting, give us more context for the problem: what is creating mutex, how it is used, are there any security related operations in the application etc.?

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
It's in stand alone programs. I've got multiple programs trying to write to
a log file so I mutex around the writes. That seems to be where the problem
lies.

I haven't done anything with security so it should be OK.
 
Make sure all you program run in the same logon session as the owner of the
mutex, that is, make sure no-one impersonates when accessing the mutex.

Willy.


| It's in stand alone programs. I've got multiple programs trying to write
to
| a log file so I mutex around the writes. That seems to be where the
problem
| lies.
|
| I haven't done anything with security so it should be OK.
|
| | >I recomend look at these threads
| >
http://groups.google.com/group/micr..._frm/thread/5edc1a4af7eb0c90/b9a3b2ea6976b16d
| >
| >
http://groups.google.com/group/micr..._frm/thread/d95fa7f75289d7b6/da1e34df50df665f
| >
| > BTW, Did u create windows service and use mutex there?
| >
| >>> The thing that is weird is it happens only occasionally. If we restart
| >>> the
| >>> program, it will work.
| >
| > --
| > WBR,
| > Michael Nemtsev :: blog: http://spaces.msn.com/laflour
| >
| > "At times one remains faithful to a cause only because its opponents do
| > not
| > cease to be insipid." (c) Friedrich Nietzsche
| >
| >
|
|
 
I originally had all the programs in the startup group. I now have a program
that launches each of the programs in order. I'm doing nothing with security
so I have to assume that I'm the same user for each program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top